-
Notifications
You must be signed in to change notification settings - Fork 192
feat(gerrit): Multi-branch indexing support for Gerrit #433
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
Conversation
WalkthroughThis update introduces multi-branch indexing support for Gerrit. Documentation, changelogs, schemas, and type definitions have been updated to add an optional Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ConfigFile
participant Backend
participant Gerrit
User->>ConfigFile: Adds/updates Gerrit connection with revisions (branches/tags)
ConfigFile->>Backend: Loads Gerrit connection config
Backend->>Backend: Reads revisions (branches/tags) from config
Backend->>Gerrit: Requests refs for specified branches/tags
Gerrit-->>Backend: Returns matching refs
Backend->>Backend: Indexes code for each specified branch/tag
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
docs/snippets/schemas/v3/connection.schema.mdx (1)
641-682: SamemaxItemsenforcement missing here – see comment in the generated TypeScript schema.
🧹 Nitpick comments (3)
packages/schemas/src/v3/gerrit.type.ts (1)
32-44: Consider consolidating duplicate GitRevisions interface.The
GitRevisionsinterface appears to be duplicated across multiple type files (connection.type.ts,gerrit.type.ts, etc.). Since this is an auto-generated file, consider updating the generation process to import the interface from a shared location rather than duplicating the definition.This would improve maintainability and reduce the risk of inconsistencies between identical interface definitions across different files.
docs/snippets/schemas/v3/index.schema.mdx (1)
904-945: Consider encoding the 64-entry ceiling directly in the schemaThe description for both
branchesandtagsmentions that only the first 64 entries are honoured, yet the JSON Schema itself does not include amaxItems: 64constraint. Encoding the limit in the schema gives earlier feedback to users and schema-driven tooling, rather than deferring checks to runtime.Example diff for the
branchesarray (same idea fortags):"items": { "type": "string" }, + "maxItems": 64, "examples": [If the omission is intentional (e.g., to share one generator across hosts), feel free to disregard.
packages/schemas/src/v3/gerrit.schema.ts (1)
61-102: Schema generator: addmaxItemsto reflect documented behaviourSame as the MDX snippet, the runtime cap of 64 revisions isn’t enforced in this auto-generated TS schema. Adding
"items": { "type": "string" }, + "maxItems": 64,to both
branchesandtagswould make validation consistent with the docs and with the rest of the host schemas.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
CHANGELOG.md(1 hunks)docs/docs/features/search/multi-branch-indexing.mdx(1 hunks)docs/snippets/schemas/v3/connection.schema.mdx(1 hunks)docs/snippets/schemas/v3/gerrit.schema.mdx(1 hunks)docs/snippets/schemas/v3/index.schema.mdx(1 hunks)packages/backend/src/repoCompileUtils.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/gerrit.schema.ts(1 hunks)packages/schemas/src/v3/gerrit.type.ts(1 hunks)packages/schemas/src/v3/index.schema.ts(1 hunks)packages/schemas/src/v3/index.type.ts(1 hunks)schemas/v3/gerrit.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*
📄 CodeRabbit Inference Engine (.cursor/rules/style.mdc)
Filenames should always be camelCase. Exception: if there are filenames in the same directory with a format other than camelCase, use that format to keep things consistent.
Files:
CHANGELOG.mdschemas/v3/gerrit.jsondocs/docs/features/search/multi-branch-indexing.mdxpackages/schemas/src/v3/connection.type.tsdocs/snippets/schemas/v3/gerrit.schema.mdxpackages/schemas/src/v3/index.type.tspackages/schemas/src/v3/gerrit.type.tspackages/schemas/src/v3/index.schema.tspackages/backend/src/repoCompileUtils.tspackages/schemas/src/v3/connection.schema.tspackages/schemas/src/v3/gerrit.schema.tsdocs/snippets/schemas/v3/index.schema.mdxdocs/snippets/schemas/v3/connection.schema.mdx
🧬 Code Graph Analysis (3)
packages/schemas/src/v3/connection.type.ts (1)
packages/schemas/src/v3/gerrit.type.ts (1)
GitRevisions(35-44)
packages/schemas/src/v3/index.type.ts (1)
packages/schemas/src/v3/connection.type.ts (1)
GitRevisions(90-99)
packages/schemas/src/v3/gerrit.type.ts (1)
packages/schemas/src/v3/connection.type.ts (1)
GitRevisions(90-99)
⏰ 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)
CHANGELOG.md (1)
10-11: LGTM!The changelog entry accurately documents the new multi-branch indexing support for Gerrit and follows the established format with proper PR reference.
docs/docs/features/search/multi-branch-indexing.mdx (1)
92-92: LGTM!Correctly updates Gerrit's multi-branch indexing support status from unsupported to supported, reflecting the new feature implementation.
packages/schemas/src/v3/index.type.ts (1)
372-372: LGTM!The addition of the optional
revisionsproperty toGerritConnectionConfigis consistent with other connection types and properly typed using the existingGitRevisionsinterface.schemas/v3/gerrit.json (1)
61-62: LGTM!The JSON schema correctly adds the optional
revisionsproperty with proper reference to the sharedGitRevisionsdefinition, maintaining consistency with other connection schemas.packages/schemas/src/v3/connection.type.ts (1)
247-247: LGTM!The addition of the optional
revisionsproperty toGerritConnectionConfigmaintains consistency with other connection types and is properly typed with the well-documentedGitRevisionsinterface.packages/backend/src/repoCompileUtils.ts (1)
313-314: LGTM! Consistent implementation of multi-branch indexing for Gerrit.The addition of
branchesandtagsproperties to the Gerrit metadata follows the same pattern established in other compile functions throughout this file. The use of optional chaining and nullish coalescing operators appropriately handles the optional nature of therevisionsproperty.packages/schemas/src/v3/gerrit.type.ts (1)
30-30: LGTM! Proper addition of revisions support.The optional
revisionsproperty correctly extends the Gerrit configuration to support multi-branch indexing.docs/snippets/schemas/v3/gerrit.schema.mdx (1)
62-103: LGTM! Comprehensive schema definition for revisions.The JSON schema properly defines the
revisionsproperty with:
- Clear descriptions explaining the 64-item limit and glob pattern support
- Appropriate examples showing both specific patterns and wildcards
- Proper validation constraints with
additionalProperties: false- Consistent structure with other connection schemas
The schema documentation accurately reflects the multi-branch indexing functionality.
packages/schemas/src/v3/index.schema.ts (1)
903-944: LGTM! Well-structured schema addition for Gerrit multi-branch indexing.The
revisionsproperty addition is consistent with existing connection types and follows established schema patterns. The implementation includes comprehensive documentation, appropriate constraints (64-entry limit), and proper validation rules.
This PR adds support for multi-branch indexing to Gerrit.
Summary by CodeRabbit
New Features
Documentation