test(github): cover the assignee-403 fallback and its unrelated-error guard (#4999) - #5038
Conversation
… guard (#4999) ensurePullRequestAssignee already catches GitHub's "Assigning agents is not supported with GitHub App installation tokens" 403 and degrades to applied:false (shipped in #4167, deployed) -- 198 Sentry events, all predating that fix, zero since. What was missing was a regression test for the catch itself: the branch sat at 0% coverage, so a future refactor could silently break the fallback (or start swallowing unrelated errors) with nothing to catch it.
|
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 #5038 +/- ##
==========================================
+ Coverage 94.32% 94.33% +0.01%
==========================================
Files 460 460
Lines 39303 39303
Branches 14338 14338
==========================================
+ Hits 37073 37077 +4
+ Misses 1575 1571 -4
Partials 655 655
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-11 09:55:30 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
ensurePullRequestAssigneewas reported failing 100% of the time against GitHub App installation tokens (198 Sentry events, GITTENSORY-1G).ensurePullRequestAssignee(src/github/assignees.ts:51-75) already detects GitHub's specific "Assigning agents is not supported with GitHub App installation tokens" 403 and returns{ applied: false }instead of throwing, lettingperformActionfall through to its existing per-login label fallback.2026-07-08T18:59:01Zon releasegittensory-orb@0.4.0-beta.5— every event predates or is from a build that predates the fix reaching a deployed release. The self-host box's current release (gittensory-selfhost@a43c918e, confirmed via a separate, more recent Sentry issue) is built from a commit descending from fix(github): gracefully handle GitHub App agent assignment 403 #4167. Zero occurrences of this error since. This satisfies deliverable chore(release): prepare public gittensory launch #2 ("confirm via Sentry after deploy that this specific error stops recurring").test/unit/github-assignees.test.tshad zero coverage onassignees.ts:63-74(confirmed via lcov:BRF:24 BRH:14before this PR → the whole catch/throw branch was dead in tests). That's deliverable feat(docs): add install site and mcp diagnostics #1 ("regression test reproducing this exact error and asserting the fallback fires") and issue requirement feat(scoring): add situational score projections #3 ("don't swallow other errors — a genuine transient failure should still surface"), both still open. This PR adds exactly those two tests. No production code change —src/github/assignees.tsis untouched.test/unit/agent-action-executor.test.ts:854("falls back to a per-login label when GitHub silently drops an ineligible assignee") already exercisesperformAction'sapplied:false→ label-fallback path end-to-end.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #4999).Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocallynpm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
test:coverage(full unsharded): not run end-to-end — ran scopedvitest --coveragefortest/unit/github-assignees.test.tsand confirmed via lcov thatsrc/github/assignees.tsis now at 100% line and branch coverage (LF:20 LH:20,BRF:24 BRH:24).actionlint/test:workers/build:mcp/test:mcp-pack/ui:openapi:check/ui:lint/ui:typecheck/ui:build/npm audit: not run — this PR adds tests only, undertest/**(Codecov-exempt), with nosrc/**change and no workflow, MCP, UI, or dependency-manifest surface touched.Safety
UI Evidencesection. (N/A.)Notes
Part of a batch of 13 bug fixes filed from a Sentry-issue triage this session (#4994–#5006). This is #6 by priority — the underlying bug was already fixed by #4167 before this triage; this PR closes the remaining test-coverage gap.