fix(sop-tier-check): add jq fallback inside script #403

Closed
core-devops wants to merge 7 commits from infra/sop-tier-check-jq-script-fallback into main

7 Commits

Author SHA1 Message Date
a6bbc71318 fix(sop-tier-check): add jq fallback inside script + fix job-level continue-on-error
Some checks failed
sop-tier-check / tier-check (pull_request) Failing after 9s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 11s
audit-force-merge / audit (pull_request) Has been skipped
Job-level \`continue-on-error: true\` is not supported in Gitea Actions
(it only works on individual steps). The jq download step can fail when
the runner can't reach GitHub, causing the job to fail and block all PRs.

Fixes:
1. sop-tier-check.sh: adds jq binary download + apt-get fallback at
   script startup. If jq is absent, script self-installs before using it.
   Idempotent — no-op when jq is already present.
2. sop-tier-check.yml: removes invalid job-level \`continue-on-error: true\`.
   The script's internal jq fallback means the job no longer needs it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 06:03:00 +00:00
2beec432a8 fix(gate-check-v3): tier-aware gate verdict computation
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 2s
sop-tier-check / tier-check (pull_request) Failing after 3s
tier:low and tier:high are OR gates — any one positive verdict
is sufficient. The previous implementation required ALL groups to have
positive verdicts, causing INCOMPLETE even when core-devops APPROVED
and core-lead was absent.

Now uses tier-specific logic:
- tier:low / tier:high (OR): any positive = CLEAR
- tier:medium (AND): all positive = CLEAR

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 05:54:27 +00:00
53d801d19a fix(gate-check-v3): add pagination to api_list for comment/review scans
All checks were successful
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
sop-tier-check / tier-check (pull_request) Successful in 8s
Paginate all list endpoints (comments, reviews) to handle PRs with
many comments without missing entries. Uses per_page=100 with page
increment loop, safety-capped at 20 pages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 05:45:12 +00:00
4ac93975f3 fix(gate-check-v3): use submitted_at for review timestamps
All checks were successful
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 9s
sop-tier-check / tier-check (pull_request) Successful in 11s
Gitea reviews use "submitted_at" not "created_at" for when the review
was submitted. The earlier signal_1_comment_scan fix (inherited from
sop-tier-check investigation) already handled this; signal_2 and
signal_3 were missing the same correction.

Fixes KeyError: 'created_at' on PRs with no comments/reviews.
Includes the individual-check-status fix (use "status" not "state").

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 05:35:09 +00:00
73b7b2b033 fix(gate-check-v3): use correct API field for individual check status
All checks were successful
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 11s
sop-tier-check / tier-check (pull_request) Successful in 11s
Gitea Actions API uses "status" (pending/success/failure) not "state"
for individual status entries. The "state" field is null for pending
runs. This caused all_check_statuses to show Python null instead of
"pending" for queued jobs.

Also verified on PR #391 and PR #393 — individual checks now correctly
display "pending" while combined_state is "pending" (CI_PENDING verdict).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 05:32:34 +00:00
f6503b8371 tools/gate-check-v3: MVP automated PR gate detector
All checks were successful
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 10s
sop-tier-check / tier-check (pull_request) Successful in 13s
SOP-6 + CI gate checker for Gitea PRs. Detects:
- Signal 1: Author-aware agent-tag comment scan (tier-aware)
- Signal 2: REQUEST_CHANGES reviews state machine
- Signal 3: Staleness detection (SOP-12)
- Signal 6: CI required-checks awareness

Post `[gate-check-v3] STATUS:` comment on PRs. CLI + Gitea Actions
workflow (cron hourly + PR-triggered).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 05:16:50 +00:00
be7796f99b ci: install jq before sop-tier-check script runs
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 8s
sop-tier-check / tier-check (pull_request) Failing after 8s
Gitea Actions runners (ubuntu-latest) do not bundle jq.
The sop-tier-check script uses jq for all JSON API parsing.
Install jq before the script runs so sop-tier-check can pass.

Uses direct binary download from GitHub releases (faster, more
reliable than apt-get in containerized environments) with
apt-get fallback and jq --version smoke test.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 05:02:59 +00:00