Skip to content

fix(ci): ci's trivy scans run the trivy version tools.lock pins, so ci and local scans agree #1499

Closed

Description

@dan-petty

Raised by the owner, 2026-10-09, during the GitHub Actions warnings review.

Problem

Checked at release/v0.2.32 (27cf6bd).

Proposed remedy

  • Set version: v0.75.0 in both trivy-action steps.
  • Add a workflow contract test that reads tools.lock's [binary.trivy].version and fails when any aquasecurity/trivy-action step's version is not v<that version>, so the lock is the single source and a bump fails CI until the workflows match.

Acceptance criteria

  • Both trivy-action steps pass version: v0.75.0.
  • A test fails when a trivy-action step's version differs from tools.lock's Trivy version, and passes now.
  • The Service image scan passes on the PR (ci.yml's Service Image job runs for it).

Activity

  1. added
    type/bug
    scope/ci
    on Oct 9, 2026
  2. added this to the v0.2.32 milestone on Oct 9, 2026
  3. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Placed in v0.2.32 by the owner, 2026-10-09.

  4. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item kept in v0.2.32: a person placed it in v0.2.32, and that placement stands.

    • Priority: P2-Medium. CI and local security scans silently disagree on scanner version, undermining trust in scan results, but nothing is actively broken.
    • Value: Medium. Consistent scanner versions between CI and local ensure reproducible vulnerability results and prevent silent drift on future bumps.
    • Effort: Low. Change two version strings in workflow YAML and add a small contract test that reads tools.lock and compares.
  5. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    Admitted to v0.2.32: an open or merged pull request is in flight for it. (devops roadmap reprioritize)

  6. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1503, merged into release/v0.2.32 as 3be8c3a.

    Summary

    • The Service Image scan's aquasecurity/trivy-action step in both .github/workflows/ci.yml and .github/workflows/release.yml now passes version: v0.75.0 instead of v0.70.0. That is the Trivy tools.lock pins for devops install-tools, so CI and local scans run the same scanner. The action SHA (ed142fd0, v0.36.0) is unchanged.
    • New workflow contract test test_every_trivy_scan_runs_the_trivy_tools_lock_pins (tests/test_workflow_contracts.py). It reads [binary.trivy].version from tools.lock and asserts the exact (workflow, job, version) list of every trivy-action step. Any drift, a missing version, or the steps disappearing all fail CI, and the failure names the workflow and job. tools.lock becomes the single source for Trivy's version.
    • tools.lock header (comment only): the binary bump procedure now says Trivy's version is also every trivy-action step's version, and its test command includes tests/test_workflow_contracts.py. This changes tools_lock_digest() once; nothing pins that value.
    • changelog.d/1499.md (Fixed) and the task file docs/agent/tasks/task-1499-ci-trivy-scans-run-the-tools-lock-version.md.
    • Overlap with refactor(release): the release no longer pins, bumps or pre-publishes the service image tag; image updater rolls service:latest #1486: it removes the trivy step's if: in release.yml and the release-PR skip in ci.yml, and keeps the job id and the version: line. The two merge cleanly in either order; the new test keeps v0.75.0 whichever lands second.
    • Overlap with fix(ci): ci jobs run on a named ubuntu-24.04 runner and always use uv's managed python, never the runner's own python #1494: it edits runs-on and env lines in the same two workflow…

    6 file(s) changed.

    How it was verified

    Check runs at 7a0f24f:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1499-ci-trivy-scans-run-the-tools-lock-version.md:

    • Both trivy-action steps pass version: v0.75.0 (ci.yml, release.yml).

    • test_every_trivy_scan_runs_the_trivy_tools_lock_pins in tests/test_workflow_contracts.py failed on the unfixed tree with v0.70.0 against 0.75.0, and passes now.

    • Pending a person: the Service image scan with Trivy v0.75.0. An item PR into release/v0.2.32 does not run ci.yml's Service Image job (it needs base_ref == main or workflow_dispatch). Run:

      1. gh workflow run ci.yml --ref fix/1499-ci-trivy-version-from-tools-lock
      2. gh run list --workflow ci.yml --branch fix/1499-ci-trivy-version-from-tools-lock --event workflow_dispatch --limit 1
      3. gh run watch <id>

      In the Service Image job, the "Scan Service Image for Vulnerabilities" step must install Trivy v0.75.0 and pass. Once refactor(release): the release no longer pins, bumps or pre-publishes the service image tag; image updater rolls service:latest #1486 has removed the release-PR skip, the v0.2.32 release PR into main runs the same scan by itself.

  7. added a commit that references this issue on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope/citype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions