Skip to content

feat(github-app): @gittensory gate-override command (#538) - #823

Merged
JSONbored merged 1 commit into
mainfrom
feat/gate-appeal-override
Jun 17, 2026
Merged

feat(github-app): @gittensory gate-override command (#538)#823
JSONbored merged 1 commit into
mainfrom
feat/gate-appeal-override

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

The first action command (every existing @gittensory command is read-only Q&A). The maintainer relief valve for gate false-positives — and a Phase-1 prerequisite (the human escape hatch before any autonomous gate action).

Behavior

An authorized maintainer comments @gittensory gate-override <reason> and gittensory finalizes the live Gittensory Gate check to neutral for the current commit only. A new push re-evaluates — it's a relief valve, not a permanent bypass (no override state persisted anywhere).

Security (this flips a gate — reviewed carefully)

  • Authorization uses REAL repo permission (getRepositoryCollaboratorPermission via resolveRealRepoPermissionAssociation), never the spoofable payload.comment.author_association — closing the [Bug/write-safety]: command authority conflates org MEMBER with repo maintainer (P1, agent-layer prereq) #788 hazard on this privileged path. Default policy = maintainer + collaborator (admin/maintain/write); no pr_author/confirmed_miner.
  • Reason is public-safe-sanitized before it reaches the check output / comment.
  • Both allow and deny are audited (github_app.gate_overridden / github_app.gate_override_denied).

Changes

  • createOrUpdateOverriddenGateCheckRun finalizer (neutral, names actor+reason, resolves the current Gate run by headSha).
  • maybeProcessGateOverrideCommand mirrors the existing maybeProcessPrPanelRetrigger action pattern; dispatched before the Q&A handler.
  • Renamed the permission resolver to resolveRealRepoPermissionAssociation (now shared by both action commands).
  • Bonus (feat(github-app): gate appeal/override command + configurable settings #538 settings half): surface badgeEnabled in settings-preview (the only genuinely-missing one — slopGateMode already shipped; checkRunAnnotations/issueTriageMode/reviewerRoutingMode are separate wave items).

Verification

1901 unit tests pass (incl. allow/deny auth + neutral-PATCH + audit + no-persist tests); typecheck clean; all changed lines covered; no openapi drift; migration guard OK.

Closes #538

The first action command (existing @gittensory commands are read-only Q&A). An
authorized maintainer comments `@gittensory gate-override <reason>` and gittensory
finalizes the live Gittensory Gate check to NEUTRAL for the current commit only —
a new push re-evaluates, so it's a relief valve, not a permanent bypass.

- Authorization uses REAL repo permission (getRepositoryCollaboratorPermission via
  resolveRealRepoPermissionAssociation), never the spoofable author_association —
  closing the #788 hazard on this privileged path. Default gateOverridePolicy =
  maintainer + collaborator (admin/maintain/write); no pr_author/confirmed_miner.
- New createOrUpdateOverriddenGateCheckRun finalizer (neutral, names actor+reason);
  resolves the current Gate run by headSha. No override state persisted anywhere.
- Reason is public-safe-sanitized; both allow and deny are audited
  (github_app.gate_overridden / github_app.gate_override_denied).
- Bonus (the #538 settings half): surface badgeEnabled in settings-preview.

Renamed resolvePrPanelRetriggerActorAssociation -> resolveRealRepoPermissionAssociation
(now shared by the panel-retrigger and override action commands).

1901 unit tests pass; typecheck clean; all changed lines covered; no openapi drift.

Closes #538
@dosubot dosubot Bot added the size:L label Jun 17, 2026
@ghost

ghost commented Jun 17, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #823 is no longer open. No action.

💰 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.

@ghost ghost added the gittensory:reviewed label Jun 17, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@ghost

ghost commented Jun 17, 2026

Copy link
Copy Markdown

gittensory · advisory review

Reviewed 8 changed file(s) — two independent AI reviewers.

Changed files: src/github/app.ts, src/github/commands.ts, src/queue/processors.ts, src/settings/command-authorization.ts, src/signals/settings-preview.ts, test/unit/command-authorization.test.ts, test/unit/github-commands.test.ts, test/unit/queue.test.ts

Suggested action:Safe to merge — both reviewers found no blocking issues.

Reviewer A · gpt-oss-120b — recommends ✅ merge
This PR adds a new @gittensory gate-override command that allows maintainers/collaborators to set the Gate check to neutral for the current commit only, with proper permission checks, sanitization, audit logging, and user feedback. The implementation updates webhook handling, command parsing, authorization defaults, and includes comprehensive tests.

Suggestions

  • Add a brief entry to the public documentation or README describing the new gate-override command and its usage.
  • Consider adding a test case for the scenario where no existing Gate check run exists (ensuring no new check run is created unintentionally).
  • Verify that the new badgeEnabled setting is reflected in any UI or API surfaces that expose settings, or remove it if unused.

Worth double-checking

  • If a repository has no existing Gate check run, the override logic may create an unexpected check run; ensure this is acceptable or handle gracefully.
  • Make sure the imported AGENT_COMMAND_COMMENT_MARKER constant exists and is correctly exported from github/comments.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR adds a @gittensory gate-override command allowing maintainers/collaborators to temporarily set the Gate check to neutral for the current commit only. Implementation correctly validates permissions via real collaborator API (ignoring spoofable author_association), sanitizes the reason for public output, and does not persist the override. Changes are well-tested with comprehensive unit tests covering allowed/denied scenarios and command parsing.

Suggestions

  • Consider adding a test for the retrigger function after the resolveRealRepoPermissionAssociation refactor to ensure behavior remains unchanged (though existing tests likely cover this).
  • The badgeEnabled field added in signals/settings-preview.ts appears unrelated to this PR; ensure it's properly documented and tested elsewhere if part of another feature.

Worth double-checking

  • The retrigger function's association resolution was changed from resolvePrPanelRetriggerActorAssociation to resolveRealRepoPermissionAssociation; while functionally equivalent, verify no unintended side effects in retrigger logic.
  • The badgeEnabled field is added but not used in the diff shown; confirm it's safely integrated elsewhere.

@JSONbored
JSONbored merged commit c7d8020 into main Jun 17, 2026
18 checks passed
@JSONbored
JSONbored deleted the feat/gate-appeal-override branch June 17, 2026 10:28
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.91228% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.64%. Comparing base (fbb87ec) to head (086159d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/queue/processors.ts 57.77% 9 Missing and 10 partials ⚠️
src/github/commands.ts 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #823      +/-   ##
==========================================
- Coverage   96.77%   96.64%   -0.14%     
==========================================
  Files          97       97              
  Lines       14006    14058      +52     
  Branches     5102     5121      +19     
==========================================
+ Hits        13555    13587      +32     
- Misses         86       95       +9     
- Partials      365      376      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(github-app): gate appeal/override command + configurable settings

1 participant