Skip to content

feat: add rev:* syntax to explicitly search all branches #281

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 4 commits into from
Apr 30, 2025

Conversation

brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Apr 29, 2025

This PR makes it s.t., using rev:* searches all revisions that are indexed for a given repository.

Fixes #120

Summary by CodeRabbit

  • New Features
    • Enabled wildcard searches across all branches using the revision query prefix with an asterisk (*), allowing users to search across all revisions.
    • Added documentation on multi-branch and tag searching, including configuration and search syntax guidance.
    • Updated documentation navigation with a new "Supported platforms" subgroup and a page on multi-branch indexing.

@brendan-kellam brendan-kellam requested a review from msukkari April 29, 2025 06:14
Copy link

coderabbitai bot commented Apr 29, 2025

Walkthrough

The update modifies the transformZoektQuery function within the search service to improve how revision-based queries are translated for Zoekt. Specifically, it introduces logic to handle the case where the revision is specified as "*", converting this to an empty string in the Zoekt query, which enables searching across all branches. The rest of the query transformation logic remains as before, with no changes to exported or public entities.

Changes

File(s) Change Summary
packages/web/src/lib/server/searchService.ts Updated transformZoektQuery to treat rev:* or revision:* as a wildcard for all branches.
CHANGELOG.md Added entry documenting the new rev:* wildcard feature for searching across all branches.
docs/docs.json Reorganized connection platform pages under "Supported platforms" subgroup; added new multi-branch indexing doc page.
docs/docs/more/multi-branch-indexing.mdx Added new documentation explaining multi-branch and tag indexing, search syntax for rev:, and platform support.

Assessment against linked issues

Objective Addressed Explanation
Enable search across all branches when no specific branch is specified, supporting wildcard revision logic (#120)

Poem

A hop and a skip through branches galore,
Now "rev:*" opens every door.
No more searching just in "main,"
All your branches join the game!
With a whisk of code and a twitch of nose,
Every revision’s path now shows.
— 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

msukkari
msukkari previously approved these changes Apr 29, 2025
@brendan-kellam brendan-kellam changed the title Add rev:* syntax to explicitly search all branches feat: add rev:* syntax to explicitly search all branches Apr 29, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🔭 Outside diff range comments (1)
docs/docs/more/multi-branch-indexing.mdx (1)

1-94: 🛠️ Refactor suggestion

Ensure changelog is updated to document this feature
Please add an entry under "Unreleased" in CHANGELOG.md describing the addition of multi-branch indexing and the new rev:* syntax in the documentation.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~58-~58: You might be missing the article “the” here.
Context: ...anches or tags matching the patterns in branches and tags array will be index...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🧹 Nitpick comments (2)
docs/docs/more/multi-branch-indexing.mdx (2)

18-18: Fix grammatical mistake in configuration section
Change "configured on in the [connection]" to "configured in the [connection]" for clearer grammar. For example:

- Multi-branch indexing is configured on in the [connection] using the `revisions.branches` and `revisions.tags` arrays.
+ Multi-branch indexing is configured in the [connection] using the `revisions.branches` and `revisions.tags` arrays.

58-58: Add missing article and correct pluralization
In the sentence "patterns in branches and tags array", add "the" before "branches" and pluralize "array" to "arrays":

- any branches or tags matching the patterns in `branches` and `tags` array will be indexed.
+ any branches or tags matching the patterns in the `branches` and `tags` arrays will be indexed.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~58-~58: You might be missing the article “the” here.
Context: ...anches or tags matching the patterns in branches and tags array will be index...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f29fdd and 8f0f0eb.

📒 Files selected for processing (2)
  • docs/docs.json (1 hunks)
  • docs/docs/more/multi-branch-indexing.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/docs.json
🧰 Additional context used
🪛 LanguageTool
docs/docs/more/multi-branch-indexing.mdx

[uncategorized] ~58-~58: You might be missing the article “the” here.
Context: ...anches or tags matching the patterns in branches and tags array will be index...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🔇 Additional comments (2)
docs/docs/more/multi-branch-indexing.mdx (2)

1-4: Verify inclusion in navigation
Ensure that this new MDX page is referenced in docs/docs.json under the "Supported platforms" subgroup within "Connecting your code," so it appears in the sidebar.


14-16: Verify admonition syntax
Confirm that the <Warning> MDX component is available or imported in your Docusaurus/MDX setup. If not, consider using the standard admonition syntax (e.g., :::warning).

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
docs/docs/more/multi-branch-indexing.mdx (4)

18-18: Fix preposition in configuration description.
The phrase “configured on in the connection” is awkward—remove the extra “on” to read:

- Multi-branch indexing is configured on in the [connection]
+ Multi-branch indexing is configured in the [connection]

58-58: Clarify grammar and plurality.
Change to “…patterns in the branches and tags arrays will be indexed.” to include the article “the” and pluralize “arrays.”

- any branches or tags matching the patterns in `branches` and `tags` array will be indexed.
+ any branches or tags matching the patterns in the `branches` and `tags` arrays will be indexed.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~58-~58: You might be missing the article “the” here.
Context: ...anches or tags matching the patterns in branches and tags array will be index...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


67-67: Remove trailing space in code example.
There’s an extra space inside the backticks—trim it for consistency:

- | `rev:feature/foo useEffect ` | …
+ | `rev:feature/foo useEffect` | …

6-6: Improve readability by reducing repetition.
Consider rephrasing to avoid repeating “default” twice:

- By default, only the default branch of a repository is indexed and can be searched.
+ By default, only a repository’s default branch is indexed and searchable.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f0f0eb and c46d437.

📒 Files selected for processing (4)
  • CHANGELOG.md (1 hunks)
  • docs/docs.json (1 hunks)
  • docs/docs/more/multi-branch-indexing.mdx (1 hunks)
  • packages/web/src/lib/server/searchService.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/web/src/lib/server/searchService.ts
  • docs/docs.json
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md

[duplication] ~10-~10: Possible typo: you repeated a word.
Context: ...pec/v2.0.0.html). ## [Unreleased] ### Added - Added special * value for rev: to allow s...

(ENGLISH_WORD_REPEAT_RULE)

docs/docs/more/multi-branch-indexing.mdx

[uncategorized] ~58-~58: You might be missing the article “the” here.
Context: ...anches or tags matching the patterns in branches and tags array will be index...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (1)
CHANGELOG.md (1)

10-11: Changelog entry is accurate.
The “Unreleased” section correctly documents the addition of rev:* for all-branch search with a link to PR #281.

🧰 Tools
🪛 LanguageTool

[duplication] ~10-~10: Possible typo: you repeated a word.
Context: ...pec/v2.0.0.html). ## [Unreleased] ### Added - Added special * value for rev: to allow s...

(ENGLISH_WORD_REPEAT_RULE)

@brendan-kellam brendan-kellam merged commit 14ce633 into main Apr 30, 2025
5 checks passed
@brendan-kellam brendan-kellam deleted the bkellam/rev_wildcard branch April 30, 2025 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

By default only main branch show up in search
2 participants