Skip to content

BUILD-12536 Make the .actions symlink setup idempotent on Windows - #344

Merged
julien-carsique-sonarsource merged 1 commit into
masterfrom
fix/jcarsique/BUILD-12536-windowsSymlinkSetup
Sep 7, 2026
Merged

julien-carsique-sonarsource merged 1 commit into
masterfrom
fix/jcarsique/BUILD-12536-windowsSymlinkSetup

Conversation

@julien-carsique-sonarsource

@julien-carsique-sonarsource julien-carsique-sonarsource commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 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 more than once.
  • 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 ln: .actions/shared/shared: 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.

Concretely hit in SonarSource/sonar-dummy-maven-enterprise#144 (Build Windows job), worked around there with a local rm -rf .actions step + TODO pointing at BUILD-12536.

Jira: BUILD-12536

Test plan

  • CI green on this PR
  • sonar-dummy-maven-enterprise#144's Build Windows job passes without its local rm -rf .actions workaround, once this merges and the workaround is removed there

@julien-carsique-sonarsource
julien-carsique-sonarsource requested a review from a team as a code owner September 7, 2026 10:15
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

BUILD-12536

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
julien-carsique-sonarsource force-pushed the fix/jcarsique/BUILD-12536-windowsSymlinkSetup branch from 4a5501d to 36f7484 Compare September 7, 2026 13:02
@julien-carsique-sonarsource julien-carsique-sonarsource changed the title BUILD-12536 Make .actions symlink setup idempotent on Windows BUILD-12536 Make the .actions symlink setup idempotent on Windows Sep 7, 2026
@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

@julien-carsique-sonarsource
julien-carsique-sonarsource merged commit 92d50fd into master Sep 7, 2026
18 checks passed
@julien-carsique-sonarsource
julien-carsique-sonarsource deleted the fix/jcarsique/BUILD-12536-windowsSymlinkSetup branch September 7, 2026 16: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