feat(gitlab): Add exclude.userOwnedProjects config setting#498
feat(gitlab): Add exclude.userOwnedProjects config setting#498brendan-kellam merged 3 commits intomainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughIntroduces a new exclude option userOwnedProjects across GitLab connection schemas, docs, and configuration. Implements corresponding exclusion logic in backend shouldExcludeProject and adds a unit test. Updates CHANGELOG. No other behavioral or public API signature changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Scheduler as Sync Scheduler
participant GitLab as GitLab API
participant Backend as GitLab Sync Backend
participant Filter as shouldExcludeProject
Scheduler->>Backend: Start sync
Backend->>GitLab: List projects
GitLab-->>Backend: Projects[]
loop For each project
Backend->>Filter: Evaluate exclusions
alt exclude.userOwnedProjects && project.namespace.kind == "user"
Note over Filter: Exclude due to user-owned project
Filter-->>Backend: true (reason: exclude.userOwnedProjects)
Backend-->>Backend: Skip project
else other exclusion checks
Filter-->>Backend: true/false
end
Backend-->>Scheduler: Continue next project
end
Scheduler-->>Scheduler: Sync complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This comment has been minimized.
This comment has been minimized.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/docs/connections/gitlab.mdx (1)
87-89: Fix broken JSON example: add missing comma after groups.Without a comma after the closing bracket of "groups", the example can’t be copy-pasted as valid JSON.
Apply:
- ] + ], // ...except: "exclude": {
🧹 Nitpick comments (3)
packages/schemas/src/v3/gitlab.type.ts (1)
59-62: Type addition looks goodField name and doc match the intended behavior. Consider clarifying in the JSDoc that “user-owned” maps to projects where
project.namespace.kind === 'user'for completeness.docs/docs/connections/gitlab.mdx (1)
93-94: Clarify what “user-owned projects” means and its precedence.Suggest adding a short note that “user-owned” refers to projects in a personal namespace (namespace.kind === "user") and that this exclusion applies even when specific users are listed under "users".
docs/snippets/schemas/v3/index.schema.mdx (1)
609-613: Add exclude.userOwnedProjects: LGTM; consider clarifying wording and precedenceWording nit: to avoid ambiguity, consider “Exclude projects in a user’s personal namespace (namespace.kind == 'user') from syncing.” Also, if this exclusion takes precedence over explicit includes (users/projects/all), add a short note mirroring how other exclude flags behave.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (14)
CHANGELOG.md(1 hunks)docs/docs/connections/gitlab.mdx(1 hunks)docs/snippets/schemas/v3/connection.schema.mdx(1 hunks)docs/snippets/schemas/v3/gitlab.schema.mdx(1 hunks)docs/snippets/schemas/v3/index.schema.mdx(1 hunks)packages/backend/src/gitlab.test.ts(1 hunks)packages/backend/src/gitlab.ts(1 hunks)packages/schemas/src/v3/connection.schema.ts(1 hunks)packages/schemas/src/v3/connection.type.ts(1 hunks)packages/schemas/src/v3/gitlab.schema.ts(1 hunks)packages/schemas/src/v3/gitlab.type.ts(1 hunks)packages/schemas/src/v3/index.schema.ts(1 hunks)packages/schemas/src/v3/index.type.ts(1 hunks)schemas/v3/gitlab.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (9)
schemas/v3/gitlab.json (1)
100-104: Schema change is consistentBoolean with default false and clear description. All good.
CHANGELOG.md (1)
10-12: Changelog entry is clearCorrect scope, link, and placement under Unreleased.
packages/schemas/src/v3/gitlab.schema.ts (1)
128-132: Schema update LGTMMatches JSON schema and types; no additional constraints needed.
docs/snippets/schemas/v3/gitlab.schema.mdx (1)
129-133: Docs snippet syncedAccurately reflects the new option.
packages/schemas/src/v3/index.type.ts (1)
281-284: Type surface synchronizedMatches other schema/type files and backend usage.
packages/schemas/src/v3/connection.type.ts (1)
156-159: LGTM: type surface matches docs and schema.The new optional exclude flag is clear and consistent with other providers’ exclude options.
docs/snippets/schemas/v3/connection.schema.mdx (1)
346-350: LGTM: schema snippet correctly documents userOwnedProjects.Type, default, and description align with the code and generated schemas.
packages/schemas/src/v3/connection.schema.ts (1)
345-349: Verify schema and backend integration of userOwnedProjects
No occurrences of userOwnedProjects were found beyond its declaration in packages/schemas/src/v3/connection.schema.ts – confirm that both generated JSON schemas (schemas/v3/gitlab.json and packages/schemas/src/v3/gitlab.json) include it with"type": "boolean", "default": false, and thatpackages/backend/src/gitlab.tsimplements the exclusion logic.packages/schemas/src/v3/index.schema.ts (1)
608-612: LGTM: index schema mirrors connection schema for userOwnedProjects.Consistent default and description.
Adds
exclude.userOwnedProjectsto GitLab config setting to allow for excluding all user owned projects from syncing.Summary by CodeRabbit
New Features
Documentation
Tests