Skip to content

feat: shared PR check system for all kyndig repos#2

Merged
thehoegh merged 8 commits into
mainfrom
feat/shared-pr-checks
May 3, 2026
Merged

feat: shared PR check system for all kyndig repos#2
thehoegh merged 8 commits into
mainfrom
feat/shared-pr-checks

Conversation

@thehoegh

@thehoegh thehoegh commented May 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Upgrades the shared Bugbot Gate reusable workflow to combine check-run wait with current-cycle unresolved Bugbot review thread enforcement (adopts cycle-boundary logic from varde Kit + check-run grace period from ritz).
  • Adds six new reusable workflow_call workflows covering all active repo categories: PR metadata check, Node/pnpm quality/build/Playwright, Raycast CI, and Python SDK tests.
  • Adds docs/pr-checks-audit.md mapping the current state of all 12 active repos (workflows, protection gaps, branch deletion gaps).
  • Adds docs/org-baseline.md with the authoritative org/repo settings baseline and per-repo normalisation steps.
  • Updates docs/bugbot-gate-rollout.md with per-category CI After Gate patterns and the revised rollout checklist.

What changed in the Bugbot Gate contract

The gate now requires two things to pass (previously only the first):

  1. Cursor Bugbot check run has completed (any conclusion).
  2. No unresolved qualifying Bugbot review threads exist in the current push cycle — threads from older commits do not block the gate.

Breaking input change: callers must now pass pull_number in addition to sha. The updated caller template is in docs/bugbot-gate-rollout.md.

Reusable workflows added

Workflow Stable job name Intended callers
pr-metadata-check.yml PR Metadata Check Called directly on pull_request
node-pnpm-quality.yml Quality CI After Gate via workflow_run
node-pnpm-build.yml Build CI After Gate via workflow_run
node-pnpm-playwright.yml Playwright CI After Gate via workflow_run
raycast-ci.yml Raycast CI CI After Gate via workflow_run
python-sdk-tests.yml SDK Tests CI After Gate via workflow_run

Rollout next steps

See docs/org-baseline.md for the full sequence. Short version:

  1. Enable branch deletion after merge on switchto, varde-web, faen-ta.
  2. Add minimal main protection (PR required, no required checks yet) to all unprotected repos.
  3. Pilot the shared gate on kynd-web-new (already has clean job split).
  4. Verify emitted check names from a real PR before locking rulesets.
  5. Expand repo by repo following the category patterns in docs/bugbot-gate-rollout.md.

ContractImpact: none

Made with Cursor


Note

Medium Risk
Changes merge-gating behavior by adding PR-head/cycle-boundary logic and unresolved-thread enforcement, which could block PRs if the GitHub APIs or matching rules behave unexpectedly. Adds multiple reusable workflows that become part of branch protection check names, so misconfiguration could disrupt CI enforcement.

Overview
Upgrades the shared Bugbot Gate reusable workflow to require pull_number, wait for the Bugbot check to complete, and then fail if any current-push-cycle qualifying Bugbot review threads remain unresolved (with configurable reviewer/body regex matchers and a PR-head SHA race guard).

Adds new reusable workflow_call workflows for pr-metadata-check (issue/workdoc + optional ContractImpact validation + warnings) and standard CI building blocks (node-pnpm-quality, node-pnpm-build, node-pnpm-playwright, python-sdk-tests, raycast-ci) with stable job names intended for workflow_run “CI After Gate” pipelines.

Updates and adds docs (bugbot-gate-rollout, org-baseline, pr-checks-audit) to prescribe rollout steps, required-check naming, and per-repo onboarding patterns.

Reviewed by Cursor Bugbot for commit 224d451. Bugbot is set up for automated code reviews on this repo. Configure here.

thehoegh and others added 4 commits May 2, 2026 10:53
Captures the current state of PR workflows, branch protection settings,
and Bugbot implementations across all 12 active repositories. Documents
gaps: missing main protection on 9 repos, branch deletion disabled on 3,
and three diverging local Bugbot-comment implementations that should be
replaced by the shared gate.

Serves as the baseline reference for the shared PR check rollout.

Co-authored-by: Cursor <cursoragent@cursor.com>
Extends the reusable Bugbot Gate beyond waiting for the check run
conclusion. After the Cursor Bugbot check completes, the gate now:

- Determines the current-cycle boundary from the PR timeline (latest
  push or force-push timestamp) so only threads from the current commit
  are evaluated — stale comments from older pushes do not block merges.
