Skip to content

Match role and group names exactly - #7

Merged
winebarrel merged 1 commit into
mainfrom
exact-name-match
Aug 31, 2026
Merged

winebarrel merged 1 commit into
mainfrom
exact-name-match

Conversation

@winebarrel

@winebarrel winebarrel commented Aug 31, 2026 •

Copy link
Copy Markdown
Owner

Activating a role whose display name is contained in another eligible role's display name was impossible: names were matched with a case-insensitive substring test, so even writing the shorter name out in full matched both roles and failed as ambiguous.

Names are now matched in full, case-insensitively (strings.EqualFold). The ambiguity error stays for the case that is genuinely ambiguous: a group held as both member and owner has the same name twice, which --access resolves.

Short queries such as azpim role activate "reader" no longer match a longer name; the full display name is required.

@codecov

codecov Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.57%. Comparing base (cc11483) to head (e1239fe).

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #7   +/-   ##
=======================================
  Coverage   96.57%   96.57%           
=======================================
  Files           7        7           
  Lines         496      496           
=======================================
  Hits          479      479           
  Misses         17       17           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Role names contain each other, so a substring match made the shorter name
of such a pair ambiguous however completely it was written out, leaving no
way to activate that role at all. Names are now matched in full,
case-insensitively.

A name can still match more than one assignment, since a group held as
both member and owner has the same name twice, so the ambiguity error
stays.
@winebarrel
winebarrel enabled auto-merge August 31, 2026 02:36
@winebarrel
winebarrel merged commit e8c1d6c into main Aug 31, 2026
4 checks passed
@winebarrel
winebarrel deleted the exact-name-match branch August 31, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant