Skip to content

fix(ci): the Trivy check of a pull request finds its configuration #7374

Not planned

Description

@dan-petty

Problem

The code scanning check Trivy of each pull request ends as neutral with the title "1 configuration not found". GitHub says that it cannot determine the alerts that the pull request introduces, because the configuration trivy-image-devcontainer of release.yml is present on main and no run of a pull request uploads it. So the check does not compare the Trivy alerts of a pull request with main.

Evidence

  • Pull requests 7373, 7361 and 7352: the check run Trivy of the app github-advanced-security has the conclusion neutral and the title "1 configuration not found". Its summary names the workflow release.yml and the configuration trivy-image-devcontainer.
  • Command: devops gh api "repos/dan-petty/devops-cli/commits/<head sha>/check-runs?per_page=100" --jq '.check_runs[] | select(.name=="Trivy") | {conclusion, title: .output.title}'.

Acceptance criteria

  • The check Trivy of a pull request ends as success or failure, and it names the alerts that the pull request introduces.
  • Each code scanning configuration that main uploads has a run on a pull request, or main uploads no configuration that a pull request cannot upload.

Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches found only Trivy SARIF pipeline examples, not a tool that reconciles per-workflow code-scanning configurations; the fix is to upload the same configuration on pull requests or stop uploading it on main.

Lacks:

  • A pull-request run for every configuration that main uploads
  • A configuration name shared by main and pull-request runs
  • Automatic comparison of pull-request alerts against main

Proposed design

Problem statement

