Refactor Grant Revoke Routing and Tests · Entire

Reviewer Concerns

Some issues on this branch still, from reviewers:

  1. revokeProjectGrantee/revokeRepoGrantee are near-identical (~18 lines each) — confirm dupl (threshold 75) stays green; if it trips, a //nolint:dupl with rationale per CLAUDE.md is the expected fix.
  2. No test for granteeName or the new list columns. The granteeName(name, id) fallback (friendly name vs ULID) and the expanded grantColumns/projectGrantRow/repoGrantRow are entirely untested. It's trivial branching, but it's user-facing output and exactly the kind of thing a 3-line table test pins cheaply — especially the empty-OptString→ULID fallback. Worth adding before merge.

Both reviewer concerns addressed.

Dupl (concern 1)

Confirmed green. mise run lint (threshold 75, CI-enforcing) reports nothing for grant.go — revokeProjectGrantee/revokeRepoGrantee don't trip at 75. No //nolint:dupl needed. The advisory mise run dup at threshold 50 flags the list commands, not the revoke pair, and is advisory-only.

Tests (concern 2)

Added to grant_test.go:

All pass; lint clean. Nothing committed — yours to push.


Can we dedupe the list or revoke commands at all?

Done. Both functions now delegate to a shared revokeGrantee helper; the ULID-vs-handle routing and message formatting live in one place. Message output is byte-identical to before (account X from project Y / X from project Y).

Nothing committed — yours to push.


Does 'list' need deduping?

No — and I'd actively avoid it.

The revoke dedup was worth it because the route-decision logic (ULID vs handle + message formatting) was genuinely shared. List has no equivalent shared decision — just parallel boilerplate. Leave it.


Okay, cool. Commit and push.

Pushed. 4bf8bdf11 on paul/cor-699-cant-repo-grant-with-entire-cli.

Commit Message

refactor(grant): share revoke routing; test granteeName + grant rows
Extract the ULID-vs-handle revoke routing and message formatting shared by revokeProjectGrantee/revokeRepoGrantee into revokeGrantee. Add tests for granteeName's name/ULID fallback and the project/repo grant row builders.


Related Commits