BUILD-11500 Use self-hosted Artifactory for Maven actions#280
Conversation
232cc55 to
b4665bb
Compare
b4665bb to
29e0585
Compare
Remove repox-url and repox-artifactory-url from config-maven, build-maven, and promote. Set ARTIFACTORY_URL to https://repox.dev.sonar.build/artifactory in those actions; credentials still come from Vault as before. Update README for config-maven, build-maven, and promote. Breaking change: repox-url and repox-artifactory-url are no longer accepted on config-maven, build-maven, or promote.
29e0585 to
0314185
Compare
Accidentally downgraded when restoring action files from an older branch commit.
| <releases> | ||
| <enabled>true</enabled> | ||
| <!-- no need to always check if new versions are available when executing a Maven plugin without specifying the version --> | ||
| <updatePolicy>interval:60</updatePolicy> | ||
| <updatePolicy>always</updatePolicy> | ||
| <checksumPolicy>fail</checksumPolicy> |
There was a problem hiding this comment.
⚠️ Quality: updatePolicy=always contradicts adjacent comment and adds overhead
In the plugin releases repository, updatePolicy was changed from interval:60 to always, but the comment directly above it still reads: "no need to always check if new versions are available when executing a Maven plugin without specifying the version". The code now does the exact opposite of what the comment states.
Functionally, always makes Maven check the remote repository for plugin updates on every single build. For a release (non-snapshot) plugin repository this is almost never desired — released artifacts are immutable, so the only effect is added network round-trips (and slower, less reliable builds) on each invocation. interval:60 (or daily) already balanced freshness against performance.
Suggested fix: either revert to interval:60/daily, or if always is intentional, update the comment to explain why frequent checks are now required. Note the <releases> repository block above (line 48) still uses interval:60, so this also introduces an inconsistency between the two repository definitions.
Revert to interval:60 to match the comment and the releases repository above.:
<releases>
<enabled>true</enabled>
<!-- no need to always check if new versions are available when executing a Maven plugin without specifying the version -->
<updatePolicy>interval:60</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
| - uses: SonarSource/vault-action-wrapper@0a3114fe1230b784c35b53b099f9ab1f1e538cc7 # 3.5.0 | ||
| id: artifactory | ||
| with: | ||
| url: https://vault.dev.sonar.build | ||
| # yamllint disable rule:line-length | ||
| secrets: | | ||
| ${{ inputs.deploy != 'false' && inputs.run-shadow-scans != 'true' && steps.params.outputs.ARTIFACTORY_DEPLOY_USERNAME_VAULT || '' }} | ||
| ${{ inputs.deploy != 'false' && inputs.run-shadow-scans != 'true' && steps.params.outputs.ARTIFACTORY_DEPLOY_ACCESS_TOKEN_VAULT || '' }} | ||
| ${{ inputs.deploy != 'false' && inputs.mixed-privacy == 'true' && steps.params.outputs.ARTIFACTORY_PRIVATE_DEPLOY_ACCESS_TOKEN_VAULT || '' }} |
There was a problem hiding this comment.
💡 Edge Case: artifactory vault step may emit empty output for non-deploy builds
The new artifactory step requests zero secrets when inputs.deploy == 'false' (all three secret lines evaluate to ''), and it has no if: guard, so it always runs. Lines 190-192 then call fromJSON(steps.artifactory.outputs.vault).ARTIFACTORY_DEPLOY_USERNAME etc.
Previously these deploy credentials lived in the secrets step, whose output was always non-empty valid JSON because it also requested SIGN_KEY/PGP_PASSPHRASE. Now, for non-deploy builds (e.g. PR builds with deploy=false), the dedicated artifactory step may produce an empty vault output. If the wrapper emits '' rather than {} in that case, fromJSON('') would throw and fail the env evaluation of the build step for all non-deploy runs.
Please confirm vault-action-wrapper outputs {} (not empty string) when no secrets are requested; if not, add an if: guard on the artifactory step (e.g. only when deploy != 'false') and gate the dependent env vars accordingly.
Was this helpful? React with 👍 / 👎
77bcec5 to
8bac5c3
Compare
|
Code Review
|
| Auto-apply | Compact | Unblock |
|
|
|
Was this helpful? React with 👍 / 👎 | Gitar



BUILD-11500 This PR switches
config-maven,build-maven(viaconfig-maven), andpromoteto the self-hosted JFrog instance athttps://repox.dev.sonar.build/artifactory.Changes
repox-urlandrepox-artifactory-urlinputs fromconfig-maven,build-maven, andpromote.ARTIFACTORY_URLtohttps://repox.dev.sonar.build/artifactoryin the composite action steps (not configurable).private-reader/public-reader, deployer, promoter) and document the fixed URL in the README.Breaking changes
repox-urlorrepox-artifactory-urltoconfig-maven,build-maven, orpromotemust drop those inputs.Other actions (
config-gradle,config-pip,build-npm, etc.) still userepox-*URL inputs and are unchanged in this PR.Prerequisites (Platform)
development/artifactorymount must reachrepox.dev.sonar.buildand issue tokens valid for that instance.*-reader,*-qa-deployer,*-promoter, etc.) must exist for the new instance as needed.Test plan
config-mavenon a sample repo resolves dependencies fromrepox.dev.sonar.build.build-mavenbuild and deploy still work end-to-end.promotepromotes a build against the same instance.Summary by Gitar
repox-urlandrepox-artifactory-urlinputs fromconfig-maven,build-maven, andpromoteactions.ARTIFACTORY_URLtohttps://repox.dev.sonar.build/artifactoryacross core Maven actions.README.mdto notecontents: readpermission requirements and added Vault access details fordevelocity.This will update automatically on new commits.