The code scanning check Trivy of a pull request ends as neutral with the title "1 configuration not found". main uploads code scanning configurations that no pull-request run uploads. The workflow devcontainer-image.yml already uploads trivy-image-devcontainer on a pull request that changes a devcontainer input (#6903). The release image configurations trivy-image-service, trivy-image-runner and trivy-image-mcp-server have no analysis on a pull request. The pull-request container job of ci.yml builds those images. The change uploads the SARIF of each image that the job builds under the release category, so GitHub compares their alerts with main.

Acceptance criteria

Requirement: Each image of the pull request gets a code scanning analysis

The pull-request workflow SHALL scan each container image that it builds and SHALL upload the SARIF under the category that release.yml uses for that image.

Scenario: The analyses of a pull request

  • WHEN a person runs devops gh api "repos/dan-petty/devops-cli/code-scanning/analyses?ref=refs/pull/<number>/merge&per_page=100" --jq '.[].category' for an open pull request after the merge
  • THEN the output holds trivy-image-service, trivy-image-runner and trivy-image-mcp-server

Requirement: No DevContainer Image job on a source-only pull request

The pull-request workflows MUST NOT start a job of devcontainer-image.yml for a pull request that changes only files under src/.

Scenario: A source-only pull request

  • WHEN a person runs devops gh api "repos/dan-petty/devops-cli/actions/runs/<run id>/jobs?per_page=100" --jq '.jobs[].name' for the run of a pull request that changes only src/ files after the merge
  • THEN the output holds no job name of devcontainer-image.yml

Requirement: The changed workflows pass the workflow checks

The changed workflow files MUST pass the workflow checks of the project.

Scenario: The workflow checks

  • WHEN a person runs uv run devops ci --check --only actionlint,zizmor on the branch of this change
  • THEN the command exits 0 and reports no error

Existing Tool Considered

The alternatives check of 2026-11-27 in the issue body records the verdict none with no tool. It found no open, maintained tool that reconciles the code scanning configurations of the workflows. The change builds no code and no image. It adds a scan and an upload to a job that already builds each image, so the cost is the scan time of each image. The change gives each pull-request run a configuration for an image, under the category that main uses, and GitHub itself compares the alerts.

Key questions

  • Does a pull request already upload the code scanning configuration trivy-image-devcontainer?: Yes. .github/workflows/devcontainer-image.yml scans the devcontainer image and uploads the SARIF under the category trivy-image-devcontainer on a pull request that changes a devcontainer input (ci(security): scan devcontainer image and rescan daily #6903). Owner decision O2 stops every job of that workflow on a pull request that changes only src/ files. [sources: .github/workflows/devcontainer-image.yml, openspec/specs/ci-devcontainer-image/spec.md]
  • Which code scanning configurations does main upload that a pull-request run does not upload?: release.yml uploads trivy-image-service, trivy-image-runner, trivy-image-mcp-server, trivy-image-uv-seed and trivy-image-devcontainer. A pull request uploads only trivy-image-devcontainer, and only when a devcontainer input changes. Pull requests 6964 and 6941 reported three configurations not found for service, runner and mcp-server. [sources: .github/workflows/release.yml, .github/workflows/ci.yml, openspec/specs/container-image-layers/spec.md]
  • How does a pull request produce the analysis of an image without a new build?: The pull-request container job of ci.yml scans each image that it already builds and uploads the SARIF under the release category of that image. The job already builds the container images in the Docker Engine of the runner. (best practice) [sources: .github/workflows/ci.yml, .github/actions/image-scan/action.yml, openspec/specs/container-image-layers/spec.md]
    • Chosen: Scan the image that the pull-request job builds. The job already builds the image, so the scan adds no build. The category matches the one that main uploads, so GitHub compares the alerts of the two.
    • Rejected: Run the release image jobs on each pull request. release.yml builds each image with the release settings and a 60-minute limit. A pull-request run repeats that build and breaks the 5-minute budget of AGENTS.md rule 5.
    • Rejected: Stop the upload on the default branch. The analyses leave code scanning. Only the owner can allow a lower security threshold (AGENTS.md rule 5, SECURITY.md).
  • Which category name does each pull-request upload use?: The category that release.yml uses for the same image: trivy-image-service, trivy-image-runner and trivy-image-mcp-server. (best practice) [sources: .github/workflows/release.yml, AGENTS.md]
    • Chosen: Reuse the release category. GitHub compares a pull request with the most recent analysis of the same category on the default branch. A shared name makes the comparison.
    • Rejected: Use a pull-request-only name. The check reports the main configuration as missing, and the comparison does not happen.
  • Does the devcontainer configuration also upload on a pull request that changes only src/ files?: No. Owner decision O2 in openspec/specs/ci-devcontainer-image/spec.md stops every job of devcontainer-image.yml on such a pull request. The last 10 successful runs averaged 365.8 s (257 s to 439 s), over the 360 s limit of AGENTS.md rule 5. The remaining configuration goes to a new issue. (best practice) [sources: openspec/specs/ci-devcontainer-image/spec.md, AGENTS.md]
    • Chosen: Keep the current behavior. Owner decision O2 and the 360 s limit of rule 5 forbid a devcontainer run on every pull request.
    • Rejected: Run devcontainer-image.yml on every pull request. It contradicts O2, and the average of 365.8 s breaks the 360 s limit of rule 5.
    • Rejected: Scan the published devcontainer image on each pull request. The published image is the last release, not the image of the pull request. The analysis would hide an alert that the pull request introduces.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#7654

Activity

  1. added
    type/bug
    on Nov 27, 2026
  2. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor
  3. added
    scope/ci
    source/agent
    status/new
    value/medium
    effort/low
    priority/p2-medium
    on Nov 27, 2026
  4. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (8)

    Searches run:

    • trivy-action upload sarif category code scanning pull request configuration, results: 5
    • Trivy code scanning "1 configuration not found" pull request SARIF, results: 5
    • github code scanning SARIF configuration not found different workflow pull request, results: 5
    • aquasecurity trivy-action sarif category input, results: 5
    • trivy github actions sarif upload, results: 5
    • code scanning configuration not found sarif upload workflow main, results: 5
    • tool to sync code scanning configurations pull request trivy, results: 5
    • upload-sarif category input multiple configurations, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  7. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor

    Cannot build as written: the issue rests on false premises and conflicts with Owner decision O2 (#4658, #4977) and AGENTS.md rule 5. (1) .github/workflows/devcontainer-image.yml already scans and uploads trivy-image-devcontainer on pull requests via scan-upload (#6903, PR #6903) when devcontainer inputs change. (2) Running DevContainer Image on every pull request contradicts Owner decision O2 in openspec/specs/ci-devcontainer-image/spec.md ('A pull request that changes only src/ files SHALL start no job of it') and exceeds the 360 s limit of AGENTS.md rule 5: the last 10 successful pull_request runs of DevContainer Image averaged 365.8 s (runs 46197579960..46107036979: 257 s to 439 s even with registry cache). (3) Uploading only trivy-image-devcontainer when IMAGE_CONTENT_PATHS does not change still leaves the Trivy check neutral with missing ci.yml configurations (e.g. PRs #6964 and #6941 reported '3 configurations not found' for service, runner and mcp-server). An owner decision is needed on whether pull requests and main should align Trivy configuration uploads (or drop PR-only config comparisons) rather than adding an unconditional 6+ minute devcontainer build on every PR.

  8. added
    status/new
    and removed
    status/ready
    on Nov 28, 2026
  9. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  10. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  11. dan-petty commented on Nov 29, 2026

    @dan-petty
    OwnerAuthor

    Closing as not planned (superseded): PRs already scan and upload trivy-image-service, trivy-image-mcp-server, trivy-image-runner, and trivy-image-uv-seed in .github/workflows/ci.yml (#7207, #7241; verified live on PR #7690 code-scanning analyses), and the remaining trivy-image-devcontainer alignment was split to #7654.

  12. removed
    status/ready
    on Nov 29, 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

    effort/lowpriority/p2-mediumscope/cisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions