feat: reject conflicting permission entries at load/save time; document GLOB semantics#218
Merged
Merged
Conversation
9ab7bcd to
3b52e88
Compare
…nt GLOB semantics Add conflict detection to RepoPermissionService.findConflict(): two permissions conflict when they share the same username+provider, their paths overlap, AND their operations affect the same permission check. SELF_CERTIFY is evaluated by isBypassReviewAllowed() independently, so PUSH_AND_REVIEW + SELF_CERTIFY on the same path coexist without conflict — both entries are required for a trusted committer configuration. Path overlap uses a practical heuristic: exact path string equality, or one path's GLOB/REGEX pattern matches the other path string as a literal. Covers LITERAL-vs-GLOB, LITERAL-vs-REGEX, and GLOB-vs-GLOB subset cases. - seedFromConfig: throws IllegalStateException on first conflict, failing startup loudly rather than allowing silent wrong behaviour - PermissionController.add: returns 400 with the conflicting path before saving - CONFIG-vs-DB conflicts are checked (not just within each source) Also adds comprehensive GLOB behaviour tests documenting * vs ** semantics, hyphenated names, path separator crossing, wildcard owner/repo patterns, and ? single-character matching. Updates CONFIGURATION.md with a GLOB semantics table, a conflict detection note, real-world permission examples, and real-world URL rule examples (including a note clarifying that owners/names use OR logic and slugs are needed for AND conditions). closes #215 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3b52e88 to
3119340
Compare
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.
Summary
RepoPermissionService.findConflict(): detects overlapping paths for the same username+provider — exact string equality, or one path's GLOB/REGEX pattern matches the other path string as a literal (covers LITERAL-vs-GLOB, LITERAL-vs-REGEX, GLOB-vs-GLOB subset cases)seedFromConfig: throwsIllegalStateExceptionon first conflict, failing startup loudly rather than silently evaluating in undefined orderPermissionController.add: returns400with the conflicting path before saving, blocking new conflicts via the dashboard API*vs**, hyphenated names, path separator crossing, wildcard owner/repo patterns,?single-char matchingCONFIGURATION.md: new GLOB semantics table + conflict detection note in the permissions sectionTest plan
seedFromConfigthrows on both CONFIG-vs-CONFIG and CONFIG-vs-DB conflictssavejacocoTestCoverageVerificationpassescloses #215