fix(review): record getAppInstallation calls in the shared rate-limit store (#4506)#4580
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4580 +/- ##
==========================================
- Coverage 94.12% 94.12% -0.01%
==========================================
Files 430 430
Lines 38155 38163 +8
Branches 13912 13915 +3
==========================================
+ Hits 35913 35920 +7
Misses 1585 1585
- Partials 657 658 +1
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-10 05:30:44 UTC
🛑 Suggested Action - Manual Review
Review summary Nits — 7 non-blocking
CI checks failing
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.
|
… store (#4506) refreshInstallationHealthRecords makes one real GitHub REST call per installation via getAppInstallation, but that call never fed the D1-persisted rate-limit observation store shouldWaitForGitHubRateLimit reads for queue-dequeue admission -- only #4505's job-level throttle protected it, with no visibility into its own consumption.
36574d1 to
0054bbd
Compare
Summary
getAppInstallation's response into the D1-persisted rate-limit observation store (recordGitHubRateLimitObservation) sorefreshInstallationHealthRecords's per-installation loop is actually visible toshouldWaitForGitHubRateLimit, the same admission check every comparable background job already feeds.timeoutFetch'sgithubRateLimitAdmission/githubRateLimitAdmissionKeyoptions: that option pair also drives the GET response-cache key, andinstallation:{id}collides across different calling Apps for the same installation id, which would have broken this endpoint's existing per-App-identity cache isolation (#1940). Recorded directly instead, mirroringbackfill.ts'srecordGitHubResponseheader-parsing logic inline (backfill.ts already importsgetAppInstallationfrom this module, so the reverse import would cycle).index.ts:163-164comment that calledrefresh-installation-healtha "cheap single-call health job."Closes #4506.
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #4506).Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — new/changed lines and branches insrc/github/app.tsare 100% covered (confirmed via isolated--coveragerun againsttest/unit/github-app.test.ts, zero uncovered lines in the changed range).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=moderateSafety
#1940test, re-verified green.)UI Evidencesection below. (N/A — backend-only change, no visible UI.)Notes
main, initially suspected a main-red typecheck break from the just-merged miner-hands PR (#4576) — turned out to be a stale localpackages/gittensory-engine/distbuild artifact (gitignored, untracked) left over from before the rebase, not a real regression. Rebuilt locally and confirmed clean; no fix needed onmain.