From 10dc98112ccfdc24fd129381f10c4d471b887546 Mon Sep 17 00:00:00 2001 From: Molecule AI Core-DevOps Date: Thu, 14 May 2026 03:57:27 +0000 Subject: [PATCH] =?UTF-8?q?fix(ci):=20rename=20sop-checklist-gate=E2=86=92?= =?UTF-8?q?sop-checklist=20to=20match=20BP=20context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mc#948 (BP→emitter drift): `sop-checklist / all-items-acked (pull_request)` was required by branch protection but the workflow was named `sop-checklist-gate`, so it emitted the misnamed context `sop-checklist-gate / gate (pull_request)` instead. Rename to align the workflow's `name:` field with the context that BP requires: sop-checklist-gate.yml → sop-checklist.yml sop-checklist-gate.py → sop-checklist.py test_sop_checklist_gate.py → test_sop_checklist.py New context emitted: `sop-checklist / all-items-acked (pull_request)`. Added `# bp-required: yes` directive to the workflow header per Tier 2g lint convention (mc#774). All 52 script tests pass. Closes #948. Co-Authored-By: Claude Opus 4.7 --- .gitea/scripts/review-check.sh | 2 +- .../{sop-checklist-gate.py => sop-checklist.py} | 4 ++-- ...t_sop_checklist_gate.py => test_sop_checklist.py} | 8 ++++---- .gitea/sop-checklist-config.yaml | 2 +- .gitea/workflows/review-refire-comments.yml | 2 +- .../{sop-checklist-gate.yml => sop-checklist.yml} | 12 +++++++----- 6 files changed, 16 insertions(+), 14 deletions(-) rename .gitea/scripts/{sop-checklist-gate.py => sop-checklist.py} (99%) rename .gitea/scripts/tests/{test_sop_checklist_gate.py => test_sop_checklist.py} (98%) rename .gitea/workflows/{sop-checklist-gate.yml => sop-checklist.yml} (95%) diff --git a/.gitea/scripts/review-check.sh b/.gitea/scripts/review-check.sh index ef238e36..5bc00448 100755 --- a/.gitea/scripts/review-check.sh +++ b/.gitea/scripts/review-check.sh @@ -145,7 +145,7 @@ if [ -z "$PR_AUTHOR" ] || [ -z "$PR_HEAD_SHA" ]; then fi # --- RFC#324 §N/A follow-up: check N/A declarations status --- -# sop-checklist-gate.py posts `sop-checklist / na-declarations (pull_request)` +# sop-checklist.py posts `sop-checklist / na-declarations (pull_request)` # status when a peer posts /sop-n/a . If our gate is declared N/A, # the requirement for a Gitea APPROVE review is waived. NA_STATUSES_TMP=$(mktemp) diff --git a/.gitea/scripts/sop-checklist-gate.py b/.gitea/scripts/sop-checklist.py similarity index 99% rename from .gitea/scripts/sop-checklist-gate.py rename to .gitea/scripts/sop-checklist.py index e53c60b7..323b5126 100755 --- a/.gitea/scripts/sop-checklist-gate.py +++ b/.gitea/scripts/sop-checklist.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 -# sop-checklist-gate — evaluate whether a PR has peer-acked each +# sop-checklist — evaluate whether a PR has peer-acked each # SOP-checklist item. Posts a commit-status that branch protection # can require. # # RFC#351 Step 2 of 6 (implementation MVP). # -# Invoked by .gitea/workflows/sop-checklist-gate.yml on: +# Invoked by .gitea/workflows/sop-checklist.yml on: # - pull_request_target: [opened, edited, synchronize, reopened] # - issue_comment: [created, edited, deleted] # diff --git a/.gitea/scripts/tests/test_sop_checklist_gate.py b/.gitea/scripts/tests/test_sop_checklist.py similarity index 98% rename from .gitea/scripts/tests/test_sop_checklist_gate.py rename to .gitea/scripts/tests/test_sop_checklist.py index 47ae4f23..24fbc54c 100644 --- a/.gitea/scripts/tests/test_sop_checklist_gate.py +++ b/.gitea/scripts/tests/test_sop_checklist.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 -# Unit tests for sop-checklist-gate.py +# Unit tests for sop-checklist.py # -# Run: python3 .gitea/scripts/tests/test_sop_checklist_gate.py -# or: pytest .gitea/scripts/tests/test_sop_checklist_gate.py +# Run: python3 .gitea/scripts/tests/test_sop_checklist.py +# or: pytest .gitea/scripts/tests/test_sop_checklist.py # # RFC#351 Step 2 of 6 — implementation MVP. Tests cover: # - slug normalization (the 4 example variants in the script header) @@ -33,7 +33,7 @@ sys.path.insert(0, PARENT) import importlib.util # noqa: E402 _spec = importlib.util.spec_from_file_location( - "sop_checklist_gate", os.path.join(PARENT, "sop-checklist-gate.py") + "sop_checklist", os.path.join(PARENT, "sop-checklist.py") ) sop = importlib.util.module_from_spec(_spec) _spec.loader.exec_module(sop) # type: ignore[union-attr] diff --git a/.gitea/sop-checklist-config.yaml b/.gitea/sop-checklist-config.yaml index 3b61605d..346d231f 100644 --- a/.gitea/sop-checklist-config.yaml +++ b/.gitea/sop-checklist-config.yaml @@ -111,7 +111,7 @@ items: # N/A gate declarations (RFC#324 §N/A follow-up). # PRs where a gate genuinely does not apply (e.g., pure-infra with no # qa surface, or docs-only) can be declared N/A by a non-author peer -# who is in one of the gate's required_teams. The sop-checklist-gate +# who is in one of the gate's required_teams. The sop-checklist # posts a `sop-checklist / na-declarations (pull_request)` status that # review-check.sh reads to skip the Gitea-APPROVE requirement. # diff --git a/.gitea/workflows/review-refire-comments.yml b/.gitea/workflows/review-refire-comments.yml index 97eb1371..c799c442 100644 --- a/.gitea/workflows/review-refire-comments.yml +++ b/.gitea/workflows/review-refire-comments.yml @@ -2,7 +2,7 @@ # # Gitea 1.22 queues one run per workflow subscribed to `issue_comment` before # evaluating job-level `if:`. SOP-heavy PRs therefore created queue storms when -# qa-review, security-review, sop-checklist-gate, and sop-tier-refire all +# qa-review, security-review, sop-checklist, and sop-tier-refire all # listened to comments. This workflow is the single non-SOP comment subscriber: # ordinary comments no-op quickly; slash commands post the required status # contexts to the PR head SHA. diff --git a/.gitea/workflows/sop-checklist-gate.yml b/.gitea/workflows/sop-checklist.yml similarity index 95% rename from .gitea/workflows/sop-checklist-gate.yml rename to .gitea/workflows/sop-checklist.yml index 3fd3ba81..72e33f04 100644 --- a/.gitea/workflows/sop-checklist-gate.yml +++ b/.gitea/workflows/sop-checklist.yml @@ -1,4 +1,4 @@ -# sop-checklist-gate — peer-ack merge gate for SOP-checklist items. +# sop-checklist — peer-ack merge gate for SOP-checklist items. # # RFC#351 Step 2 of 6 (implementation MVP). # @@ -65,7 +65,9 @@ # membership, compute, post status). Re-running on any event is safe — # the new status overwrites the previous one for the same context. -name: sop-checklist-gate +name: sop-checklist + +# bp-required: yes ← emits sop-checklist / all-items-acked (pull_request) on: pull_request_target: @@ -83,7 +85,7 @@ permissions: statuses: write jobs: - gate: + all-items-acked: # Run on pull_request_target events always. On issue_comment events, # only when the comment is on a PR (issue_comment fires for issues # too) and the body contains one of the slash-commands. @@ -106,7 +108,7 @@ jobs: # qa-review.yml so the script source is always trusted. ref: ${{ github.event.repository.default_branch }} - - name: Run sop-checklist-gate + - name: Run sop-checklist env: GITEA_TOKEN: ${{ secrets.SOP_CHECKLIST_GATE_TOKEN || secrets.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} @@ -114,7 +116,7 @@ jobs: REPO_NAME: ${{ github.event.repository.name }} run: | set -euo pipefail - python3 .gitea/scripts/sop-checklist-gate.py \ + python3 .gitea/scripts/sop-checklist.py \ --owner "$OWNER" \ --repo "$REPO_NAME" \ --pr "$PR_NUMBER" \ -- 2.45.2