Skip to content

Conversation

@Shironex
Copy link
Collaborator

Updated the PR state handling to use a consistent uppercase format ('OPEN', 'MERGED', 'CLOSED') throughout the codebase. This includes changes to the worktree metadata interface, PR creation logic, and related tests to ensure uniformity and prevent potential mismatches in state representation.

Additionally, modified the GitHub PR fetching logic to retrieve all PR states, allowing for better detection of state changes.

This refactor enhances clarity and consistency in how PR states are managed and displayed.
@coderabbitai
Copy link

coderabbitai bot commented Jan 17, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@Shironex Shironex changed the title efactor: standardize PR state representation across the application refactor: standardize PR state representation across the application Jan 17, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Shironex, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on refining how Pull Request (PR) states are managed and represented within the application. The primary goal is to establish a unified and accurate system for tracking PR statuses by standardizing the state representation and improving the synchronization mechanism with GitHub. This ensures that the application's view of PRs is always up-to-date, regardless of whether changes originated within the app or directly on GitHub.

Highlights

  • Standardized PR State Type: Introduced a new PRState type ('OPEN' | 'MERGED' | 'CLOSED') to explicitly define and standardize the possible states of a Pull Request across the application, ensuring type safety and consistency.
  • Consistent State Value Usage: Updated all instances where PR states are assigned or stored to use the new PRState type and its uppercase values (e.g., 'OPEN', 'MERGED', 'CLOSED'), aligning with how GitHub CLI returns these states. The 'draft' state is now consistently mapped to 'OPEN'.
  • Enhanced PR State Detection and Synchronization: Modified the PR fetching logic to retrieve all PR states (open, merged, closed) from GitHub. This enables the application to detect and synchronize changes in PR status that occur externally (e.g., a PR being merged or closed directly on GitHub) and update local metadata accordingly.
  • Improved Metadata Handling: Implemented logic to prioritize fresh PR data from GitHub over cached local metadata. If a discrepancy is found (e.g., a state change or an externally created PR), the local metadata is asynchronously updated to reflect the most current GitHub status.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a solid refactoring that standardizes the representation of pull request states across the application by introducing a PRState type. The changes also improve the logic for fetching and synchronizing PR states from GitHub, making the application more robust. My review focuses on further improving robustness by validating data from external APIs and enhancing maintainability by addressing code duplication.

Base automatically changed from v0.12.0rc to main January 17, 2026 23:50
@Shironex Shironex changed the base branch from main to v0.13.0rc January 18, 2026 10:45
@Shironex Shironex merged commit 327aef8 into v0.13.0rc Jan 18, 2026
5 of 6 checks passed
@Shironex Shironex deleted the feature/v0.12.0rc-1768688900786-5ea1 branch January 18, 2026 10:46
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.

1 participant