Commit Graph

3 Commits

Author SHA1 Message Date
alt-glitch
e82a44fcc6 fix(ci): the plugin catalog gate verifies attested binaries
README rule 17 lets a catalog entry ship a native binary listed under
attested_binaries, if `gh attestation verify` proves the plugin repo built it
at the pinned commit. The old inline step fed its parser as
`python3 -I - "$entry" <<PYEOF </dev/null`; the later </dev/null replaced the
heredoc, so the parser ran an empty program, the list always came back empty
and `gh attestation verify` never ran. #151877 moved the step into
scripts/ci/ and kept that dead branch out, so behaviour stayed the same.

The field reader now returns the attested paths beside the clone source and
rejects any that is not a plain relative path. The gate verifies each one
against the entry's repo at the pinned sha, then removes it so the payload
scan ignores it, and any other binary still fails. No catalog entry declares
attested_binaries today, so nothing admitted now changes.
2026-11-09 18:56:58 +05:30
alt-glitch
c042454317 fix(ci): catalog fields cross as JSON; a uv.lock timeout keeps its report
The catalog field reader printed shell assignments and the gate parsed them
back with shlex, a shell layer between two Python programs. It now prints
one JSON object, and the gate rejects the entry unless it gets exactly
REPO, SHA, SUBDIR and BAD as strings.

verify_uv_lock.py let TimeoutExpired escape after 600 s, so the job lost the
attempt's log and published no review status. A timed-out attempt now prints
its partial log, reports "uv.lock check timed out" and stops: retrying three
more 600 s attempts would outlive the job.
2026-11-09 18:32:10 +05:30
alt-glitch
bec4baa051 ci(catalog): plugin-catalog gate steps call scripts instead of inline bash
The two long run: blocks of plugin-catalog-ci.yml move into scripts/ci/,
so the admission gate can be read, tested and run outside a workflow:

- "Find changed catalog entries" (41 lines) ->
  scripts/ci/catalog_changed_entries.py: the merge-commit check, the
  AMRT entry list without removed.yaml, the data-only rule for entry PRs,
  and the files<<__EOF__ block in $GITHUB_OUTPUT.
- "Clone each entry at its pinned sha and validate" (235 lines) ->
  scripts/ci/catalog_validate_pinned_entries.py, with the entry-field
  parser that the step fed to `python3 -I -` on a heredoc now in
  scripts/ci/catalog_entry_fields.py (still run with -I, still evaled
  as shlex-quoted assignments, still reset to "parser failed" when it
  dies).

Both steps run `python3 -I "$GITHUB_WORKSPACE/scripts/ci/<script>"`;
env, error lines, PASS/FAIL lines and exit codes are unchanged. The
attested_binaries block is not carried over: its parser ran with
`<<'PYEOF' </dev/null`, so the later redirect gave python an empty
program, ATTESTED was always empty and no `gh attestation verify` ever
ran. Dropping it keeps today's behaviour (a declared binary still fails
the payload scan).

test_plugin_catalog_ci_confinement.py still runs the workflow step text
(now the script call); every case passes against both the old and the
new workflow. test_catalog_pinned_confinement.py adds a POSIX test of
the confinement rule and the entry-field rejections, since the step
test is Linux-only.
2026-11-09 16:42:47 +05:30