Skip to content

fix(cursor-review): restore the blocking gate dropped by #31 (BE-4691) #140

fix(cursor-review): restore the blocking gate dropped by #31 (BE-4691)

fix(cursor-review): restore the blocking gate dropped by #31 (BE-4691) #140

name: Test cursor-review scripts
# Runs the Python unit tests for the cursor-review helper scripts, especially
# the stdio MCP output contract used by reviewers and the judge. These scripts
# drive panel consolidation for every consumer repo, so they are cheap to
# guard with a unit run on change.
# Inputs/secrets: none. Triggers: path-filtered pull requests and pushes to main.
# Caller pattern: none; this is repository-local CI, not a reusable workflow.
#
# cursor-review.yml itself is in the path filter because two suites read it:
# catalog-drift.py reads the model pins OUT of it (BE-4819), and
# test_workflow_job_isolation.py pins the credential split (no job both checks
# out PR code and holds the bot key / pull-requests: write). Both assertions are
# only worth anything if they run when the file they parse changes.
#
# docs/callers/cursor-review.md is here for the same reason and, specifically,
# for the drift direction test_workflow_inputs_docs.py was written to catch:
# that suite pins set-equality between the workflow's declared inputs and the
# tables in BOTH .github/cursor-review/README.md (already covered by the
# .github/cursor-review/** entry) and the setup guide. Without this line a
# docs-only PR that deletes the `blocking` row — the #31 scenario exactly —
# matches no filter and runs no job, so the alarm cannot fire on the very edit
# it exists for.
on:
pull_request:
paths:
- '.github/cursor-review/**'
- '.github/workflows/cursor-review.yml'
- '.github/workflows/cursor-review-catalog-drift.yml'
- '.github/workflows/test-cursor-review-scripts.yml'
- 'docs/callers/cursor-review.md'
push:
branches: [main]
paths:
- '.github/cursor-review/**'
- '.github/workflows/cursor-review.yml'
- '.github/workflows/cursor-review-catalog-drift.yml'
- '.github/workflows/test-cursor-review-scripts.yml'
- 'docs/callers/cursor-review.md'
permissions:
contents: read
jobs:
test:
name: unittest + shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: ShellCheck the cursor-review shell scripts
# These run inside the review jobs with no unit tests behind them, so
# shellcheck is the only automated guard on install-cursor-cli.sh (the
# sha256-pinned CLI installer) and slack-notify.sh.
run: shellcheck -x .github/cursor-review/install-cursor-cli.sh .github/cursor-review/slack-notify.sh
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Run cursor-review script tests
run: python3 -m unittest discover -s .github/cursor-review/tests -p 'test_*.py' -v