Skip to content

CLP-996 Split build from analysis for sonar-xml - #588

Open
guillaume-dequenne wants to merge 1 commit into
masterfrom
CLP-897
Open

guillaume-dequenne wants to merge 1 commit into
masterfrom
CLP-897

Conversation

@guillaume-dequenne

@guillaume-dequenne guillaume-dequenne commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Part of CLP-897

Summary

  • Split the Maven build/deploy producer from the NEXT analysis consumer.
  • Upload the Maven target outputs as a seven-day artifact and restore them for analysis.
  • Reuse the same build number and Maven scan configuration.
  • Keep promotion and releasability gated by the analysis job.

Dependency

Validation

  • Verified v2 and release 2.3.0 point to the merged skip-build action commit.
  • Ran git diff --check after replacing the action pin.

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Split build from analysis for sonar-xml CLP-996 Split build from analysis for sonar-xml Sep 23, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

CLP-996

@sonarqube-next

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 7 days with no activity. If there is no activity in the next 7 days it will be closed automatically

Comment thread .github/workflows/build.yml Outdated
with:
name: build-output-${{ steps.build.outputs.BUILD_NUMBER }}
path: '**/target'
retention-days: 3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 3? It's fairly cheap - I'd add at least 7. Sometimes we leave PRs in the side then rerun them. Better if the artifact is cached.

Comment thread .github/workflows/build.yml Outdated
sonar-platform: none
maven-args: -Pcoverage

- name: Upload build output for scanning

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Upload build output for scanning
- name: Upload plugin build as pipeline artifact

Comment thread .github/workflows/build.yml Outdated
with:
build-version: ${{ steps.build.outputs.project-version }}

scan:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

analysis:

Comment thread .github/workflows/build.yml Outdated
build-version: ${{ steps.build.outputs.project-version }}

scan:
name: Scan

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: Scan
name: Analysis

Maybe can also be renamed as "NEXT analysis" or "SonarQube Cloud analysis" based on what the repo is using. WDYT?

Comment thread .github/workflows/build.yml Outdated
skip-build: true
sonar-platform: next
artifactory-reader-role: private-reader
artifactory-deployer-role: qa-deployer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has no effect I think.
We can remove it.

Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Keep build, tests, coverage, and deployment in the producer job. Upload the target directories for a scanner-only analysis job that can be rerun independently, and gate promotion on its result.
@sonarqube-next

sonarqube-next Bot commented Oct 5, 2026

Copy link
Copy Markdown

@gitar-bot

gitar-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🟡 Medium risk · Splitting Maven build and NEXT analysis changes CI artifact flow and promotion gating.

Splits Maven build from NEXT analysis into separate CI jobs, with build outputs uploaded as seven-day artifacts for restoration during analysis. Addressed the analysis job's outdated mise version pin and resolved the action version mismatch between producer (@v1) and consumer (@v2) noted in the dependency section.

✅ 2 closed
✅ Quality: Analysis job pins older mise version (2026.9.11) than other jobs

📄 .github/workflows/build.yml:68-70 📄 .github/workflows/build.yml:29-31 📄 .github/workflows/build.yml:97-99 📄 .github/workflows/build.yml:148-150
The new analysis job sets jdx/mise-action to version: 2026.9.11. Every other job in this workflow (build, build-win, qa) and unified-dogfooding.yml use 2026.9.14. The PR says analysis reuses the build job's configuration, but here it gets its toolchain from an older mise release than the job that produced the target/ outputs it scans. This looks like a leftover from before the bump on master. Align it with the other jobs.

✅ Cross-PR: Analysis pin's re-pin note targets @v1 while #598 moves repo to @v2

📄 .github/workflows/build.yml:74 📄 .github/workflows/build.yml:32
This only applies if both PRs merge, in either order: this PR (sonar-xml#588, head 3b5529b) and #598 (head 32a5413), which bumps every SonarSource/ci-github-actions/*@v1 reference in build.yml to @v2.

The analysis job is pinned to commit 62463382…, so #598's blanket text bump does not touch it. That pin is correct, because neither v1 nor v2 has skip-build yet. The problem is the inline comment, and this PR's description: both say to "re-pin when skip-build reaches @v1". Once #598 lands, the build, build-win, qa and promote jobs all use @v2. Following that instruction would move only the analysis job back to the v1 line, so the producer job and the consumer job would run different major versions of build-maven.

Whichever PR merges second has to reconcile this. #598's own description lists line numbers from the pre-split file layout (e.g. line 64), which no longer match after this PR restructures build.yml.

Review coverage

🧪 Functional validation 3 of 3 objectives covered

📋 Rules No rules evaluated

🤖 Auto-approval Not enabled · Set up

Implementation Status ✅ 3 of 3 objectives covered
✅ CLP-897 - 3 of 3 objectives covered

This PR covers splitting the build and analysis jobs by creating a producer job that uploads the build artifact and a consumer analysis job that downloads it.

✅ 3 covered here
  • ✅ Split the build/package job from the analysis job
  • ✅ Create a producer job that handles build, test, and package, and uploads the result as an artifact
  • ✅ Create a consumer job that downloads the artifact and runs the analysis
Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants