feat(github-app): add installation repair workflow - #279
Merged
JSONbored merged 7 commits intoJun 2, 2026
Conversation
|
Documentation Updates 1 document(s) were updated by changes in this PR: For MaintainersView Changes@@ -61,7 +61,49 @@
- Required webhook events are subscribed
- Installation metadata is current
-When permissions or events are missing, the system shows remediation steps [[10]](https://github.com/JSONbored/gittensory/blob/1e7506f4c5226d0b9b5da8fcd219309d84bacfcd/src/github/backfill.ts#L674-L682):
+When permissions or events are missing, use the new installation repair diagnostics endpoints to diagnose and resolve configuration issues systematically [[10]](https://github.com/JSONbored/gittensory/blob/1e7506f4c5226d0b9b5da8fcd219309d84bacfcd/src/github/backfill.ts#L674-L682).
+
+#### Installation Repair Diagnostics
+
+The installation repair endpoints provide comprehensive diagnostics for GitHub App configuration issues, including mode-specific impact analysis and structured repair steps.
+
+**`GET /v1/installations/{id}/repair`** — Returns detailed diagnostics for the installation:
+
+- **Current installation health** — Status (`healthy`, `needs_attention`, `broken`), missing permissions, missing events, and installed repository count.
+- **Installed repositories** — List of repositories with their settings (`publicSurface`, `commentMode`, `checkRunMode`, `autoLabelEnabled`).
+- **Required and optional permissions** — Permission map showing which permissions are required given the current configuration. For example, if check run mode is enabled for any repo, `Checks: write` moves from optional to required.
+- **Required and optional webhook events** — Event lists showing which webhook subscriptions are needed.
+- **Mode-specific impact analysis** — For each mode (comment, label, check_run):
+ - Whether the mode is enabled across installed repos
+ - How many repos use the mode
+ - Which permissions the mode requires
+ - Whether those permissions are missing
+ - Actionable guidance for resolving missing permissions
+- **Event diagnostics** — For each webhook event:
+ - Whether the event subscription is missing
+ - Whether the event is optional or required
+ - Summary explaining why the event is needed
+ - Action guidance for subscribing to missing events
+- **Repair steps** — Structured list of steps tailored to the current health status:
+ 1. Update the GitHub App permissions and subscribed events listed in diagnostics.
+ 2. Approve the changed permissions or reinstall the app on the target account.
+ 3. Run `POST /v1/installations/{id}/repair/refresh` after GitHub applies the changes.
+ 4. Recheck `GET /v1/installations/{id}/repair`.
+
+**`POST /v1/installations/{id}/repair/refresh`** — Refreshes the installation health by rechecking live GitHub App metadata:
+
+- Calls the GitHub API to fetch the latest installation permissions and webhook events.
+- Updates the local installation health record.
+- Returns the same diagnostics structure as the GET endpoint with a `refreshed: true` flag.
+- Use this endpoint after updating GitHub App permissions or webhook subscriptions to verify that the changes have been applied and the installation is now healthy.
+
+The diagnostics are mode-aware: if you enable check run mode for any installed repository, the repair diagnostics will show `Checks: write` as a required permission rather than optional. Similarly, if comment or label modes are enabled, `Issues: write` is required. This mode-specific logic helps maintainers understand exactly why certain permissions are needed and which repos are driving those requirements.
+
+If the installation is healthy, the repair steps simply show "No repair needed."
+
+**Fallback remediation steps:**
+
+If the repair endpoints are unavailable, follow these manual steps:
1. Update the GitHub App permissions and subscribed events.
2. Approve the changed permissions or reinstall the app on the target account. |
mkdev5
force-pushed
the
feat/issue-104-installation-repair
branch
from
June 2, 2026 09:27
ad46152 to
1e1ec7b
Compare
Contributor
Author
|
@JSONbored please check the PR |
JSONbored
previously requested changes
Jun 2, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@MkDev11 please fix merge conflicts 👍🏻
JSONbored
dismissed
their stale review
June 2, 2026 22:16
@MkDev11
A few notes:
- The repair diagnostics are a strong fit for #104: they separate required permissions, optional check-run permissions, required events, and mode-specific impact.
- The refresh endpoint gives maintainers a clear recheck path after GitHub App settings change.
- OpenAPI and the generated UI artifact are updated with the new repair routes.
No code changes requested.
JSONbored
self-requested a review
June 2, 2026 22:16
JSONbored
approved these changes
Jun 2, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@MkDev11
A few notes:
- The repair diagnostics are a strong fit for #104: they separate required permissions, optional check-run permissions, required events, and mode-specific impact.
- The refresh endpoint gives maintainers a clear recheck path after GitHub App settings change.
- OpenAPI and the generated UI artifact are updated with the new repair routes.
No code changes requested.
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
0.4.0so the current base branch version-audit gate passes after the latest MCP release.Scope
CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally; global coverage stays at or above 97% for lines, statements, functions, and branches (aim for 98%+ branch coverage locally so CI variance does not fail near the threshold)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:
npm run test:cipassed locally after rebasing onto upstreammainatbf45d0c.Safety
Notes
GET /v1/installations/{id}/repairandPOST /v1/installations/{id}/repair/refresh, plus theInstallationRepairschema.CONTRIBUTING.mdordinary feature PR guidance.ui:version-auditcheck on currentmain.