chore(auth): remove the fully-deleted old GitHub App's dead vars/secrets#5269
Conversation
GITHUB_APP_ID/GITHUB_APP_SLUG removed from wrangler.jsonc; the matching GITHUB_APP_PRIVATE_KEY/GITHUB_WEBHOOK_SECRET Worker secrets already deleted directly (they're now orphaned -- the App itself is gone, not just suspended). Widened the 4 corresponding env.d.ts types to optional so a self-hoster running their own App under these names still works. Fixed two latent crash sites this surfaced: isOwnGitHubAppCheckRun and isOwnReviewThreadAuthor (src/github/backfill.ts) called GITHUB_APP_SLUG.trim() unguarded -- would throw for any deployment (including a self-hoster) that leaves it unset. Both now degrade to "no match" instead. The public /v1/public/subnet-interface descriptor's install-app slug was reading this same var -- silently becoming "/apps/undefined" once removed. Replaced with a stable, hardcoded "gittensory-orb" (confirmed: that's the real, currently publicly-installable app), decoupled from whatever credentials this Worker happens to hold for its own operational purposes.
|
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 #5269 +/- ##
=======================================
Coverage 94.37% 94.37%
=======================================
Files 474 474
Lines 40114 40118 +4
Branches 14627 14629 +2
=======================================
+ Hits 37856 37860 +4
Misses 1583 1583
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-12 12:57:23 UTC
🛑 Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Why this is blocked
CI checks failing
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory 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/gittensory-commands 🟩 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.
|
Closes the codecov/patch branch-coverage gap on the ?? "" fallback in isOwnGitHubAppCheckRun and isOwnReviewThreadAuthor, now that the field is optional.
Summary
gittensoryGitHub App (id 3824093) has been fully deleted (not just suspended). Removed its now-dead references:GITHUB_APP_ID/GITHUB_APP_SLUGremoved fromwrangler.jsonc's vars.GITHUB_APP_PRIVATE_KEY/GITHUB_WEBHOOK_SECRETWorker secrets already deleted directly (operational, not a repo diff).env.d.tstypes to optional, so a self-hoster running their own App under these same var names still works without code changes.isOwnGitHubAppCheckRunandisOwnReviewThreadAuthor(src/github/backfill.ts) calledenv.GITHUB_APP_SLUG.trim()unguarded — would throw for any deployment (including a self-hoster) that leaves it unset. Both now degrade to "no match" gracefully, mirroring the existing defensive pattern used elsewhere in the codebase (self-authored.ts'snormalizeGitHubSlug).GET /v1/public/subnet-interfacedescriptor's install-app slug readGITHUB_APP_SLUG— which would have silently become/apps/undefinedin the response once the var was removed. Replaced with a stable, hardcoded"gittensory-orb"(confirmed: that's the real, currently publicly-installable app), decoupled entirely from whatever credentials this Worker happens to hold for its own operational purposes — so a future credential change can't break this public descriptor again.createAppJwt(src/github/app.ts) now validates bothGITHUB_APP_PRIVATE_KEYandGITHUB_APP_IDupfront (was only checking the key before), with the retry/eviction logic downstream narrowed to a guaranteed-defined local instead of re-reading the now-optionalenv.GITHUB_APP_ID.Validation
npm run typechecktest/unit/webhook.test.ts,test/integration/api.test.ts(test-localsignWebhookhelpers now guard against an unset secret with a clear error instead of a type error),test/unit/subnet-interface.test.ts+test/integration/subnet-interface.test.ts(updated to the new hardcoded slug).npm run test:ci(full local gate, unsharded) — green.GITHUB_APP_ID/GITHUB_APP_SLUGfromwrangler.jsoncintroduces no new compile error beyond the two intentionally-fixed sites.Safety
GITHUB_APP_ID/GITHUB_APP_SLUG/etc. is unaffected — these vars are now optional, not removed from the type surface./v1/public/subnet-interfaceslug change is a deliberate, confirmed decision (not an inferred one) — verified with the maintainer thatgittensory-orbis the real, publicly installable app.