feat(orb): create APR repos under the submitting customer's own account - #8046
Conversation
Adds createAprRepoForCustomerSession, which creates a new GitHub repository via POST /user/repos using a specific customer session's own live OAuth token (getLiveSessionGitHubToken) -- never a fixed or operator session. GitHub always creates the repo under the authenticated user's own account, so the result is <customer-login>/<repoName>, never a fixed owner. startGitHubWebOAuth now accepts an explicit scope parameter, defaulted to the existing "read:user" so every current caller is unaffected; only the APR idea-submission flow will pass "read:user repo". Closes JSONbored#7637
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-22 15:17:03 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed 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.
|
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (93.33%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8046 +/- ##
=======================================
Coverage ? 95.74%
=======================================
Files ? 2
Lines ? 141
Branches ? 55
=======================================
Hits ? 135
Misses ? 2
Partials ? 4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Closes #7637
Summary
createAprRepoForCustomerSession(src/orb/apr-repo-creation.ts), which creates a new GitHub repository viaPOST /user/reposusing a specific customer session's own live OAuth token (getLiveSessionGitHubToken) — never a fixed/operator session, never an installation-token driver.POST /user/reposalways creates the repo under the authenticated user's own account, so the result is<customer-login>/<repoName>, never a fixed owner.startGitHubWebOAuthnow accepts an explicitscopeparameter, defaulted to the existing"read:user"so every current caller (the standard login flow) is completely unaffected — only the APR idea-submission flow will pass"read:user repo".{ created: false }result (never throws) on a missing/expired session token or a GitHub API error (e.g. a repo-name collision), so callers get a total function they can branch on.Scope checklist
src/auth/github-oauth.tsexactly as requiredread:user) is unchanged — verified by an explicit testValidation checklist
npm run typecheck(repo-wide) passes clean (3 pre-existing, unrelated errors confirmed viagit stashon a clean checkout)private:false+ description), a missing/expired session token failing closed without calling GitHub, a GitHub API error (e.g. repo-name collision) handled without throwing, and a malformed 2xx payload failing closedread:user, and a new test for the explicit"read:user repo"variantSafety checklist
site/,CNAME, or**/lovable/**