Repository navigation
feat(release): the version bump goes through a pull request - #48
Merged
Merged
Conversation
main is about to take pull requests only, the owner included, after a cloud session pushed straight to it with the owner's account. bump_version.py committed the bump on main and release.py began with git push origin main, which that rule refuses. bump_version.py now commits the bump on release/<version>, pushes that branch and opens its pull request with auto-merge (when gh is there and origin is this repository on GitHub). release.py pushes nothing: after the confirmation it checks that the local main is clean and is the remote's, neither ahead nor behind, and creates the GitHub release on that exact commit with --target. Tested against a real bare remote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| url = subprocess.run( | ||
| ["git", "remote", "get-url", "origin"], capture_output=True, text=True, check=True, cwd=cwd | ||
| ).stdout | ||
| return "github.com" in url and RELEASE_REPO in url |
Merging this PR will not alter performance
|
…ract asks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Preparation for removing the owner's bypass from the main ruleset:
bump_version.pycommitted the bump on main andrelease.pybegan withgit push origin main, which a ruleset without bypass refuses.bump_version.py: after the suite, commits the bump onrelease/<version>; when asked, pushes that branch only, switches back to main and opens the pull request with auto-merge (squash) ifghis there andoriginis github.com/maksimtech/patchradar.release.py: pushes nothing. After the confirmation,check_main_published()refuses another branch, a dirty tree, a main ahead of the remote ("the bump has to arrive through its pull request") or behind it ("git pull"), and returns the commit;gh release create <version> --target <that commit>. An aborted run still touches nothing.RELEASING.mdandCLAUDE.mddescribe the new path.tests/test_release_through_pr.pyruns the real functions against a real bare remote and a clone; nothing of git is simulated and GitHub is not asked. Full suite green locally.🤖 Generated with Claude Code