Skip to content

BUILD-9058 reuse BUILD_NUMBER from env#83

Merged
julien-carsique-sonarsource merged 1 commit intomasterfrom
fix/jcarsique/BUILD-9058-buildNumberExport
Sep 10, 2025
Merged

BUILD-9058 reuse BUILD_NUMBER from env#83
julien-carsique-sonarsource merged 1 commit intomasterfrom
fix/jcarsique/BUILD-9058-buildNumberExport

Conversation

@julien-carsique-sonarsource
Copy link
Copy Markdown
Contributor

@julien-carsique-sonarsource julien-carsique-sonarsource commented Sep 8, 2025

BUILD-9058

The GitHub cache used by get-build-number is not reliable and can be desynchronized between two jobs.
To circumvent, this PR makes it possible to pass the BUILD_NUMBER through environment, in which case, the get-build-number action will skip its steps.

Add tests to check for the behavior.

Tested with

@julien-carsique-sonarsource julien-carsique-sonarsource force-pushed the fix/jcarsique/BUILD-9058-buildNumberExport branch 6 times, most recently from b19cf43 to 2b85a52 Compare September 9, 2025 15:56
@julien-carsique-sonarsource julien-carsique-sonarsource force-pushed the fix/jcarsique/BUILD-9058-buildNumberExport branch from 2b85a52 to e910a3f Compare September 9, 2025 16:20
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Sep 9, 2025

🤖 Pull Request summary

Enhances build number action to support environment variable reuse.

Added env variable support: Action now reuses BUILD_NUMBER from environment if present, skipping cache/increment logic
Enhanced testing: Added comprehensive test coverage including stability across calls and environment variable reuse scenarios
Simplified promote action: Removed conditional logic for build number retrieval
Improved job organization: Added summary job using alls-green action to aggregate test results

Review focus: The new environment variable precedence logic and conditional step execution in the composite action - ensure the skip logic properly prevents unnecessary API calls and caching operations.

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@julien-carsique-sonarsource julien-carsique-sonarsource merged commit b9e57db into master Sep 10, 2025
13 checks passed
@julien-carsique-sonarsource julien-carsique-sonarsource deleted the fix/jcarsique/BUILD-9058-buildNumberExport branch September 10, 2025 12:44
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