Skip to content

CLP-1095 Migrate Orchestrator downloads to the JFrog Edge node for SonarJS - #8062

Merged
guillaume-dequenne merged 5 commits into
masterfrom
CLP-918
Oct 9, 2026
Merged

guillaume-dequenne merged 5 commits into
masterfrom
CLP-918

Conversation

@guillaume-dequenne

@guillaume-dequenne guillaume-dequenne commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Part of CLP-918.

Summary

Extends #8005 by routing Orchestrator's direct downloads, Maven setup calls, and the remaining ESLint build/test installs through JFrog Edge on self-hosted and WarpBuild runners. Shared configuration fetches Edge-issued reader tokens and replaces local federation waiters.

  • The public root lockfile uses npmjs URLs, including the 247 legacy SaaS URLs inherited from master. Dependency versions and integrity hashes are unchanged. .npmrc and both Renovate npmjs overrides retain public defaults.
  • CI sets NPM_CONFIG_REPLACE_REGISTRY_HOST=npmjs and selects Edge at install time. Linux and ESLint jobs use config-npm@v2; Windows configures npm directly with the Edge reader token because mise has no jfrog-cli backend there.
  • config-maven@v2 supplies the Edge mirror and Orchestrator's ARTIFACTORY_URL/reader credentials. mvn deploy explicitly sets ARTIFACTORY_URL to SaaS while retaining the Edge resolve mirror. Deployment and promotion retain SaaS configuration.
  • The GitHub-hosted ESLint release workflow explicitly selects SaaS for Maven configuration and retains SaaS install/Artifactory publish/promote configuration and the existing immutable jfrog-setup-wrapper pin. It needs no Edge lockfile rewrite. The release-style validation also explicitly selects SaaS, so neither depends on the shared action’s changing default.

Fast QA tester 1.3.0.1396, bundling Orchestrator 6.4.3, is a prerequisite already merged in #8092. The ci-github-actions@v2 references are moving major-version references, not release pins.

Validation

Final revision: 8d39acd9d. PR Build and isolated registry validation are running. Earlier validation passed, including Node 24 SonarLint, Fast QA, Windows QA, and ruling; the evidence below will be refreshed when the final runs complete.

Check Evidence
Public install, empty credential files/cache, lifecycle scripts enabled Passed: 1,061 successful npmjs HTTP fetches
Linux and Windows npm cache misses Linux and Windows: 1,107 successful Edge fetches each
ESLint build/test installs Passed through Edge; metadata and tarball requests confirmed in validation logs
Uncached Orchestrator downloads Linux and Windows download the SonarQube enterprise ZIP directly from Edge
Release-style install without publishing Passed through SaaS using the release npm repository configuration
Deployment/promotion Maven deployment logs target repox.jfrog.io; normal PR promotion passed on SaaS. Release publish/promote configuration is unchanged

The opt-in workflow_dispatch input validate-registry-routing=true uses isolated npm/Orchestrator cache keys, logs npm HTTP requests, and checks public/SaaS installs. It skips branch analysis and feature-branch promotion; normal PR promotion is unchanged. No shared caches were evicted and the release workflow was not triggered.

Lockfile semantic comparison, YAML parsing, and git diff --check pass. Actionlint reports no new findings compared with master.

The PR SonarQube quality gate passes with no new violations or dependency risks. The manual branch analysis exposes the existing overall licensing gate failure (severity 20, limit 19), also present on master; this PR changes no dependency versions. Schedule-only Alpine and DEV QA paths remain outside this validation coverage.

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Migrate Orchestrator downloads to the JFrog Edge node for SonarJS CLP-1095 Migrate Orchestrator downloads to the JFrog Edge node for SonarJS Sep 28, 2026
@hashicorp-vault-sonar-prod

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

Copy link
Copy Markdown

CLP-1095

Comment thread .github/workflows/build.yml Outdated
gitar-bot[bot]

This comment was marked as resolved.

@datadog-sonarsource

This comment has been minimized.

Comment thread .github/actions/wait-for-artifactory-token-federation/action.yml Outdated
Comment thread .github/actions/configure-npm-registry/action.yml Outdated
Comment thread .github/workflows/build.yml
Comment thread .github/workflows/build.yml Outdated
Comment thread docs/CI.md Outdated
Comment thread docs/CI.md Outdated
@guillaume-dequenne
guillaume-dequenne force-pushed the CLP-918 branch 5 times, most recently from 97f76b9 to bc69b37 Compare October 5, 2026 12:42
Comment thread .github/workflows/release_eslint_plugin.yml
Comment thread docs/CI.md Outdated
Comment thread .github/workflows/build.yml
@guillaume-dequenne
guillaume-dequenne force-pushed the CLP-918 branch 3 times, most recently from a758c97 to f0c4796 Compare October 5, 2026 15:41
@mary-georgiou
mary-georgiou requested review from vdiez and removed request for mary-georgiou October 6, 2026 11:43
@mary-georgiou

