fix(health): exclude uninstalled repos from /api/v1/health#133
Open
leonaIee wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/v1/healthreturned every row in therepostable, including repos whose GitHub App installation has been removed or uninstalled. Those rows are intentionally kept (soft-cleared toinstallation_id = NULL,registered = falseininstallation.handler.ts) so historical scoring evidence isn't lost, but they are no longer tracked. The endpoint's own description advertises "the list of tracked repos", so the inclusion of soft-cleared rows is a contract bug; it also misleads downstream consumers (e.g.gittensor-ui) that read/healthas an active-installation signal before allowing registration.This PR filters
listRepoHealth()toinstallation_id IS NOT NULLusing the sameNot(IsNull())idiom already used infetch.processor.ts. Top-levelstatus, DB/Redis probes, the 503-on-failure behavior, and the stalest-first sort are unchanged. Newly-added-but-not-yet-registered repos (installed butregistered = false) remain visible, which is the semantic the UI's "is the App installed?" probe actually needs.Related Issues
Fixes #132
Type of Change
Testing
Reproduction steps from the linked issue, executed against a local mirror with the Gittensor Mirror App installed:
reposwithinstallation_idset; repo is listed in/api/v1/health.reposwithinstallation_id = NULLandregistered = false; the repo is no longer in the/api/v1/healthreposarray.status: "ok",db/redissections, 503 behavior when a dep is down, and the stalest-first / nulls-last ordering for the remaining tracked repos.Build / lint / format on the changed file:
npm run build,eslint, andprettier --checkall clean.Checklist
packages/dashas no automated test suite; manual verification per the steps above (CONTRIBUTING: "Confirm manual testing performed")