Skip to content

[Fix] Change GitLab syncing behaviour for groups and users to include projects that are _not_ owned by the token #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fixed issue with GitLab projects that are not owned but still visible by the provided `token` _not_ being synchronized. ([#51](https://github.com/sourcebot-dev/sourcebot/pull/51))

## [2.1.0] - 2024-10-22

### Added
Expand Down
2 changes: 0 additions & 2 deletions packages/backend/src/gitlab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const getGitLabReposFromConfig = async (config: GitLabConfig, ctx: AppCon
logger.debug(`Fetching project info for group ${group}...`);
const { durationMs, data } = await measure(() => api.Groups.allProjects(group, {
perPage: 100,
owned: true,
}));
logger.debug(`Found ${data.length} projects in group ${group} in ${durationMs}ms.`);

Expand All @@ -40,7 +39,6 @@ export const getGitLabReposFromConfig = async (config: GitLabConfig, ctx: AppCon
logger.debug(`Fetching project info for user ${user}...`);
const { durationMs, data } = await measure(() => api.Users.allProjects(user, {
perPage: 100,
owned: true,
}));
logger.debug(`Found ${data.length} projects owned by user ${user} in ${durationMs}ms.`);
return data;
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/schemas/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface GitLabConfig {
*/
url?: string;
/**
* List of users to sync with. All personal projects that the user owns will be synced, unless explicitly defined in the `exclude` property.
* List of users to sync with. All projects owned by the user and visible to the provided `token` (if any) will be synced, unless explicitly defined in the `exclude` property.
*/
users?: string[];
/**
Expand Down
2 changes: 1 addition & 1 deletion schemas/v2/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"items": {
"type": "string"
},
"description": "List of users to sync with. All personal projects that the user owns will be synced, unless explicitly defined in the `exclude` property."
"description": "List of users to sync with. All projects owned by the user and visible to the provided `token` (if any) will be synced, unless explicitly defined in the `exclude` property."
},
"groups": {
"type": "array",
Expand Down