Files
hermes-agent/.github/workflows/label-rerun.yml
ethernet 059efe8b29 ci: replace the ci-reviewed label gate with CODEOWNERS
Path-based review (workflows, composite actions, eslint/prettier config,
the MCP catalog, install-hook files) moves to .github/CODEOWNERS. GitHub
requests and enforces that review, so CI no longer classifies those paths,
checks a label, or reruns failed jobs when the label is added.

Removes review-labels.yml, emit_review_status.py, the rerun-review-labels
job, and the ci_review / ci_review_files / mcp_catalog classifier outputs.
The run-e2e rerun job in label-rerun.yml stays.

The supply-chain scan keeps its content patterns (base64 decode + exec,
obfuscated subprocess), which CODEOWNERS cannot express. It fails on its
own again, as it did before #68833 routed it through the label gate. Its
.pth and install-hook path checks are dropped in favour of CODEOWNERS.
2026-10-02 15:22:49 -04:00

69 lines
2.7 KiB
YAML

name: Label rerun
# When the ``run-e2e`` label is added, rerun the head commit's CI, Docker and
# Nix runs in full. Their ``detect`` job reads the PR's labels through the API
# (a rerun replays the original event payload), so the rerun turns every slow
# lane on (scripts/ci/classify_changes.py).
#
# The review comment updates without help. The poller in
# ci-review-comment.yml watches the CI run through the API. It gets the
# rerun results.
on:
pull_request:
types: [labeled]
permissions:
actions: write
pull-requests: read
concurrency:
group: label-rerun-${{ github.event.pull_request.number }}-${{ github.event.label.name }}
cancel-in-progress: true
jobs:
rerun-with-e2e:
name: Rerun CI with every E2E lane
if: github.event.label.name == 'run-e2e'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Cancel and rerun the head commit's CI, Docker and Nix runs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR: ${{ github.event.pull_request.number }}
run: |
set -uo pipefail
for workflow in ci.yaml docker.yml nix.yml; do
RUN_ID=$(gh run list --repo "$REPO" --commit "$HEAD_SHA" --workflow "$workflow" \
--event pull_request --limit 1 --json databaseId --jq '.[0].databaseId // empty' || true)
if [ -z "$RUN_ID" ]; then
echo "$workflow: no run for $HEAD_SHA"
continue
fi
# A run in progress was classified without the label: stop it,
# then rerun it once GitHub marks it completed.
STATUS=$(gh run view "$RUN_ID" --repo "$REPO" --json status --jq .status || echo unknown)
if [ "$STATUS" != completed ]; then
gh run cancel "$RUN_ID" --repo "$REPO" || true
for _ in $(seq 60); do
STATUS=$(gh run view "$RUN_ID" --repo "$REPO" --json status --jq .status || echo unknown)
[ "$STATUS" = completed ] && break
sleep 5
done
fi
# Same supersede guard as above: never rerun a run for an old head.
CURRENT_HEAD=$(gh pr view "$PR" --repo "$REPO" --json headRefOid --jq .headRefOid || true)
if [ "$CURRENT_HEAD" != "$HEAD_SHA" ]; then
echo "PR head moved to $CURRENT_HEAD; not rerunning superseded $workflow run $RUN_ID."
exit 0
fi
if gh run rerun "$RUN_ID" --repo "$REPO"; then
echo "$workflow: rerunning $RUN_ID"
else
echo "::warning::$workflow: could not rerun $RUN_ID (status $STATUS)"
fi
done