Skip to content

Adopt sonarcloud stub's JDK-21 step + checkout v6.0.3 into standards (clears remaining template-drift; no downgrades) #793

Closed

Description

@don-petry

Context

template-drift is RED on petry-projects/.github-private (job "Check repo-template
stubs have not drifted from standards/"), which blocks the pr-review agent from
auto-approving dev-lead PRs there (it skips any red CI). Three stubs drift;
pr-review-mention.yml was reconciled by #792. This issue clears the remaining
sonarcloud.yml drift at the standards source; the companion re-seed is
combsmith/.github-private#1325.

A blind re-seed can't fix sonarcloud.yml: the deployed stub is ahead of these
standards
and re-seeding would revert real improvements (dev-lead correctly
declined to do that on #1325). The fix per the drift check's own rule ("edit
standards/, then re-seed") is to bring these standards up to the stub's current
functional state — no downgrades.

Change — standards/workflows/sonarcloud.yml

Adopt, from the live stub
(petry-projects/.github-private .github/workflows/sonarcloud.yml@main), the two
things the stub has and standards lacks:

  1. Add the JDK setup step the stub runs before the scan:
    - name: Set up JDK 21
      id: setup_java
      uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
      with:
        distribution: temurin
        java-version: '21'
    Place it after checkout and before the SonarCloud scan step, matching the stub.
  2. Bump the checkout pin actions/checkout v6.0.2
    (de0fac2e4500dabe0009e67214ff5f5447ce83dd) → v6.0.3
    (df4cb1c069e1874edd31b4311f1884172cec0e10), matching the stub's Dependabot pin.

Keep the standards' SOURCE-OF-TRUTH header, permissions: {}, and scan
retry/guard logic. Do not downgrade any action pin.

copilot-setup-steps.yml needs no standards change — its only stub drift is
missing documentation comments that a re-seed restores (checkout is identical
v6.0.2, no functional/version delta). It is handled by the re-seed in #1325.

Ordering

BLOCKS combsmith/.github-private#1325 (the re-seed). #1325 must run only
after this merges, or re-seeding sonarcloud.yml will strip the JDK step /
downgrade checkout.

Acceptance criteria

  • standards/workflows/sonarcloud.yml includes the JDK 21 setup step and checkout
    v6.0.3; no other behavioral change; no pin downgrades.
  • After this + the Restore initial PR review triggering in the standard pr-review caller #1325 re-seed, .github-private's template-drift job is GREEN
    and the deployed sonarcloud.yml stub retains its JDK step and v6.0.3 pin.
  • Fails closed: no step silently reports success on a fetch/parse failure.

Activity

  1. don-petry commented on Jul 19, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead Implementation Plan

    Issue: #793 — Adopt sonarcloud stub's JDK-21 step + checkout v6.0.3 into standards (clears remaining template-drift; no downgrades)

    Scope

    Bring standards/workflows/sonarcloud.yml up to the live stub's functional state: add the JDK 21 setup step before the SonarCloud scan and bump actions/checkout from v6.0.2 → v6.0.3. No pin downgrades, no other behavioral change.

    Implementation Checklist

    • standards/workflows/sonarcloud.yml: bump actions/checkout pin de0fac2e4500dabe0009e67214ff5f5447ce83dd (v6.0.2) → df4cb1c069e1874edd31b4311f1884172cec0e10 (v6.0.3)
    • standards/workflows/sonarcloud.yml: add Set up JDK 21 step (actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0, temurin, java-version '21') after checkout and before the SonarCloud Scan step
    • Preserve SOURCE-OF-TRUTH header, permissions: {}, per-job least privilege, scan retry/guard logic; keep SonarSource scan pin unchanged (no downgrade)

    Tests to Write

    • No repo-side unit tests exist for workflow-template contents (the template-drift check lives in .github-private). Per the Phase 2 TDD exception this is a configuration change to a workflow template; verification is via yamllint + actionlint (the checks CI runs against standards/workflows/) and dev-lead-lint.sh.
    • SHAs verified via GitHub API: setup-java v5.2.0 = be666c2fcd27ec809703dec50e508c2fdc7f6654; checkout v6.0.3 (annotated tag) → commit df4cb1c069e1874edd31b4311f1884172cec0e10.

    Test Command

    bash .dev-lead/scripts/dev-lead-lint.sh plus yamllint/actionlint on standards/workflows/sonarcloud.yml (mirrors ci.yml).

  2. don-petry commented on Jul 19, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    • Bumped actions/checkout pin v6.0.2 (de0fac2…) → v6.0.3 (df4cb1c069e1874edd31b4311f1884172cec0e10)
    • Added Set up JDK 21 step (actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0, temurin, java-version '21') after checkout and before the SonarCloud Scan step
    • Preserved SOURCE-OF-TRUTH header, permissions: {}, per-job least privilege, and the scan retry/guard logic; SonarSource scan pin unchanged (no downgrade)

    SHA verification (GitHub API, per standard — never guessed)

    • actions/setup-java v5.2.0 → be666c2fcd27ec809703dec50e508c2fdc7f6654
    • actions/checkout v6.0.3 (annotated tag 9f69817…) → commit df4cb1c069e1874edd31b4311f1884172cec0e10

    Test Results

    No repo-side unit tests exist for workflow-template contents (the template-drift check lives in .github-private); per the Phase 2 TDD exception this is a behavior-preserving workflow-template configuration change. Verified with the same checks CI runs against standards/workflows/:

    === yamllint (ci.yml config: line-length max 200, truthy check-keys false, document-start disabled) ===
    yamllint: PASS
    === dev-lead-lint (.dev-lead/scripts/dev-lead-lint.sh) ===
      [lint] shellcheck on 24 file(s)...
      [lint] validating .github/CODEOWNERS...
    OK: .github/CODEOWNERS
      [lint] all checks passed
    

    (actionlint is not installed on this runner; CI runs it against templates informationally with -ignore 'context' … || true.)

    Diff

    diff --git a/standards/workflows/sonarcloud.yml b/standards/workflows/sonarcloud.yml
    index 130f1e3..afc0ddc 100644
    --- a/standards/workflows/sonarcloud.yml
    +++ b/standards/workflows/sonarcloud.yml
    @@ -38,9 +38,15 @@ jobs:
           SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
         steps:
           - name: Checkout repository
    -        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
    +        uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
             with:
               fetch-depth: 0
    +      - name: Set up JDK 21
    +        id: setup_java
    +        uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
    +        with:
    +          distribution: temurin
    +          java-version: '21'
           - name: SonarCloud Scan
             id: sonar
             if: env.SONAR_TOKEN != ''

    Files Changed

    • standards/workflows/sonarcloud.yml: checkout pin v6.0.2 → v6.0.3; added JDK 21 setup step before the SonarCloud scan.

    Notes

    • No pin downgrades: the SonarSource/sonarqube-scan-action pin is untouched.
    • Fails closed: the JDK step and the retry step both lack continue-on-error, so a JDK-setup or a second-attempt scan failure fails the job — no silent success on fetch/parse failure.
    • copilot-setup-steps.yml intentionally not touched — per the issue its only drift is missing doc comments restored by the re-seed (Restore initial PR review triggering in the standard pr-review caller #1325), no functional/version delta.
    • standards/ci-standards.md's illustrative snippet already documents checkout v6.0.3 (line 526); it is a pattern illustration (already divergent on the scan-action version) and out of scope for this issue, so left unchanged.
    • Ordering: this BLOCKS .github-private#1325 (the re-seed), which must run only after this merges.
  3. added a commit that references this issue on Jul 19, 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

    dev-leadFor dev-lead agent pickup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions