Skip to content

ci(code_quality): Qodana scan fails so upload-sarif is skipped — SARIF has never actually been uploaded #138

Description

@kploch

Problem

.github/workflows/code_quality.yml has never successfully uploaded SARIF. On its only recorded run, step 3 Qodana Scan failed and step 4 upload-sarif was skipped — the upload step has no if: always(), so it never executes when the scan fails.

That has two consequences:

  1. Code scanning has no data from this workflow. The scan result never reaches GitHub.
  2. The action version is unvalidatable. Both the outgoing v3.28.18 pin and the incoming v4.37.8 pin (PR chore(deps): bump github/codeql-action/upload-sarif from 3.28.18 to 4.37.8 #132) are equally unexercised — the last recorded run used actions/checkout@v3 and upload-sarif@v2, predating both. There is no baseline behaviour to regress from.

This makes "verify after merging #132 with one manual dispatch" inconclusive rather than merely imprecise: a post-merge dispatch that fails at Qodana again will skip the upload step again and produce zero evidence.

Suggested fix

Two independent changes, both worth making:

  • Fix the Qodana step so the scan itself succeeds. Candidates: the QODANA_TOKEN_1681345019 secret wiring (corrected in ci: Pin actions to SHAs, use sonar.token, justify continue-on-error #125) and the --baseline,./qodana.sarif.json argument, which points at a file that may not exist on a first run.
  • Add if: always() to the upload-sarif step so a failed scan still uploads whatever SARIF was produced, and the step's own behaviour becomes observable.

The loop only closes when upload-sarif has actually run to completion at least once. Until then, treat the codeql-action version in this workflow as unverified regardless of how many times it is dispatched.

Also worth knowing

  • 4.37.8 is already superseded — the upstream CHANGELOG records 4.37.9 (26 Aug 2026), so merging chore(deps): bump github/codeql-action/upload-sarif from 3.28.18 to 4.37.8 #132 will be followed by another Dependabot PR for the same action shortly. Non-blocking.
  • The node24 runtime in codeql-action v4 is fine for us — every job in this workflow uses runs-on: ubuntu-latest. It would be a hard break on a self-hosted runner older than 2.327.x, worth remembering if this workflow ever moves off GitHub-hosted runners.
  • Dependabot's diff also strips the UTF-8 BOM from line 1 of the file. Harmless (YAML 1.2 permits a leading BOM and Actions parses both), but it means the PR touches a line unrelated to the dependency.

Context

Found during an adversarial review of Dependabot PR #132. Independently confirmed: the upload-sarif action interface is unchanged across the bump (zero inputs removed, renamed, or re-defaulted), and the repo passes only sarif_file, which is untouched. The bump itself is safe; the problem is that nothing here is being validated at all.

Refs #132, #93

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions