Skip to content

BUILD-11961 Support repox-internal edge for all build/config actions - #328

Draft
hedinasr wants to merge 11 commits into
masterfrom
fix/hnasr/BUILD-11961-mavenVaultDefaultUrl
Draft

BUILD-11961 Support repox-internal edge for all build/config actions#328
hedinasr wants to merge 11 commits into
masterfrom
fix/hnasr/BUILD-11961-mavenVaultDefaultUrl

Conversation

@hedinasr

@hedinasr hedinasr commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

BUILD-11961 Support repox-internal edge for all build/config actions

Summary

Ready the shared GitHub Actions for Edge Node + SaaS Artifactory (repox-internal.dev.sonar.build resolve, SaaS deploy):

  • Vault: always use vault-action-wrapper default (vault.sonar.build); remove repox-url-based vault.dev switching from all Artifactory secret steps.
  • Resolve vs deploy: repox-url for dependency resolution; new repox-deploy-url (default https://repox.jfrog.io) for publish on build-maven, build-npm, build-gradle, build-poetry, build-yarn.
  • Federation wait: shared wait_artifactory_token_sync.sh polls a protected Artifactory API until HTTP 200 (skip for SaaS jfrog.io) in config-maven/npm/uv/gradle/poetry/pip and build-yarn.
  • Gradle: ARTIFACTORY_RESOLVE_URL + init script prefer resolve URL while deploy overrides ARTIFACTORY_URL.

Actions touched

config-maven, config-npm, config-uv, config-gradle, config-poetry, config-pip, build-maven, build-npm, build-gradle, build-poetry, build-yarn, promote

Test plan

  • Maven (sonar-dummy): edge resolve + SaaS deploy/promote
  • Gradle / npm / uv (e.g. sonarcloud-core): edge resolve with branch dogfood
  • Confirm SaaS-only workflows (default repox-url) skip the wait and behave unchanged
  • Confirm no action still references vault.dev.sonar.build for Artifactory secrets

Related validation PRs:

@hashicorp-vault-sonar-prod

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

Copy link
Copy Markdown

BUILD-11961

Comment thread config-maven/action.yml Outdated
Comment thread config-maven/action.yml Outdated
@hedinasr
hedinasr force-pushed the fix/hnasr/BUILD-11961-mavenVaultDefaultUrl branch from 0a73346 to 1dab974 Compare July 23, 2026 10:22
Comment thread config-maven/action.yml Outdated
Comment thread config-maven/action.yml Outdated
@hedinasr
hedinasr force-pushed the fix/hnasr/BUILD-11961-mavenVaultDefaultUrl branch from 1dab974 to 82a3631 Compare July 23, 2026 10:57
Comment thread shared/wait_artifactory_token_sync.sh Outdated
Comment thread shared/wait_artifactory_token_sync.sh Outdated
hedinasr added 8 commits July 27, 2026 15:29
Stop selecting vault.dev.sonar.build from repox-url so Artifactory
reader/deployer tokens come from the vault-action-wrapper default
(vault.sonar.build), which is required for Edge Node + SaaS validation.
Poll a protected storage API until SaaS-minted tokens are accepted by
the edge node, skipping the wait for SaaS jfrog.io endpoints.
Keep a simple delay on edge Repox instead of curling a protected API.
Keep dependency downloads on repox-url (Maven settings mirror) while
publishing via ARTIFACTORY_URL/contextUrl to repox-deploy-url (SaaS by
default), so deployer tokens do not need edge Access Federation.
Give Access Federation a short delay before Maven hits the edge node
with SaaS-minted reader tokens; skip the wait for SaaS Repox.
Use default Vault for Artifactory tokens, wait 10s for edge federation,
and split build-npm deploy onto repox-deploy-url (SaaS by default).
Replace the fixed 10s sleep with a shared retry loop against a
protected storage API so builds proceed as soon as federation syncs.
Remove vault.dev switching, poll for token federation on configs,
and split resolve vs deploy URLs for gradle/poetry/yarn builds.
@hedinasr
hedinasr force-pushed the fix/hnasr/BUILD-11961-mavenVaultDefaultUrl branch from 79e8643 to 2ae8ebb Compare July 27, 2026 13:32
@hedinasr hedinasr changed the title BUILD-11961 Use default Vault URL for Maven Artifactory secrets BUILD-11961 Support repox-internal edge for all build/config actions Jul 27, 2026
hedinasr added 3 commits July 27, 2026 15:49
Nested quotes in run: broke action.yml loading. Use relative paths
and harden the wait curl with timeouts and clean HTTP code capture.
Refactor into testable functions, redirect errors to stderr, and add
shellspec coverage so the PR quality gate can pass.
@gitar-bot

gitar-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 6 resolved / 6 findings

Updates shared build and config actions to support the repox-internal edge node and SaaS deployment, addressing issues with curl timeouts, retry behavior, and hardcoded ping URLs. No issues found.

✅ 6 resolved
Security: Artifactory token passed on curl command line

📄 config-maven/action.yml:164-166
The Artifactory access token is passed via curl -u "user:token", which exposes the credential in the process argument list (readable via /proc//cmdline by other processes on the runner). Prefer feeding credentials to curl out-of-band, e.g. curl --netrc-file <(printf 'machine %s login %s password %s' "$host" "$ARTIFACTORY_USERNAME" "$ARTIFACTORY_ACCESS_TOKEN") or via -K config from stdin, so the token never appears in the command line.

Quality: Any non-200 response retries for the full 5 minutes

📄 config-maven/action.yml:163-175
The loop only treats HTTP 200 as success and retries every other code for the full 60×5s window before failing. A genuine misconfiguration (e.g. 401 on bad credentials, 404 on wrong URL/repo path) is indistinguishable from the expected federation-lag 403, so a hard failure is delayed by up to 5 minutes with no early feedback. Consider failing fast on non-403/non-2xx codes and only retrying the expected federation-lag codes (403).

Quality: Hardcoded dev ping curl runs for all builds incl. SaaS

📄 config-maven/action.yml:149-154
The added curl to the hardcoded https://repox-internal.dev.sonar.build/artifactory/api/system/ping runs unconditionally before the *jfrog.io* SaaS skip check, so even SaaS/production Repox builds make a request to a fixed dev host that has nothing to do with the actual REPOX_URL. This looks like a leftover debugging probe (verbose -v, output discarded to /dev/null, no effect on control flow). Move it below the SaaS exit and/or remove it, and use $REPOX_URL rather than a hardcoded dev host if the ping is intended to be meaningful.

Performance: Unconditional 60s sleep added to every non-SaaS Maven build

📄 config-maven/action.yml:155-156
Every non-jfrog.io Repox build now blocks for a fixed 60s regardless of whether the token has already federated, adding a full minute to each CI run. This is acknowledged as temporary, but consider polling the ping endpoint until it succeeds (with a timeout cap) instead of a blind fixed sleep to avoid the fixed latency on all edge-node builds.

Quality: curl retry lacks connect/max timeout

📄 shared/wait_artifactory_token_sync.sh:36-38
The polling curl has no --connect-timeout/--max-time, so a hung TCP connection to the edge node would stall an iteration indefinitely rather than counting as a failed attempt, defeating the 5-minute bound. Add --connect-timeout 5 --max-time 15 to keep each attempt time-boxed.

...and 1 more resolved from earlier reviews

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant