Skip to content

SONARJAVA-6276 Use mise action to install Maven if needed#138

Merged
tomasz-tylenda-sonarsource merged 2 commits intomasterfrom
tt/bump-version-mise
Apr 24, 2026
Merged

SONARJAVA-6276 Use mise action to install Maven if needed#138
tomasz-tylenda-sonarsource merged 2 commits intomasterfrom
tt/bump-version-mise

Conversation

@tomasz-tylenda-sonarsource
Copy link
Copy Markdown
Contributor

@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource commented Apr 23, 2026

@sonar-review-alpha
Copy link
Copy Markdown

sonar-review-alpha Bot commented Apr 23, 2026

Summary

This PR ensures Maven is installed when using the bump-version action with tool: maven. It adds a mise-action step to install Maven and JDK based on the calling repository's mise.toml configuration. A validation check was added to fail early if mise.toml is missing when Maven is requested. The author's workflow tests show that Maven is now available during the version bump operation.

What reviewers should know

Key changes in action.yml:

  • New validation step (lines 28-37) checks for mise.toml when tool == 'maven' — this prevents confusing errors downstream if the file is missing
  • New mise-action step (lines 39-43) runs after validation to install Maven/JDK from the specified mise.toml
  • Both conditional steps only run when tool == 'maven', so non-Maven workflows are unaffected

Review notes:

  • The mise-action version (2026.3.13) is pinned with a commit hash for reproducibility
  • The check passes if mise.toml exists anywhere in the repository root (standard mise behavior)
  • Callers must ensure their mise.toml includes maven and a JDK; mise-action will install both before the bump runs

  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

Copy link
Copy Markdown

@sonar-review-alpha sonar-review-alpha Bot left a comment

Choose a reason for hiding this comment

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

The approach is sound and the action is correctly pinned (SHA + version comment, consistent with repo conventions). One open question about the mise.toml failure mode needs clarification before this can be approved.

🗣️ Give feedback

Comment thread bump-version/action.yml
Comment thread bump-version/README.md
@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource changed the title Use mise action to Install Maven if needed. SONARJAVA-6276 Use mise action to Install Maven if needed. Apr 23, 2026
@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod Bot commented Apr 23, 2026

SONARJAVA-6276

Copy link
Copy Markdown
Contributor

@nils-werner-sonarsource nils-werner-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM! Have a look at the comment of the review bot. I think it's a valid point to inform why the run crashes because mise.toml is not available in the repository you are running on.

@sonarqubecloud
Copy link
Copy Markdown

@tomasz-tylenda-sonarsource
Copy link
Copy Markdown
Contributor Author

LGTM! Have a look at the comment of the review bot. I think it's a valid point to inform why the run crashes because mise.toml is not available in the repository you are running on.

Added and tested: https://github.com/SonarSource/sonar-java/actions/runs/24883394793/job/72857275953#step:3:94

Copy link
Copy Markdown

@sonar-review-alpha sonar-review-alpha Bot left a comment

Choose a reason for hiding this comment

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

LGTM! ✅

The new commit resolves the missing-guard concern — mise.toml absence is now caught early with a clear error. One previously flagged issue is still open: the README documents the new requirement but does not mention that existing callers using tool: maven need to add mise.toml before upgrading. No new issues in this commit.

🗣️ Give feedback

@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource changed the title SONARJAVA-6276 Use mise action to Install Maven if needed. SONARJAVA-6276 Use mise action to install Maven if needed. Apr 24, 2026
@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource changed the title SONARJAVA-6276 Use mise action to install Maven if needed. SONARJAVA-6276 Use mise action to install Maven if needed Apr 24, 2026
@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource merged commit 14252cf into master Apr 24, 2026
8 checks passed
@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource deleted the tt/bump-version-mise branch April 24, 2026 09:56
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