BUILD-12536 Make the .actions symlink setup idempotent on Windows - #344
Merged
julien-carsique-sonarsource merged 1 commit intoSep 7, 2026
Merged
julien-carsique-sonarsource merged 1 commit into
julien-carsique-sonarsource merged 1 commit into
Conversation
config-maven, build-maven, promote, build-npm, build-yarn, build-poetry, build-gradle, and config-pip each create .actions/ symlinks via ln -sf, unguarded by their own idempotency check (that check only covers the Vault/settings.xml/cache/version-bump steps that follow it, not this symlink setup itself). Any job invoking more than one of these composite actions -- e.g. a standalone config-maven call followed by build-maven, which calls config-maven again internally -- runs this setup twice. On Linux, GNU ln -sf re-links cleanly over an existing symlink-to- directory. On Windows, Git-Bash's ln instead tries to nest a new entry inside it, eventually failing with 'cannot overwrite directory' once enough invocations stack up. Removing the existing symlinks before recreating them makes the step idempotent on both platforms. config-npm and config-uv already guard this same step behind their own completion check, so they're unaffected. get-build-number and check-sca don't create these symlinks at all.
julien-carsique-sonarsource
force-pushed
the
fix/jcarsique/BUILD-12536-windowsSymlinkSetup
branch
from
September 7, 2026 13:02
4a5501d to
36f7484
Compare
|
matemoln
approved these changes
Sep 7, 2026
julien-carsique-sonarsource
deleted the
fix/jcarsique/BUILD-12536-windowsSymlinkSetup
branch
September 7, 2026 16:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
config-maven,build-maven,promote,build-npm,build-yarn,build-poetry,build-gradle, andconfig-pipeach create.actions/symlinks vialn -sf, unguarded by their own idempotency check (that check only covers the Vault/settings.xml/cache/version-bump steps that follow it, not this symlink setup itself).config-mavencall followed bybuild-maven, which callsconfig-mavenagain internally — runs this setup more than once.ln -sfre-links cleanly over an existing symlink-to-directory. On Windows, Git-Bash'slninstead tries to nest a new entry inside it, eventually failing withln: .actions/shared/shared: cannot overwrite directoryonce enough invocations stack up.config-npmandconfig-uvalready guard this same step behind their own completion check, so they're unaffected.get-build-numberandcheck-scadon't create these symlinks at all.Concretely hit in SonarSource/sonar-dummy-maven-enterprise#144 (
Build Windowsjob), worked around there with a localrm -rf .actionsstep + TODO pointing at BUILD-12536.Jira: BUILD-12536
Test plan
sonar-dummy-maven-enterprise#144'sBuild Windowsjob passes without its localrm -rf .actionsworkaround, once this merges and the workaround is removed there