Skip to content

feat(github-app): merge-readiness aggregate gate (#551) - #821

Merged
JSONbored merged 2 commits into
mainfrom
feat/merge-readiness-gate
Jun 17, 2026
Merged

feat(github-app): merge-readiness aggregate gate (#551)#821
JSONbored merged 2 commits into
mainfrom
feat/merge-readiness-gate

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

One composite control — mergeReadinessGateMode (off/advisory/block) — that rolls the four sub-gates (linked-issue, duplicate, quality/readiness, slop) into a single Gittensory Gate pass/fail, so a maintainer flips ONE switch instead of four and keeps one required check for branch protection (the prereq Phase-1 auto-merge consumes).

How it works

When set, it overrides every sub-gate to its mode and reuses the existing evaluateGateCheck aggregation + "what's still blocking" summary. When off, it's a no-op (sub-gates keep their own modes). Default off preserves existing behavior for every current repo.

Changes

  • migration 0038 (guard-validated as the correct next number) + the setting wired through types / schema / repositories / openapi / settings-preview / processors — mirrors slopGateMode exactly.
  • Composite logic in advisory.ts (applyMergeReadinessGate, ~30 lines).
  • Tests: off / advisory / block + "the summary lists each unmet condition".

Verification

1898 unit tests pass; typecheck clean; all changed lines covered (verified vs lcov); migration guard confirms 0038.

Deferred (follow-up)

The .gittensory.yml gate.mergeReadiness config-as-code parity — it needs the focus-manifest gate-schema parser extended, so it's split out to keep this PR focused. The DB-settable path is complete.

Closes #551

Adds `mergeReadinessGateMode` (off/advisory/block) — one composite control that
rolls the four sub-gates (linked-issue, duplicate, quality/readiness, slop) into a
single Gittensory Gate pass/fail, so a maintainer flips ONE switch instead of four
and keeps one required check for branch protection.

When set, it overrides every sub-gate to its mode and reuses the existing
evaluateGateCheck aggregation + "what's still blocking" summary; when off it's a
no-op (sub-gates keep their own modes). Default off preserves existing behavior.

- migration 0038 + the setting wired through types/schema/repositories/openapi/
  settings-preview/processors (mirrors slopGateMode exactly)
- composite logic in advisory.ts (applyMergeReadinessGate)
- tests: off/advisory/block + "summary lists each unmet condition"; 1898 unit
  tests pass, all changed lines covered, migration guard validates 0038

Deferred to a follow-up: the .gittensory.yml gate.mergeReadiness config-as-code
parity (needs the focus-manifest gate-schema parser extended).

Closes #551
@dosubot dosubot Bot added the size:M 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 #821 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
@ghost

ghost commented Jun 17, 2026

Copy link
Copy Markdown

gittensory · advisory review

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

Changed files (19)
  • apps/gittensory-ui/public/openapi.json
  • migrations/0038_merge_readiness_gate.sql
  • src/db/repositories.ts
  • src/db/schema.ts
  • src/openapi/schemas.ts
  • src/queue/processors.ts
  • src/rules/advisory.ts
  • src/signals/settings-preview.ts
  • src/types.ts
  • test/unit/gate-check-policy.test.ts
  • test/unit/maintainer-activation.test.ts
  • test/unit/policy-sanitizer.test.ts
  • test/unit/registration-readiness.test.ts
  • test/unit/repo-policy-readiness.test.ts
  • test/unit/self-dogfood-registration-pack.test.ts
  • test/unit/settings-preview.test.ts
  • test/unit/signals-coverage.test.ts
  • test/unit/signals-v2.test.ts
  • test/unit/signals.test.ts

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

Reviewer A · gpt-oss-120b — recommends ✅ merge
This PR introduces a new composite "merge-readiness" gate that can override the four existing sub‑gates, adds the corresponding DB column, updates types, OpenAPI schemas, repository‑settings handling, and includes comprehensive tests.

Suggestions

  • Add UI controls and documentation so maintainers can configure the new mergeReadinessGateMode in the settings page.
  • Verify that the new migration (0038_merge_readiness_gate.sql) is applied in all deployment environments.
  • Consider deprecating or hiding the individual sub‑gate controls when the composite gate is set to advisory or block to avoid confusing configuration.

Worth double-checking

  • Existing clients that construct RepositorySettings objects must include the new field to avoid defaulting to undefined.
  • If the migration is not run, the code will expect a non‑null column and could error on older databases.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR adds a merge-readiness composite gate feature allowing maintainers to override four sub-gates (linked-issue, duplicate, quality/readiness, slop) with a single setting. Changes span database schema, types, core logic, OpenAPI, and tests. Implementation is consistent, well-tested, and preserves existing behavior via 'off' default.

No blocking issues spotted.

Before = production · After = this PR's preview deploy.

Route Viewport Before After
/ desktop before desktop after desktop
mobile before mobile after mobile

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.77%. Comparing base (7465756) to head (3288077).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #821   +/-   ##
=======================================
  Coverage   96.77%   96.77%           
=======================================
  Files          97       97           
  Lines       14001    14006    +5     
  Branches     5099     5102    +3     
=======================================
+ Hits        13549    13555    +6     
  Misses         86       86           
+ Partials      366      365    -1     

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

@superagent-security

Copy link
Copy Markdown
Contributor

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

The #551 openapi schema change added mergeReadinessGateMode to the repository
settings schema; regenerate the committed UI openapi spec so ui:openapi:check
passes.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 3288077 Commit Preview URL

Branch Preview URL
Jun 17 2026, 10:04 AM

@JSONbored JSONbored self-assigned this Jun 17, 2026
@JSONbored
JSONbored merged commit fbb87ec into main Jun 17, 2026
21 checks passed
@JSONbored
JSONbored deleted the feat/merge-readiness-gate branch June 17, 2026 10:05
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): merge-readiness aggregate gate

1 participant