Repository navigation
Never bump the version on a PR edit - #1058
Merged
Merged
Conversation
UpdateVersion also runs on edited events, and AI reviewers (cubic, Sourcery) edit PR descriptions on the author's behalf, so the [bot] actor guard does not catch them. On #1057 such an edit bumped the manual 4.0.0 to 4.0.1 minutes after the PR was opened; the same path explains the prerelease-only 3.0.0. An edit now only refreshes this PR's own latest entry and otherwise exits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe version updater now treats PR edits as metadata-only operations for the PR that owns the latest version entry, and skips them otherwise, preventing AI or author-driven description edits from incrementing the project version. Flow diagram for PR event version update behaviorflowchart TD
A[PR event] --> B{eventAction is edited?}
B -- No --> C[Existing opened or synchronize logic]
B -- Yes --> D{CurrentPR owns latest version entry?}
D -- No --> E[Exit without npm version patch]
D -- Yes --> F[Refresh title notes and time]
C --> G[Normal version update behavior]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Deploying xmoj-script-dev-channel with
|
| Latest commit: |
a40fcf0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7f71563a.xmoj-script-dev-channel.pages.dev |
| Branch Preview URL: | https://updateversion-edited-no-bump.xmoj-script-dev-channel.pages.dev |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Signed-off-by: Zhu Chenrui <boomzero_zcr@outlook.com>
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.
What does this PR aim to accomplish?:
Stop PR edits from bumping the version. UpdateVersion also runs on
editedevents, and AI reviewers (cubic, Sourcery) rewrite PR descriptions under the author's account, so the!endsWith(github.actor, '[bot]')guard doesn't stop them. On #1057 one of these edits turned the manual 4.0.0 into 4.0.1 minutes after the PR was opened. The same path likely explains why3.0.0exists only as a prerelease (recorded under #906, like 2.7.4), so the first stable 3.x release was 3.1.0.How does this PR accomplish the above?:
Update/UpdateVersion.js: on aneditedevent, the script now continues only if this PR already owns the latest version entry. In that case it refreshes the title, notes and time as before. Otherwise it exits without runningnpm version patch. Opened and synchronize runs are unchanged. This also stops an edit from bumping again afterdevhas been merged into a PR whose entry is no longer the latest.Dry runs against current
dev, withghstubbed and a local remote:edited, PR doesn't own the latest entry (the Release as 4.0.0: the rating redesign is a breaking change #1057 case): skipped, still 4.0.0.edited, PR owns the latest entry: only "Update time and description of 4.0.0".synchronize, new PR: normal bump to 4.0.1 (prerelease).This PR doesn't touch
XMOJ.user.js, so it causes no version bump.By submitting this pull request, I confirm the following:
git rebase)🤖 Generated with Claude Code
https://claude.ai/code/session_01E5dr7XTsCeoamqLSiT9rLp
Summary by Sourcery
Prevent edited pull requests from creating unintended version bumps while preserving normal version updates for newly opened or synchronized pull requests.
Bug Fixes:
Enhancements:
Summary by cubic
Stops
Update/UpdateVersion.jsfrom bumping the version when a PR is edited. AI reviewers (cubic, Sourcery) rewrite PR descriptions under the author's account, so the[bot]actor guard didn't stop them — on #1057 an edit turned the manual 4.0.0 into 4.0.1 minutes after the PR was opened.On
editedevents the script now only refreshes this PR's own latest version entry and exits without runningnpm version patchotherwise; it also skips the metadata refresh whenpackage.jsonandXMOJ.user.jsare out of sync.openedandsynchronizeruns are unchanged. This also stops an edit from bumping afterdevhas been merged into a PR whose entry is no longer the latest.Written for commit 6b1612c. Summary will update on new commits.