fix(github): create contributor issues via installation tokens instead of a flat PAT - #7467
Conversation
…d of a flat PAT Every other GitHub write (labels, comments, check-runs) goes through the installation-token/Orb-broker path so it works on any repo the App/Orb is installed on. Issue creation was the one write left needing a separately configured PAT with its own write access to whichever repo was targeted. Adds src/github/issues.ts (createInstallationIssue) and migrates contributor-issue-draft.ts onto it, clearing the way for a repo-agnostic selfhoster-facing issue-planning tool to reuse the same auth path. Closes #7425
|
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 #7467 +/- ##
==========================================
- Coverage 91.35% 91.33% -0.02%
==========================================
Files 716 717 +1
Lines 72990 73002 +12
Branches 21628 21628
==========================================
+ Hits 66678 66679 +1
- Misses 5272 5279 +7
- Partials 1040 1044 +4
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-20 11:11:43 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://loopover.ai/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
src/github/app.ts,src/orb/broker-client.ts), which works on any repo the caller's GitHub App or Orb-brokered install is actually installed on. Issue creation was the one write left on a separate, flat operator PAT (LOOPOVER_CONTRIBUTOR_ISSUE_TOKEN/GITHUB_PUBLIC_TOKEN) that had to independently hold write access to whichever repo was targeted.src/github/issues.ts(createInstallationIssue), mirroringsrc/github/labels.ts's existing pattern, and migratescontributor-issue-draft.ts'screateGitHubContributorIssueonto it.createInstallationTokenalready picks the local App key or the Orb broker transparently depending on deployment config, so this one call site now works either way with no changes needed at the call site.LOOPOVER_CONTRIBUTOR_ISSUE_TOKENenv var (src/env.d.ts,.env.example, and a vestigial reference in a route test that never actually exercised it).src/upstream/ruleset.ts'sfileUpstreamDriftIssues(create+update+find+validate, hardcoded to loopover's own tracker repo only) stays on its existing PAT path — a separably-sized migration not required to unblock the rest of the epic, and a narrower risk surface since it never targets an arbitrary selfhosted repo.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 #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlint(ran as part ofnpm run selfhost:env-reference:check/typecheck pass below; no workflow files touched)npm run typechecknpm run test:coveragelocally — full unsharded suite: 1009 files / 19188 tests passed. 9 failures across 3 unrelated miner test files (local-branch.test.ts,miner-init-verify-token.test.ts,miner-self-review-context.test.ts) reproduce identically on a cleanmaincheckout with this branch's changes stashed out — confirmed pre-existing and unrelated (flagged separately, not fixed here to keep this PR focused). New/changed code (src/github/issues.ts, the migratedcreateGitHubContributorIssue) is 100% branch-covered.npm 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=moderate(pre-existingadm-zip/github-actionlintadvisory, no fix available, unrelated to this change)If any required check was skipped, explain why:
ui:lint/ui:typecheck/ui:buildnot run: this PR touches no files underapps/loopover-ui/**— a backend-only auth-path migration insrc/.Safety
test/unit/github-issues.test.tsand the updatedtest/unit/contributor-issue-draft.test.ts).UI Evidencesection below. (N/A — backend-only change.).env.example.)UI Evidence
N/A — this is a backend-only change with no visible UI, frontend, or docs surface.
Notes
Closes #7425