← Back to Pull requests

image trust show: add --format option #30400

Open
unknown opened this pull request with 181 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 30, 2026 10:48 UTC
Author

Summary

Add a --format option to podman image trust show, so users can select
and template the fields they need, the way other structured-output commands
already allow.

Fixes #30193

Changes

  • cmd/podman/images/trust_show.go

  • - New --format flag, with shell completion from trust.Policy.
    - --format accepts a Go template, the table prefix (headers), or json.
    - --format json uses the same code path as --json, so the output is identical.
    - --format cannot be combined with --json or --raw. Both combinations
    return an error. Existing --raw / --json precedence is unchanged.
    - Headers are now built from trust.Policy instead of imageReporter.
    Override keys are unchanged, so the default output is the same.
  • docs/source/markdown/podman-image-trust.1.md.in

  • - Documents --format, the placeholder list, and an example.
  • hack/xref-helpmsgs-manpages

  • - image-trust .Keys added to Format_Exceptions. .Keys is part of
    trust.Policy but is never populated by image trust show.
    - --format is dropped from the shared set section of the man page,
    because set does not accept --format.
  • test/e2e/trust_test.go: new cases for Go template output, json vs --json

  • parity, table headers, -n with table, the two flag-conflict errors, an
    unknown-field template error, and an invalid template error.
  • test/system/750-trust.bats: matching system test cases.
  • Diff: 181 lines (+135 / -46) across 2 files Reviewer: ajoshua2004 Review duration: 6713m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 181 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.311
    Real PR Conversation Timeline
    1 comments
    "Review active on #30400"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 35.6% (MEDIUM) · Higher = larger blast radius
    35.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.0% · Safe to merge
    19.0%