Copy link
Copy Markdown
Contributor

@guillaume-dequenne I'm assigning this to Victor. I think he's a better choice for this repo as this PR is not super straight forward.

@vdiez vdiez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with using JFrog Edge for CI dependency resolution and Orchestrator downloads, while keeping deployment/publishing/promotion on SaaS. I am requesting changes because the committed lockfile now makes public source builds depend on our internal Edge registry. Public users must continue to use npmjs by default, without SonarSource credentials or registry workarounds.

Please make the following changes before merging.

  1. Keep the committed root lockfile on npmjs.

    Remove the rewrite of the root package-lock.json to https://repox-internal.dev.sonar.build/artifactory/api/npm/npm/. Normalize the public npm dependencies' resolved URLs to https://registry.npmjs.org/, including any remaining SaaS Repox URLs inherited from the base branch; simply reverting the Edge rewrite would leave those inherited URLs behind. Preserve the dependency versions and integrity hashes.

    The current head contains 1,133 Edge tarball URLs. A public user running npm ci will attempt to fetch those URLs. Setting --registry=https://registry.npmjs.org/ does not redirect an arbitrary internal host: npm's default replace-registry-host=npmjs replaces npmjs URLs with the configured registry, not Edge URLs with npmjs. Thus authenticated internal CI passing does not establish that public builds still work.

  2. Select Edge through CI configuration while preserving the npmjs defaults in the repository.

    Keep .npmrc free of an internal registry requirement. Keep both public-registry overrides in .github/renovate.json: npmrc: "registry=https://registry.npmjs.org/\n" for npm operations/lockfile generation, and the npm datasource registryUrls: ["https://registry.npmjs.org/"] override for dependency lookups. These intentionally override the shared Repox preset and help keep dependency updates usable by public contributors.

    In the CI jobs that resolve through Edge, configure the Edge registry and its scoped authentication, and retain replace-registry-host=npmjs behavior so npmjs lockfile URLs are fetched through Edge at install time. This needs to work for both the shared config-npm path on Linux and the explicit npm configuration on Windows. Explicitly setting the option in CI is fine; if relying on the shared action/default, verify that behavior on a clean runner.

    The property originally landed in #8005 with repox.jfrog.io as its value. #8090, merged on October 2, changed it to npmjs with the comment "Redirect public lockfile URLs to the configured internal registry." Preserve that public-lockfile/CI-registry separation when replacing the local action. A SaaS URL bypassing Edge is a reason to normalize that URL to npmjs, rather than commit Edge URLs for all consumers.

  3. Remove the Edge-specific release workaround and correct the documentation.

    Once the lockfile uses npmjs URLs, remove the added npm config set replace-registry-host repox-internal.dev.sonar.build from release_eslint_plugin.yml. Keep the intended SaaS resolve/publish/promote configuration for the release workflow, and verify that its install still resolves through the intended registry. With public lockfile URLs, the release no longer needs a workaround for an internal host committed by this PR.

    Update docs/CI.md and the PR description to explain that committed lockfile URLs and Renovate remain on npmjs, while CI selects Edge and redirects npmjs tarball URLs at runtime. Remove the instruction to keep new lockfile entries on Edge and the description of the release rewriting Edge lockfile URLs.

  4. Describe this as an explicit extension of the accepted #8005 scope.

    In the answer to my initial review of #8005, the agreed acceptance criteria were that self-hosted/WarpBuild mvn deploy and npm ci dependency resolution use Edge, publishing/promotion remain on SaaS, and GitHub-hosted jobs remain on SaaS. A one-off Maven setup call using SaaS was explicitly acceptable. I approved that scope.

    It is reasonable for this PR to extend the migration. Please distinguish the new goals from the behavior already delivered: migrate Orchestrator's direct downloads (which use ARTIFACTORY_URL, independently of the Maven mirror), move the Maven setup calls to Edge, remove the remaining ESLint build/test install exceptions that explicitly use SaaS, and replace federated SaaS reader tokens/local waiters with Edge-issued credentials/shared configuration. Explain any runner paths that now use Edge where #8005 kept SaaS, and document their reachability/validation. Keep the explicit SaaS deployment override and the SaaS publishing/promotion paths.

    Also update the Fast QA description: sonar-scanner-integration-tester 1.3.0.1396 is already present on master through #8092. It can be documented as a prerequisite already merged, rather than a change introduced by this PR.

  5. Validate the revised public-lockfile configuration before merging.

    The linked validation run did execute npm ci successfully on both Linux and Windows with a cold cache, which addresses the earlier concern about exercising the miss path. However, that validation used the Edge lockfile and must be repeated for the revised public lockfile.

    Please provide evidence that a clean public installation with npmjs as the registry and no SonarSource credentials succeeds; that Linux and Windows CI cache-miss installs fetch through Edge using npmjs lockfile URLs; and that the ESLint build/test installs and Orchestrator downloads use Edge. Verify that the release install and deploy/publish/promote paths still target SaaS. Use a fresh/isolated cache key or equivalent verification where needed; broad cache eviction is unnecessary.

    The latest head's Build run also has a failing Ubuntu Node 24 QA job with four SonarLint condition timeouts. I have not established that these are caused by this PR. Please rerun the failed job and investigate if it persists, and update the validation section with results for the final head.