- Fetches all review threads via GraphQL and fails if any qualifying
  Bugbot thread in the current cycle remains unresolved.
- Guards against a concurrent push changing the PR head mid-evaluation.

New inputs:
  pull_number        required — needed for timeline and thread queries
  qualifying_reviewer_login_regex  optional — override default Cursor
                                   user matching
  qualifying_comment_body_regexes  optional — override default severity-
                                   marker / fix-in-cursor body matching

The cycle-boundary and configurable-matcher logic is taken from the
Kit implementation in varde. The check-run wait (with 5 s grace period)
is taken from the ritz implementation. Combined, the gate is strictly
more correct than any existing local implementation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Five reusable workflow_call workflows covering all active repo categories:

pr-metadata-check.yml — PR description quality gate (cheap, runs on
  pull_request). Enforces issue linkage, optional ContractImpact
  validation, changelog warning, and template-fill warnings. All
  behaviour is opt-in via inputs; only issue linkage defaults to true.

node-pnpm-quality.yml — lint + typecheck + optional format check.
  Job name "Quality" is stable for branch protection rulesets.

node-pnpm-build.yml — install + build.
  Job name "Build" is stable for branch protection rulesets.

node-pnpm-playwright.yml — install + build + Playwright tests.
  Job name "Playwright" is stable for branch protection rulesets.

raycast-ci.yml — Raycast Store metadata validation, migration drift
  check, npm ci, build, lint, typecheck, optional unit tests.
  Runs on macos-latest. Job name "Raycast CI" is stable.

python-sdk-tests.yml — Python SDK tests with optional network skip
  and artifact upload. Job name "SDK Tests" is stable.

All expensive workflows are designed to be called from a CI After Gate
workflow triggered by workflow_run on "Bugbot Gate", so they only start
after the gate passes. Commands are inputs; no build logic is hardcoded.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ries

org-baseline.md — authoritative settings reference:
  - Branch deletion after merge: required everywhere; gaps listed
  - Main branch protection: minimum ruleset config, gaps listed
  - Required status check rollout sequence (Bugbot Gate first, then
    category checks only after verifying emitted names from a real PR)
  - Per-repo normalisation steps for kynd-web, kynd-web-new, varde

bugbot-gate-rollout.md — updated for the upgraded gate and full library:
  - Thin caller now passes pull_number (required by upgraded gate)
  - CI After Gate patterns for all categories: web pnpm, monorepo,
    Raycast, Python SDK, Swift/macOS, CLI tool
  - Optional PR metadata caller pattern
  - Revised ruleset setup and rollout checklist
  - Updated gate semantics section (check-run wait + cycle-boundary
    unresolved-thread check)

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread .github/workflows/pr-metadata-check.yml Outdated
Comment thread .github/workflows/python-sdk-tests.yml Outdated
thehoegh and others added 2 commits May 2, 2026 11:31
Use a JavaScript-compatible end-of-input assertion so template quality checks include the last section of a PR body.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve test output relative to the reusable workflow working directory so nested SDK callers upload the artifacts they generate.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread .github/workflows/bugbot-gate.yml
Git author/committer dates are user-controllable and can be arbitrarily
old (cherry-picks, offline work, pre-created commits). When parseMs used
author.date first for 'committed' events, old dates set a cycle boundary
that predated prior-cycle Bugbot comments, causing them to satisfy
`ts > cycleBoundaryMs` and incorrectly block the gate.

Invert the candidate order so GitHub's push timestamp (created_at) is
tried first; git dates are retained only as a last resort when
created_at is absent.

Co-authored-by: Cursor <cursoragent@cursor.com>
@thehoegh

thehoegh commented May 3, 2026

Copy link
Copy Markdown
Member Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3655916. Configure here.

Comment thread .github/workflows/bugbot-gate.yml Outdated
…hread

|| let any comment whose body matched Bugbot patterns (e.g. the public
https://cursor.com/fix-in-cursor URL) from any user qualify a thread as
a "Bugbot thread", causing false gate failures with a misleading error.

Bugbot comments always satisfy both criteria, so && is equally precise
for real Bugbot threads while excluding non-Bugbot comments that happen
to contain matching body content.

Co-authored-by: Cursor <cursoragent@cursor.com>
@thehoegh thehoegh merged commit 9c395e3 into main May 3, 2026
1 check passed
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.

1 participant