Skip to content

RUST-132 Normalize Cargo version in bump workflow#219

Merged
yassin-kammoun-sonarsource merged 1 commit into
masterfrom
sma/skunk-1662-normalize-cargo-version
Mar 31, 2026
Merged

RUST-132 Normalize Cargo version in bump workflow#219
yassin-kammoun-sonarsource merged 1 commit into
masterfrom
sma/skunk-1662-normalize-cargo-version

Conversation

@sebastien-marichal

Copy link
Copy Markdown
Contributor

Epic: SKUNK-1662

Initial Prompt

This is failing because the version does not contains the PATCH number.
Can you update the job so it handle adding the patch when not present when updating Cargo.toml file?

Summary

Normalize the Cargo manifest version in the bump workflow when the release pipeline provides only a major/minor version.

Changes

  • append .0 before updating analyzer/Cargo.toml when the incoming version matches major.minor
  • emit a GitHub Actions notice when the workflow normalizes the Cargo version

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Normalize Cargo version in bump workflow RUST-132 Normalize Cargo version in bump workflow Mar 31, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

RUST-132

@sebastien-marichal sebastien-marichal marked this pull request as ready for review March 31, 2026 10:06
@sebastien-marichal sebastien-marichal requested a review from a team March 31, 2026 10:06
@sonar-review-alpha

Copy link
Copy Markdown

Summary

Handles missing PATCH component in Cargo version string. The release pipeline sometimes provides only major.minor versions (e.g., '1.2'), but Cargo.toml requires semantic versioning with all three components. This change detects the two-component pattern and appends '.0' before updating the manifest, with a GitHub Actions notice to track when normalization occurs.

What reviewers should know

The only change is in .github/workflows/bump-version.yml (lines 46-52). The regex ^[0-9]+\.[0-9]+$ correctly matches exactly two numeric components and will skip normalization if the version already has a patch component. Verify that the notice message provides adequate visibility for the release team. The change does not affect versions already in major.minor.patch format, so existing releases remain unaffected.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@yassin-kammoun-sonarsource yassin-kammoun-sonarsource enabled auto-merge (squash) March 31, 2026 10:07
@sonarqube-next

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed for 'sonar-rust'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
0 Dependency risks
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube

@yassin-kammoun-sonarsource yassin-kammoun-sonarsource merged commit fb86f6d into master Mar 31, 2026
14 of 15 checks passed
@yassin-kammoun-sonarsource yassin-kammoun-sonarsource deleted the sma/skunk-1662-normalize-cargo-version branch March 31, 2026 10:19
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