With these changes, we can finish the CI migration and simplify its authentication without requiring public users to access SonarSource infrastructure.

@guillaume-dequenne
guillaume-dequenne force-pushed the CLP-918 branch 3 times, most recently from f0c4d35 to 590174b Compare October 8, 2026 09:30
Comment thread .github/workflows/build.yml
@guillaume-dequenne
guillaume-dequenne force-pushed the CLP-918 branch 3 times, most recently from b917dff to 8d39acd Compare October 8, 2026 13:24

@vdiez vdiez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for addressing the requested changes. Public npmjs lockfile URLs and Renovate defaults are preserved, CI selects Edge at install time, and GitHub-hosted release configuration explicitly stays on SaaS. We can simplify the npm authentication setup in a separate cleanup refactor. Latest-head CI is still pending; merge once the required checks pass.

@gitar-bot

gitar-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 11 closed / 11 findings

🟡 Medium risk · Routing npm, Maven, and Orchestrator downloads through JFrog Edge changes CI dependency resolution; routing or credential issues could block builds.

Routes Orchestrator downloads, Maven setup, and ESLint build/test installs through JFrog Edge on self-hosted and WarpBuild runners, with public npm lockfile URLs preserved. Resolved the private federation-wait action, unbounded probe curl, SaaS auth fallback, unmerged config-npm pin, PR description mismatch, lockfile and release-workflow breakages, cache-step config text, and the jfrog-setup-wrapper SHA pin. Two wont-fix items remain closed without a fix: the 2.2.0 pin versus floating @v2 references, and the SaaS validation job's reliance on config-npm's implicit default.

✅ 11 closed
✅ Bug: Public SonarJS repo can't resolve the private federation-wait action

📄 .github/workflows/build.yml:757-761 📄 .github/workflows/build.yml:795 📄 .github/workflows/build.yml:838 📄 .github/workflows/build.yml:866 📄 .github/workflows/build.yml:920 📄 .github/workflows/build.yml:950 📄 .github/workflows/build.yml:977 📄 .github/workflows/build.yml:1006 📄 .github/workflows/build.yml:1042 📄 .github/workflows/build.yml:1075 📄 .github/workflows/build.yml:1109 📄 .github/workflows/build.yml:1218 🔗 link 🔗 link
The new &edge_preflight step points uses: at SonarSource/sonarsource-infra-artifactory/.github/actions/wait-for-artifactory-token-federation. That repo returns 404, so it is private. SonarJS is public, and GitHub's Actions settings docs say actions in a private repo "can be shared with other private repositories" and "Access is allowed only from private repositories." SonarSource hit this exact problem in sonarlint-intellij PR #1895, which inlined the wait because "this public repo cannot resolve the private sonarsource-infra-artifactory action".

The step is aliased into all 12 plugin and ruling QA jobs. If it fails to resolve, each of those jobs fails during action download, before any Orchestrator test runs. That includes the PR-gated jobs, so the change blocks CI instead of moving downloads to Edge. The fix is to inline the wait as a run: step (poll the probe path on the Edge URL with curl until it returns 200 or a timeout expires) or to call a public action. Other shared tooling here already follows that pattern, e.g. core-languages-tooling-public.

✅ Edge Case: Probe curl has no timeout, so the 2-minute wait can run far longer

