test(github): verify installation-token isolation under multi-tenant concurrency - #6277
Conversation
…enant concurrency (#4794) Adds adversarial tests proving the credential-scoping mechanism Rent-a-Loop's #4794 asked to verify already holds: two tenants racing on a cold cache each single-flight to exactly one mint of their own installation, with zero cross-contamination, in both the in-isolate Map and the external (Redis self-host fleet) token store. Confirmed no code changes were needed -- the cache/mint layer and every queue-processor call site already threads installationId per-job, never through shared/ambient state. Also fixes a stale addBlockedBy mutation field name in the contributor gardening skill's reference doc (blockedById -> blockingIssueId), caught while wiring #5669's relationship graph.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6277 +/- ##
=======================================
Coverage 95.35% 95.35%
=======================================
Files 598 598
Lines 47127 47127
Branches 14994 14994
=======================================
Hits 44940 44940
Misses 1463 1463
Partials 724 724
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-16 00:27:55 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionPartially addressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Rent-a-Loop's #4794 ("Scoped credential handling") asked for verified, documented behavior that one tenant's credentials can never be used against another tenant's repo. Read the existing installation-token cache/mint layer (
src/github/app.ts) end to end before writing anything:installationTokenCache(in-isolate Map) and the externalInstallationTokenStoreinterface (Redis, self-host fleet) are both keyed correctly byinstallationIdthroughout.inFlightMints(the single-flight coalescing map for cold-cache concurrent mints) is also keyed byinstallationId— no shared key collision risk.src/queue/processors.ts) threadsinstallationIdas a local variable or job-payload field, never through module-level/shared mutable state (grepped every non-cachelet/varat module scope acrosssrc/github/*.ts,src/queue/*.ts,src/review/*.ts— the only two found were an unrelated store-reference pointer and a process-wide REES-auth flag, neither tenant-scoped).No code changes were needed — the mechanism was already sound. Added the adversarial tests that actually prove it, since none of the existing token tests exercised more than one installation concurrently:
Also fixes a stale
addBlockedBymutation field name in the contributor-gardening skill's reference doc (blockedById→blockingIssueId), caught while wiring #5669's relationship graph in an earlier session pass — never committed until now.Closes #4794 — this PR is exactly its "Verified, documented behavior (with tests)" deliverable.
Test plan
npx tsc --noEmitcleannpm run test:coverage(unsharded): 894 files / 17152 tests passed, 0 failuresnpm audit --audit-level=moderate: 0 vulnerabilitiesnpm run test:ci(full local gate incl. drift checks, engine parity, MCP/miner packs, UI build): green, verified via literal captured exit code, not a piped oneorigin/main(picked up the concurrent fumadocs-mdx docs migration cleanly,npm ci+fumadocs-mdx source.config.tscodegen re-run), no conflicts