Repository navigation
fix(github): create missing changelog file when pushing updates - #3639
IsmaelMartinez merged 3 commits into
Conversation
PR Summary by QodoCreate missing GitHub files during changelog updates
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Thank you for this one, and for flagging #3524 so the overlap was easy to place. The missing-file fix holds: both new tests go red against main's provider, and the non-404 path now raises instead of writing.
One ask before approval, on Qodo's fork finding. Main already reads and updates CHANGELOG.md on the base repository's branch named after the fork's head ref; this change adds creating it there, so a fork pull request opened from its own main can now create the file on the base repository's main. Could the create path run only for same-repository pull requests, with a test for the fork case? Further security findings are best reported privately at https://github.com/The-PR-Agent/pr-agent/security/advisories/new.
|
Done — the create path is now gated to same-repository pull requests ( One related observation while in here (pre-existing, out of scope for this fix): when the file already exists on the base repository's same-named branch, the update path can still write there for fork PRs — that behavior predates this PR. Happy to open a follow-up issue if you want it tracked. |
|
Code review by qodo was updated up to the latest commit b9a2b37 |
# Conflicts: # pr_agent/git_providers/github_provider.py
|
Code review by qodo was updated up to the latest commit 758285c |
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Thanks for gating the create path to same-repository pull requests and testing both the fork and deleted-fork cases. #3524 changed the same except today, so I merged main in and kept your version of create_or_update_pr_file. Qodo's docstring phrasing note is style only. For the update-path observation, please use the private form rather than a public issue: https://github.com/The-PR-Agent/pr-agent/security/advisories/new. Approving, and merging once CI has run.
Summary
Why
The /update_changelog command accepts a missing CHANGELOG.md and can generate its initial content. With pushing enabled, the GitHub provider previously called update_file with an empty SHA after a 404, so that initial content could not be committed.
Validation
Related: #3524 narrows provider exception handling but does not implement missing-file creation.