📄 .github/actions/wait-for-artifactory-token-federation/action.yml:22-25 📄 .github/actions/wait-for-artifactory-token-federation/action.yml:34-38
The curl probe sets neither --connect-timeout nor --max-time. The loop also counts HTTP 000 (connection failure) as a retryable state. If the Edge host is black-holed or stalls mid-response, each attempt can block for the OS TCP connect timeout (about 2 minutes on Linux) or indefinitely on a stalled transfer. So the 12-attempt loop can hold each of the ~12 QA jobs for many minutes before it prints "not accepted by Edge within 2 minutes", and a stalled transfer can hang until the job times out. The loop also sleeps 10s after the final failed attempt for no benefit. Fix: bound each probe with curl timeouts and skip the last sleep.

✅ Bug: SaaS _authToken fallback for repox.jfrog.io removed from npm config

📄 .github/actions/configure-npm-registry/action.yml:18-20 📄 .github/workflows/build.yml:126-136 📄 docs/CI.md:787-791
This commit removes npm config set "//repox.jfrog.io/artifactory/api/npm/:_authToken=..." from configure-npm-registry, so only the Edge host is authenticated. The root package-lock.json still has 248 resolved URLs on repox.jfrog.io. Our convention on lockfile host rewriting fallback says to keep the SaaS _authToken as a fallback alongside replace-registry-host repox.jfrog.io, because that fallback was the fix for an earlier CI failure. With it gone, any request that replace-registry-host does not rewrite reaches SaaS with no credentials and fails. Restore the fallback line. populate_npm_cache now fetches only the Edge-issued token, so the job also needs a SaaS private-reader token (or an Edge token confirmed to work on SaaS) to supply it.

✅ Quality: config-npm pinned to head of an unmerged feature-branch PR

📄 .github/workflows/build.yml:124
The new config-npm step is pinned to 2b6c024f8567c04c708b673604cf3a400993b83f. That commit is only the head of feat/hnasr/BUILD-12160-npmReplaceRegistryHost in SonarSource/ci-github-actions PR #355 ("BUILD-12160 Fetch SaaS-pinned npm lockfile tarballs through the Edge"), which is still open. It is 1 commit ahead of master and is not on any tag. If that PR is squash-merged or rebased and the branch is deleted, the SHA can stop being reachable and populate_npm_cache and populate_npm_cache_win would fail to resolve the action. The other pins in this file are release SHAs with a version comment (e.g. c3a85ac… # 2.2.0). The PR description only says to repin the token-federation action after ci-github-actions#353 merges, so nothing reminds anyone to repin this one. Wait for #355 to merge, then pin to a released tag SHA with a version comment. Also add this dependency to the PR's merge checklist.

✅ Quality: PR description no longer matches the workflow after this commit

📄 .github/workflows/build.yml:189-196 📄 .github/workflows/build.yml:804-812 📄 .github/workflows/build.yml:1009-1018 📄 .github/workflows/build.yml:1106-1120
The description makes three claims the code no longer supports. It says Maven QA jobs run a token-federation check through the shared ci-github-actions action pinned to 715009ff…, but this commit removes every federation wait, and neither that SHA nor any federation action appears anywhere in the tree. It says only 7 plugin and ruling job definitions are routed to the Edge and that Fast QA stays on its original artifact path. In fact, the shared config-maven anchor now runs with repox-url: https://repox-internal.dev.sonar.build in every job, so every Fast QA job (orchestrator_fast_cache_restore and the fast-tests runs) gets the Edge ARTIFACTORY_URL and token. The merge instruction to repin to a retained commit of ci-github-actions#353 is also obsolete now that the actions are pinned to c3a85ac… # 2.2.0. Update the description, and confirm Fast QA passes on the Edge, since the description reports a failure in that setup.

...and 6 more closed from earlier reviews

Review coverage

🧪 Functional validation 1 of 1 objectives covered

📋 Rules No rules evaluated

📖 Knowledge used 1 confirmed expected behavior · 1 helped identify issues

🤖 Auto-approval Not enabled · Set up

Implementation Status ✅ 1 of 1 objectives covered
✅ CLP-918 - 1 of 1 objectives covered

This PR covers the objective of migrating the Orchestrator's SonarQube download source to the JFrog Edge node for SonarJS.

✅ 1 covered here
  • ✅ Migrate the Orchestrator's SonarQube download source to the JFrog Edge node
Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

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

@sonarqube-next

sonarqube-next Bot commented Oct 9, 2026

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
0 Dependency risks
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@guillaume-dequenne
guillaume-dequenne merged commit dce7aac into master Oct 9, 2026
48 checks passed
@guillaume-dequenne
guillaume-dequenne deleted the CLP-918 branch October 9, 2026 12:10
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.

4 participants