Skip to content

Merge push-nqrvnzxzrpkz Into main#92

Merged
dclong merged 1 commit into
mainfrom
push-nqrvnzxzrpkz
Jun 25, 2026
Merged

Merge push-nqrvnzxzrpkz Into main#92
dclong merged 1 commit into
mainfrom
push-nqrvnzxzrpkz

Conversation

@dclong

@dclong dclong commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

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

Copy link
Copy Markdown
Contributor

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 automated generation of pull request titles and descriptions. It adds a compare method to the Repository class, a new pr_content module featuring both deterministic and LiteLLM-based AI generation layers, and CLI options to trigger this generation when creating a pull request. The review feedback suggests several key improvements: enhancing breaking change detection to support both 'BREAKING CHANGE' and 'BREAKING-CHANGE' formats, making the LLM JSON parsing more robust against markdown code block wrapping, and optimizing API calls in the CLI script by fetching open pull requests once and exiting early if the PR already exists.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread github_rest_api/pr_content.py
Comment thread github_rest_api/pr_content.py Outdated
Comment thread github_rest_api/scripts/github/create_pull_request.py Outdated
Comment thread github_rest_api/scripts/github/create_pull_request.py
Comment thread tests/test_pr_content.py Outdated
@dclong dclong force-pushed the push-nqrvnzxzrpkz branch 3 times, most recently from e4c9fb8 to eddfee5 Compare June 25, 2026 07:07
@dclong

dclong commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 automated pull request title and description generation, supporting both a deterministic fallback (using commit messages and changed files) and an optional AI-powered layer via LiteLLM. It updates the Repository class with comparison and PR content generation capabilities, exposes these features in the create_pull_request CLI script, and adds comprehensive tests. The review feedback focuses on improving robustness when parsing GitHub API responses, specifically recommending safe handling of potentially None values for keys like commit, status, and sha to prevent runtime errors.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread github_rest_api/pr_content.py Outdated
Comment thread github_rest_api/pr_content.py Outdated
Comment thread github_rest_api/pr_content.py Outdated
Comment thread github_rest_api/pr_content.py Outdated
@dclong

dclong commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 automated generation of pull request titles and descriptions, supporting both a deterministic fallback based on commit messages and changed files, and an optional AI-powered generation layer using LiteLLM. The CLI is updated to accept custom titles, bodies, and model parameters, and comprehensive tests are added. The feedback suggests improving the robustness of the LLM response parsing by stripping markdown code block wrappers before decoding the JSON, which prevents unnecessary fallbacks to deterministic content.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread github_rest_api/pr_content.py
@dclong dclong force-pushed the push-nqrvnzxzrpkz branch from eddfee5 to 84853ae Compare June 25, 2026 07:41
@dclong

dclong commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@dclong

dclong commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 automated pull request title and description generation, supporting both a deterministic fallback (using commit messages and changed files) and an optional AI-powered generator via LiteLLM. It also updates the CLI script with new arguments and adds comprehensive unit tests. The review feedback focuses on improving robustness, recommending the use of Python's standard logging module instead of printing to sys.stderr, handling markdown-wrapped JSON and null values in LLM responses, and defensively handling potential null values for commits and files in the GitHub API response to prevent TypeErrors.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread github_rest_api/github.py Outdated
Comment thread github_rest_api/pr_content.py Outdated
Comment thread github_rest_api/pr_content.py Outdated
Comment thread github_rest_api/pr_content.py Outdated
Comment thread github_rest_api/pr_content.py Outdated
Comment thread github_rest_api/pr_content.py Outdated
@dclong dclong force-pushed the push-nqrvnzxzrpkz branch from 84853ae to f078937 Compare June 25, 2026 15:46
@dclong

dclong commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 automated generation of pull request titles and descriptions, supporting both a deterministic fallback (based on commit messages and changed files) and an optional AI-powered generator using LiteLLM. The CLI script create_pull_request has been updated with new options (--title, --body, --model) to expose these features. The review feedback suggests optimizing performance by compiling regular expression patterns at the module level rather than inside functions on every call.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread github_rest_api/pr_content.py Outdated
Comment thread github_rest_api/pr_content.py Outdated
@dclong dclong force-pushed the push-nqrvnzxzrpkz branch from f078937 to 8a74f96 Compare June 25, 2026 16:15
@dclong

dclong commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 automatic generation of pull request titles and descriptions, supporting both a deterministic fallback (using commit messages and changed files) and an optional AI-powered generator via LiteLLM. It adds a new pr_content module, updates the Repository class with comparison and PR content generation capabilities, exposes new --title, --body, and --model CLI arguments, and includes comprehensive tests. The review feedback suggests changing the default values of --title and --body from empty strings to None in the CLI parser to allow users to explicitly pass empty strings to suppress automatic description generation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +40 to +53
parser.add_argument(
"--title",
dest="title",
default="",
help="The title of the pull request. Takes precedence over a generated "
"title and the default 'Merge <head> Into <base>' title.",
)
parser.add_argument(
"--body",
dest="body",
default="",
help="The body (description) of the pull request. Takes precedence over "
"a generated description.",
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

By defaulting --title and --body to "" and checking if args.title: / if args.body:, it is impossible for a user to explicitly pass an empty string (e.g., --body "") to suppress description generation.

Changing the defaults to None and checking is not None allows users to explicitly provide empty titles or bodies when desired.

Suggested change
parser.add_argument(
"--title",
dest="title",
default="",
help="The title of the pull request. Takes precedence over a generated "
"title and the default 'Merge <head> Into <base>' title.",
)
parser.add_argument(
"--body",
dest="body",
default="",
help="The body (description) of the pull request. Takes precedence over "
"a generated description.",
)
parser.add_argument(
"--title",
dest="title",
default=None,
help="The title of the pull request. Takes precedence over a generated "
"title and the default 'Merge <head> Into <base>' title.",
)
parser.add_argument(
"--body",
dest="body",
default=None,
help="The body (description) of the pull request. Takes precedence over "
"a generated description.",
)

Comment on lines +107 to +110
if args.title:
pull_request["title"] = args.title
if args.body:
pull_request["body"] = args.body

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Update the checks to use is not None to match the new None defaults for --title and --body.

Suggested change
if args.title:
pull_request["title"] = args.title
if args.body:
pull_request["body"] = args.body
if args.title is not None:
pull_request["title"] = args.title
if args.body is not None:
pull_request["body"] = args.body

Comment on lines +11 to +12
assert args.title == ""
assert args.body == ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Update the assertions to expect None as the default value for title and body instead of "".

Suggested change
assert args.title == ""
assert args.body == ""
assert args.title is None
assert args.body is None

@dclong dclong merged commit f16acf3 into main Jun 25, 2026
8 checks passed
@dclong dclong deleted the push-nqrvnzxzrpkz branch June 27, 2026 11:40
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