Skip to content

fix(catalog-update): capture attestation evidence (--format json) - #25

Merged
zircote merged 4 commits into
mainfrom
fix/verify-evidence-capture
Jun 23, 2026
Merged

fix(catalog-update): capture attestation evidence (--format json)#25
zircote merged 4 commits into
mainfrom
fix/verify-evidence-capture

Conversation

@zircote

@zircote zircote commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The re-pin PR body's <details> raw-evidence block came out empty on the live run (PR #6). Root cause: gh attestation verify suppresses its human-readable summary when stdout is not a TTY (headless CI), so stdout+stderr were both empty even on success.

Fix: verify with --format json (which does write to stdout) and distil it via _summarize_verify into predicate / signer / issuer; fall back to stderr on failure (which carries the error). Verified locally against attested-delivery-0.1.1.tar.gz — the block now shows the signer attest-release.yml@refs/tags/v0.1.1. The next real re-pin PR will carry populated evidence. +2 unit tests (21→23).

gh attestation verify suppresses its human-readable summary when stdout is not a
TTY (headless CI), so the PR body's raw-evidence block came out empty. Verify with
--format json and distil predicate/signer/issuer via _summarize_verify; fall back
to stderr on failure. +2 unit tests (21->23).
Copilot AI review requested due to automatic review settings June 23, 2026 03:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes empty “raw evidence” blocks in catalog update PR bodies by switching gh attestation verify to emit JSON in CI (non-TTY) and summarizing that JSON into a compact predicate/signer/issuer evidence snippet.

Changes:

  • Add _summarize_verify() to distill gh attestation verify --format json output into a readable evidence block.
  • Update verify_subject() to call gh attestation verify ... --format json and use summarized output on success (stderr fallback on failure).
  • Add unit tests for _summarize_verify() (21 → 23 tests).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/actions/plugin-catalog-update/catalog_update.py Switch verification to --format json, add summarization helper, and adjust evidence capture behavior in CI.
.github/actions/plugin-catalog-update/test_catalog_update.py Add tests validating summarization output and non-JSON fallback behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/actions/plugin-catalog-update/catalog_update.py Outdated
Comment thread .github/actions/plugin-catalog-update/catalog_update.py
…t json in re-verify cmds

- _summarize_verify falls back to raw output on a non-list / unexpected shape and
  on an empty result (never a blank evidence block); skips non-dict records.
- render_pr_body's re-verify commands include --format json so they produce
  evidence in non-TTY contexts too (Copilot review). +3 tests.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread .github/actions/plugin-catalog-update/catalog_update.py Outdated
Comment thread .github/actions/plugin-catalog-update/test_catalog_update.py
…rify

A truthy non-dict nested value (e.g. verificationResult: "x") slipped past the
`or {}` guard and crashed on .get(). Guard every nested access with isinstance
via _d(); malformed records are skipped and fall back to raw. +1 regression test.
…failing test)

A dict verificationResult with junk nested values produced a useless '?'-only
block instead of falling back. Skip a record unless a predicate/signer/issuer is
actually extracted; then both non-dict and junk-dict shapes fall back to raw.
Fixes the regression test that failed in the prior commit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@zircote
zircote merged commit 508aa7a into main Jun 23, 2026
@zircote
zircote deleted the fix/verify-evidence-capture branch June 23, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants