Repository navigation
ci: reject issue-state keywords in PR text - #2341
Conversation
b3bfb3c to
44d5078
Compare
|
Warning Review limit reached
More reviews will be available in 53 minutes and 24 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA new GitHub Actions workflow ( ChangesPR State Guard enforcement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3bfb3cf3d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/pr-state-guard.yml:
- Around line 13-15: Add explanatory comments above the permissions block in the
pr-state-guard.yml workflow file to document why the specific permissions are
needed. The contents and pull-requests read permissions should each have a brief
comment explaining their purpose. For example, document that contents read is
needed to access repository metadata and pull-requests read is needed to
interact with pull request data, helping future maintainers understand the
security rationale for these permission assignments.
- Around line 28-58: The Python script lacks error handling for missing
environment variables and file operations. Wrap the code that reads and parses
the GitHub event file (starting with the retrieval of GITHUB_EVENT_PATH
environment variable through the json.load call) in a try-except block to
gracefully catch KeyError for missing environment variables, FileNotFoundError
for missing event files, and JSONDecodeError for malformed JSON. For each error
type, print a descriptive error message to help with debugging, then call
sys.exit(1) to fail the check appropriately instead of letting Python tracebacks
propagate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: aa207720-1c9b-466e-9bd4-aef37f8054ec
📒 Files selected for processing (2)
.github/pull_request_template.md.github/workflows/pr-state-guard.yml
44d5078 to
98a850b
Compare
98a850b to
e4a5c55
Compare
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Adds a fast PR policy check that rejects PR title/body text containing GitHub issue-state keywords next to issue references, and updates the PR template to steer authors toward neutral references.
Problem
GitHub can change issue state from PR text when a linked PR is merged. That is too easy for agents to trigger accidentally, especially when a broad issue still has residual deployed/runtime work.
Solution
The new
PR State Guardworkflow runs on PR metadata changes and scans the PR title/body directly from the event payload. It accepts neutralRef #NNNwording and rejects state-changing keyword forms before merge. The PR template now reminds authors to keep issue references neutral unless the operator explicitly asks for that exact state change.Verification
devtools verify ci-workflows-> 17 workflow files checked, no errors.Ref #2308passed; state-changing same-repo and cross-repo keyword forms failed.devtools verify --quick-> pass (20260623T165120Z-quick-84113-aec841b3).Changelog
Skipped; CI/project-process only.
Risks and Follow-ups
The GitHub repository setting for auto-changing issue state on linked PR merge should still be disabled manually under repository settings when available. This PR adds an enforceable repository guard so the workflow does not depend only on agent memory or the GitHub UI setting.
Summary by CodeRabbit
Release Notes
Documentation
Chores