feat(api): add tenant-scoped installation health and repair (#7661) - #8069
Conversation
…health and repair (JSONbored#7661) Introduces new tenant-scoped routes under `/v1/app/installations*` for managing installation health and repair. These routes allow tenants to view and repair their own installations while restricting access to others' installations. The implementation includes: - GET `/v1/app/installations`: Lists installations and their health for the authenticated tenant. - GET `/v1/app/installations/:id/health`: Retrieves health information for a specific installation. - GET `/v1/app/installations/:id/repair`: Initiates a repair for a specific installation. - POST `/v1/app/installations/:id/repair/refresh`: Refreshes the health status of a specific installation. Additionally, a new middleware function `resolveAppInstallationScope` is added to enforce access control based on tenant roles. Comprehensive integration tests have been added to ensure proper functionality and access restrictions.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-22 18:37:32 UTC
Review summary Nits — 3 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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8069 +/- ##
==========================================
+ Coverage 91.82% 95.39% +3.56%
==========================================
Files 734 2 -732
Lines 75023 2648 -72375
Branches 23040 888 -22152
==========================================
- Hits 68889 2526 -66363
+ Misses 5034 27 -5007
+ Partials 1100 95 -1005
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Summary
/v1/app/installationshealth/repair/refresh siblings of the operator-only/v1/installations*routes, reusing/v1/app/maintainer-dashboard's exactloadControlPanelAccessScopepattern so a non-operator session only sees/acts on their own installations.scope === null).expensive, matching the operator route.Closes #7661
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 actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.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=moderateIf any required check was skipped, explain why:
npx vitest run test/integration/app-installations-selfservice.test.ts test/unit/auth.test.ts. Confirmed the new test SOURCE has no PEM header literals (the false-positive that closed feat(api): tenant self-service for installation health/repair #8006). Remainingtest:cisurfaces run in CI. No OpenAPI/UI artifact changes (same shape as the CI-green feat(api): tenant self-service for installation health/repair #8006 attempt).Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
N/A — API-only tenant scoping; no visible UI change.
Notes
node:cryptoexport so that literal never appears in the diff.mainbefore open; confirm no other open PR links Add tenant self-service for installation health/repair (currently operator-only) #7661 at push time (duplicate-of-open-PR closes siblings).