fix(applier): drop the GNU-only grep -P, and name the credential the cure needs - #1029
Merged
Merged
Conversation
Two hardening follow-ups on the org-inherited fix: 1. `grep -P` is a GNU extension. The classification of active branch rulesets into repo-level vs org-inherited is the load-bearing step of this script; it must not depend on which grep the runner ships. awk with an explicit `-F'\t'` does the same field test and is portable. Mutant F is retargeted at the awk line so the control still dies. 2. The ORG-INHERITED detail named the endpoint but not the credential. An org-level ruleset write needs `admin:org`; a repo-scoped token reads the ruleset in full and cannot write it, which is precisely the asymmetry that produced the original 404. Saying so in the report line saves the operator a second 403 chase. Suite: 46/46, mutant F still killed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ji1bq3TypfycfUPAR7hSxR
Contributor
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
|
Contributor
|
❌ Failed to create Coding Agent finishing-touch task. Please try again. |
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.



Two hardening follow-ups on #1027, which landed the org-inherited fix.
1.
grep -Pis a GNU extension. Classifying active branch rulesets intorepo-level vs org-inherited is the load-bearing step of this script — it is
what stops the PUT that 404'd 67 times. It must not depend on which
grepthe runner ships.
awk -F'\t'does the same field test portably.Mutant F is retargeted at the awk line, so the control still dies: without
the ownership filter the applier becomes
DRIFTand PUTs torepos/acme/org-inherited/rulesets/18225024— the measured 404, reproduced.2. The
ORG-INHERITEDdetail named the endpoint but not the credential.An org-level ruleset write needs
admin:org. A repo-scoped token reads theinherited ruleset in full and cannot write it — that asymmetry is the whole
bug. Saying so in the report line saves the operator a second 403 chase.
Suite: 46/46, mutant F killed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ji1bq3TypfycfUPAR7hSxR