Repository navigation
fix(rules): skip deletes by default and protect system roles/policies - #106
Merged
Merged
Conversation
Partial hand-authored rulesets used to mark Administrator/Public as removed and delete them when push ran with an admin token. skipDeletes now defaults to true; pass --delete (or skipDeletes: false) to allow remote-only removals. Administrator, Public, admin_access policies, and known system names are never deleted regardless of the flag.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
- rules:push errors when --skip-deletes and --delete are both passed instead of silently letting --delete win - protected role/policy skips now use a dedicated reason field so they are not conflated with error skips, and formatPushResult lists them under a Skipped section so --delete users can see why nothing was removed
This branch was successfully deployed
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.
Problem
pushRulesdeleted remote-only roles/policies when they were absent from a hand-authored partial ruleset. With an admin token that can drop Administrator, Public, andadmin_accesspolicies — a production footgun.skipDeletesalso defaulted tofalse, so opt-out was the only safe mode.Fix
skipDeletesdefaults totrue(additive push by default).--deleteto allow remote-only removals;--skip-deletesremains a no-op alias of the new default.Administrator,Public,$t:public_labeladmin_access: true, plus known system names (Administrator,Public,$t:admin_policy, …)Protected removals are recorded as
skippedrather than attempted deletes.Tests
Unit coverage for
isProtectedRole/isProtectedPolicy.Breaking change
Callers that relied on destructive sync without opting in must now pass
skipDeletes: false(or CLI--delete).