feat(review): make orb check publication configurable#2863
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 6238380 | Commit Preview URL Branch Preview URL |
Jul 04 2026, 04:28 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2863 +/- ##
=======================================
Coverage 96.03% 96.03%
=======================================
Files 259 259
Lines 28393 28411 +18
Branches 10326 10339 +13
=======================================
+ Hits 27266 27284 +18
Misses 491 491
Partials 636 636
🚀 New features to boost your workflow:
|
|
Warning Gittensory review approved this PRReview summary Nits (4)
Public GitHub metadata was checked for review readiness. Gittensor-specific context appears only when confirmed. Readiness score: 93/100
Signal definitions
Review context
Maintainer notes
Contributor next steps
💰 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. |
9720bf0 to
5b9ea23
Compare
|
Addressed both review findings:
Also rebased onto latest |
Adds settings.reviewCheckMode / gate.checkMode ("required" | "visible" |
"disabled") so a repo can keep GitHub branch protection pinned to the
review check, publish it as advisory-only UI, or stop publishing it
entirely, without weakening real CI/codecov gating or the autonomous
merge/close decision engine. Legacy gate.enabled/gateCheckMode continue
to map to required/disabled for back-compat; an explicit reviewCheckMode
always wins over the legacy boolean, at both the .gittensory.yml layer
and the settings write routes.
The autonomous decision engine no longer depends on the check-run's
existence: gate evaluation now runs whenever the check is published OR
an automation agent is configured, decoupling "should we publish a
check-run" from "should we compute a gate verdict."
Also fixes a related CI-deferral staleness bug: a required status
context that never reports was being held under the same 30-minute
stale-CI cap as genuinely pending CI, leaving PRs looking stuck for up
to half an hour. Missing-required-context now defers under its own
short 2-minute cap so review proceeds promptly once real CI is clear,
without adding polling or extra GitHub API calls.
…k-run publish (#2852) buildPublicPrIntelligenceComment and buildPublicPrPanelSignalRows derived their local gateEnabled flag from shouldPublishReviewCheck alone, so a reviewCheckMode: disabled repo with autonomy configured would silently downgrade a real, evaluated gate failure to "Advisory only" / "No action" in the public comment and panel row -- even though the same evaluation is authoritative for the autonomous merge/close decision. Both call sites now also treat a configured autonomy policy as enabling gate presentation, mirroring the shouldEvaluateGate policy signal in processors.ts, so the public surface never contradicts the decision the engine actually made.
…al pre-migration row (#2852) The existing reviewCheckMode tests only exercise the application layer through createTestEnv(), which applies every migration (including 0107) up front against an empty table -- so the migration's own UPDATE backfill never ran against a real pre-existing row and could drift silently. Mirrors migration-0102-linked-issue-gate-mode.test.ts's approach: replay every migration before 0107 into a fresh in-memory DB, insert a raw gate_check_mode='enabled' row exactly as a pre-existing installed repo would have it, then apply migration 0107 for real and assert the backfill. Also covers the 'off' and unrecognized-legacy-value cases failing closed to the new column's 'disabled' default, and a multi-row backfill in one run.
5b9ea23 to
6238380
Compare
|
Addressed the migration-coverage finding: Migration backfill lacked a real pre-migration regression test (confirmed). `createTestEnv()` applies every migration (including 0107) up front against an empty table, so the added `repository-settings-review-check-mode.test.ts` suite only exercised the application-layer derivation, never the migration's own `UPDATE ... WHERE gate_check_mode = 'enabled'` backfill running against a real pre-existing row. Added `test/unit/migration-0107-review-check-mode.test.ts`, mirroring the existing `migration-0102-linked-issue-gate-mode.test.ts` pattern: replays every migration before 0107 into a fresh in-memory DB, inserts a raw `gate_check_mode='enabled'` row exactly as a pre-existing installed repo would have it, applies migration 0107 for real, and asserts the backfill. Also covers the `'off'` case and an unrecognized legacy value both failing closed to the new column's `'disabled'` default, plus a multi-row backfill in one run. The "possible leaked secret" flag is the same recurring false positive noted on the previous round (pre-existing test-mock tokens, unchanged) — no real credential anywhere in the diff. Rebased onto latest `main` (moved 10 more commits) and re-ran the full local gate (typecheck, unsharded coverage — 8085 tests passing, migrations check) green. |
Summary
Adds a configurable
reviewCheckMode(gate.checkModein.gittensory.yml) so a self-hosted repo can choose how theGittensory Orb Review Agentcheck-run is published, independent of the autonomous merge/close decision:required— publish/update the check-run exactly as before; use when GitHub branch protection requires it as a status check. This is the legacy behavior.visible— publish/update the same check-run for advisory UI visibility only; not intended to be a required branch-protection context.disabled— never create or update the check-run. Reviews, comments, labels, audit trail, and autonomous merge/close all continue to work.gate.enabled: true/gateCheckMode: "enabled"continue to map torequired, andfalse/"off"todisabled, so existing configs behave identically. An explicitreviewCheckMode/gate.checkModealways takes precedence over the legacy boolean, both in.gittensory.ymland at the settings-write API routes (fixed a latent bug where the internal/dashboard write routes never actually exercised the legacy-boolean-derives-new-field fallback inupsertRepositorySettings).Critically, the autonomous decision engine (merge/close) no longer depends on the check-run's existence at all — gate evaluation now runs whenever the check is published or an automation agent is configured (
shouldEvaluateGate), soreviewCheckMode: disabledrepos still get correct auto-merge/auto-close via internal gate state + real CI + freshness + mergeability, with zero check-run API calls.Also fixes a related staleness bug found while validating this: a required branch-protection status context that never reports (vs. genuinely pending CI) was held under the same blunt 30-minute stale-CI cap, so PRs could look stuck for up to half an hour. It now defers under its own short 2-minute cap, so review proceeds promptly once real CI is clear — no new polling or extra GitHub API calls either way.
Migration notes for self-host operators
gate.checkMode: disabled(orvisibleto keep it advisory-only) in the global private config.disabled, removeGittensory Orb Review Agentfrom that repo's required branch-protection status checks first — Gittensory cannot manage branch-protection settings itself, and a required check that's never published will leave PRs stuck at "Expected — Waiting for status to be reported."reviewCheckModeonly controls whether/how the check-run itself is published.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally; 100% patch coverage (lines and branches) verified on every changed line insrc/**.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
openapi.jsonregenerated,ui:openapi:settings-paritypasses.apps/gittensory-uiUI changes in this PR — backend/config-only.).gittensory.yml.exampleandconfig/examples/*.ymlupdated;CHANGELOG.mduntouched.)Notes
0107_repository_review_check_mode.sqladdsreview_check_mode(defaultdisabled) and backfills existinggate_check_mode = 'enabled'rows torequired.apps/gittensory-uidashboard changes — this is intentionally backend/config-driven only for now; the dashboard toggle continues to writegateCheckMode, which the API layer now correctly derivesreviewCheckModefrom.