-
Notifications
You must be signed in to change notification settings - Fork 148
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
Add Draft Pull request option #297
Conversation
Signed-off-by: Edward Kim <[email protected]>
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.
Hello @edify42, 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!
Summary of Changes
This pull request introduces the ability to mark a pull request as a draft in Bitbucket by adding a draft: true
option when creating the PR. I've added a Draft
field to the PullRequestsOptions
struct in bitbucket.go
and modified pullrequests.go
to include the draft status in the request body when creating a pull request.
Highlights
- New Feature: Draft Pull Requests: Adds support for creating draft pull requests in Bitbucket.
- Modified Struct: PullRequestsOptions: The
PullRequestsOptions
struct inbitbucket.go
now includes aDraft
field. - Request Body Update: The
buildPullRequestBody
function inpullrequests.go
now includes the draft status in the request body.
Changelog
- bitbucket.go
- Added
Draft
field to thePullRequestsOptions
struct (line 317). - Corrected the formatting of the
SSHKeyOptions
struct (lines 669, 670, 671, 672).
- Added
- pullrequests.go
- Modified
buildPullRequestBody
to include the draft status in the request body (lines 249-251).
- Modified
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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 is currently in preview and 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 to provide feedback.
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.
A draft PR's gentle start,
A safe space to build and chart,
Before the review,
A chance to renew,
And perfect the work of the heart.
Footnotes
-
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. ↩
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.
Code Review
This pull request introduces the functionality to mark a pull request as a draft in Bitbucket. The changes look good overall, but there are a few areas that could be improved for clarity and efficiency.
Summary of Findings
- Redundant boolean condition: The condition
po.CloseSourceBranch == true || po.CloseSourceBranch == false
can be simplified totrue
orpo.CloseSourceBranch || !po.CloseSourceBranch
can be simplified totrue
. - Inconsistent struct field alignment: The fields in
SSHKeyOptions
struct are not consistently aligned. While this doesn't affect functionality, aligning them improves readability.
Merge Readiness
The pull request is almost ready for merging. Addressing the redundant boolean condition and aligning the struct fields will improve the code's clarity and maintainability. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging.
if po.CloseSourceBranch || !po.CloseSourceBranch { | ||
body["close_source_branch"] = po.CloseSourceBranch |
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.
This condition is always true and can be simplified to true
. Consider removing the condition altogether and directly assigning body["close_source_branch"] = po.CloseSourceBranch
.
Alternatively, you can simplify the condition to po.CloseSourceBranch || !po.CloseSourceBranch
which is also always true, but less readable than just true
.
body["close_source_branch"] = po.CloseSourceBranch
hey @ktrysmt if you're still maintaining this 🙏 |
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.
LGTM
New feature in bitbucket allows for

draft: true
to be supplied when creating the PR to mark it as a DRAFT Pull request.