Skip to content

BUILD-9208 Exclude release and sign profiles during shadow scans#219

Merged
julien-carsique-sonarsource merged 1 commit intomasterfrom
feat/jcarsique/BUILD-9208-notNeededMvnProfiles
Feb 18, 2026
Merged

BUILD-9208 Exclude release and sign profiles during shadow scans#219
julien-carsique-sonarsource merged 1 commit intomasterfrom
feat/jcarsique/BUILD-9208-notNeededMvnProfiles

Conversation

@julien-carsique-sonarsource
Copy link
Contributor

@julien-carsique-sonarsource julien-carsique-sonarsource commented Feb 18, 2026

BUILD-9208 Exclude release and sign profiles during shadow scans

Changes

This PR modifies the build-maven action to exclude the release and sign Maven profiles when run-shadow-scans is enabled.

Shadow scans perform SonarQube analysis on all three platforms (next, sqc-us, sqc-eu) without deploying artifacts. Including release and sign profiles during shadow scans is unnecessary overhead since:

  • No artifacts are being deployed
  • Signing and release preparation activities are irrelevant for analysis-only builds
  • The profiles add unnecessary time to the build process

Implementation

Modified build-maven/build.sh to check RUN_SHADOW_SCANS before adding Maven profiles:

  • Default/maintenance branches: Skip -Prelease,sign when shadow scans are enabled
  • Dogfood branches: Skip -Prelease when shadow scans are enabled

Before (with shadow scans on master):

maven_command_args=("install" "-Pcoverage" "-Prelease,sign")

After (with shadow scans on master):

maven_command_args=("install" "-Pcoverage")

Shadow scans perform analysis without deployment, so release and sign Maven profiles are unnecessary overhead.
This change prevents adding these profiles when RUN_SHADOW_SCANS is enabled, making Maven builds faster and logs cleaner.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Feb 18, 2026

BUILD-9208

@sonarqubecloud
Copy link

@julien-carsique-sonarsource julien-carsique-sonarsource marked this pull request as ready for review February 18, 2026 17:14
@julien-carsique-sonarsource julien-carsique-sonarsource requested a review from a team as a code owner February 18, 2026 17:14
Copilot AI review requested due to automatic review settings February 18, 2026 17:14
Copy link
Contributor

@bwalsh434 bwalsh434 left a comment

Choose a reason for hiding this comment

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

Nice change!

@julien-carsique-sonarsource julien-carsique-sonarsource merged commit 441afc9 into master Feb 18, 2026
18 checks passed
@julien-carsique-sonarsource julien-carsique-sonarsource deleted the feat/jcarsique/BUILD-9208-notNeededMvnProfiles branch February 18, 2026 17:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the build-maven GitHub Action to avoid activating Maven release/sign profiles when RUN_SHADOW_SCANS=true, reducing unnecessary work for analysis-only (non-deploying) shadow scan runs.

Changes:

  • Skip -Prelease,sign on default/maintenance branches during shadow scans.
  • Skip -Prelease on dogfood branches during shadow scans.
  • Add/extend ShellSpec coverage to assert profiles are excluded when shadow scans are enabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
build-maven/build.sh Conditionally omits release/sign profiles when RUN_SHADOW_SCANS=true for relevant branch types.
spec/build-maven_spec.sh Adds test cases validating that shadow scan runs do not include release/sign profiles.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +503 to +505
The output should include "Maven command: mvn install -Pcoverage"
The output should not include "release"
The output should not include "sign"
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The negative assertions are very broad ("release"/"sign" could match unrelated output like a branch name or future log text). To make the test more robust and specifically verify the behavior change, assert that the Maven command line does not contain the profile flags (e.g., "-Prelease,sign" / "-Prelease" / "-Psign") rather than the generic substrings.

Copilot uses AI. Check for mistakes.
Comment on lines +517 to +518
The output should include "Maven command: mvn install"
The output should not include "release"
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

This assertion checks for the substring "release" anywhere in output, which is looser than needed and may become flaky if other log lines/branch names include that word. Prefer asserting the Maven command does not include the profile flag (e.g., "-Prelease").

Copilot uses AI. Check for mistakes.
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.

3 participants