Skip to content

JS-2729 Allow release check override and track 2026.1 integration tests on 11.x - #8235

Merged
vdiez merged 3 commits into
branch-11-Xfrom
codex/release-releasability-11-x
Oct 23, 2026
Merged

vdiez merged 3 commits into
branch-11-Xfrom
codex/release-releasability-11-x

Conversation

@vdiez

@vdiez vdiez commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Maintenance releases can be blocked by releasability checks, and their integration tests currently follow the latest SonarQube release instead of the maintained 2026.1 LTA.

Expose the shared release workflow's skipJavascriptReleasabilityChecks boolean in sonar-release, defaulting to false. Selecting it skips all releasability checks, including Quality Gate and Jira, because the shared action has no Quality Gate-only switch.

Define DEV[2026.1] once in the ITS parent POM and forward it to every test JVM. Normal plugin QA, fast QA, Windows QA, and ruling inherit this selector, which tracks the latest promoted 2026.1 build. Preserve required CI check names and matrices; the explicitly scheduled DEV jobs retain their DEV override.

Make fast QA use the scanner engine shipped in the selected lightweight enterprise server ZIP. The LTA engine is not available at the standalone Maven coordinates used by the original implementation. Reuse Orchestrator's packaging resolver, credentials, and archive cache, then cache the extracted engine by its resolved server version and pass it to the test harness. Retain the existing DEV and LATEST_RELEASE selectors for explicit overrides.

Validation:

  • Reproduced the original scanner artifact HTTP 404 locally.
  • Full fast QA passed locally on macOS: 40 tests, zero failures, errors, or skips.
  • Fast QA without Node on PATH passed locally: 38 tests, zero failures, errors, or skips, using CI's two custom-rule exclusions.
  • Both runs use this PR's actual CI artifact 11.8.2.46359 and the engine from the latest promoted LTA build, 2026.1.7.133283.
  • Verified that the extracted engine matches the engine inside the server ZIP byte for byte.
  • Effective Maven configuration confirms the selector in all ten ITS modules; formatting and git diff --check passed.
  • Linux and Windows validation runs in PR CI.

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Allow release check override and pin 2026.1 integration tests on 11.x JS-2729 Allow release check override and pin 2026.1 integration tests on 11.x Oct 23, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

JS-2729

@vdiez vdiez changed the title JS-2729 Allow release check override and pin 2026.1 integration tests on 11.x JS-2729 Allow release check override and track 2026.1 integration tests on 11.x Oct 23, 2026
Comment on lines +57 to +71
public static synchronized EngineVersion.Version getEngineVersion() {
String runtimeVersion = System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE");
if ("DEV".equals(runtimeVersion)) {
return EngineVersion.latestMasterBuild();
}
return EngineVersion.latestRelease();
if ("LATEST_RELEASE".equals(runtimeVersion)) {
return EngineVersion.latestRelease();
}
// The LTA engine is shipped inside the server ZIP, not published as a standalone artifact.
var configuration = Configuration.createEnv();
var packaging = new PackagingResolver(new Locators(configuration)).resolve(
new SonarDistribution().setEdition(Edition.ENTERPRISE_LW).setVersion(runtimeVersion)
);
var engineName = "scanner-enterprise-" + packaging.getVersion() + "-all.jar";
var engine = configuration

@gitar-bot gitar-bot Bot Oct 23, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Performance: LTA engine alias is re-resolved against Artifactory on every call

getEngineVersion() runs from the static SERVER_CONTEXT initializer of about 20 test classes, both through getContext() and directly. With the default DEV[2026.1], every call builds a new PackagingResolver and calls resolve(). That goes through locators.maven().resolveVersion(...) to DefaultArtifactory, which sends an api/search/versions HTTP request each time. Orchestrator caches the downloaded ZIP but not the alias-to-version lookup (DefaultArtifactory.java, PackagingResolver.java).

So each fast-QA JVM makes about 20 serialized network round trips, and the synchronized lock makes test classes wait on each other. If a new 2026.1 build is promoted during a run, different test classes in the same run can also get different scanner engines. Because the method is already synchronized, storing the result in a static field once fixes both problems.

Memoize the resolved engine for the JVM lifetime (method is already synchronized).:

private static EngineVersion.Version engineVersion;

public static synchronized EngineVersion.Version getEngineVersion() {
  if (engineVersion == null) {
    engineVersion = resolveEngineVersion();
  }
  return engineVersion;
}
// move the existing body into: private static EngineVersion.Version resolveEngineVersion()

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 closed / 1 findings

🔴 High risk · Adding a release input that skips all releasability checks, including Quality Gate and Jira, could allow releases despite unmet safeguards.

Adds a skipJavascriptReleasabilityChecks override to sonar-release and pins ITS integration tests to the 2026.1 LTA via a shared DEV[2026.1] selector, with fast QA loading the scanner engine from the lightweight enterprise server ZIP. Consider caching the resolved LTA engine version in a static field in SonarScannerIntegrationHelper, since getEngineVersion() currently re-queries Artifactory on every call, adding serialized network round trips across about 20 test classes and risking inconsistent engine versions if a new 2026.1 build is promoted mid-run.

💡 Performance: LTA engine alias is re-resolved against Artifactory on every call

📄 its/plugin/fast-tests/src/test/java/com/sonar/javascript/it/plugin/SonarScannerIntegrationHelper.java:57-71 📄 its/plugin/fast-tests/src/test/java/com/sonar/javascript/it/plugin/SonarScannerIntegrationHelper.java:109

getEngineVersion() runs from the static SERVER_CONTEXT initializer of about 20 test classes, both through getContext() and directly. With the default DEV[2026.1], every call builds a new PackagingResolver and calls resolve(). That goes through locators.maven().resolveVersion(...) to DefaultArtifactory, which sends an api/search/versions HTTP request each time. Orchestrator caches the downloaded ZIP but not the alias-to-version lookup (DefaultArtifactory.java, PackagingResolver.java).

So each fast-QA JVM makes about 20 serialized network round trips, and the synchronized lock makes test classes wait on each other. If a new 2026.1 build is promoted during a run, different test classes in the same run can also get different scanner engines. Because the method is already synchronized, storing the result in a static field once fixes both problems.

Memoize the resolved engine for the JVM lifetime (method is already synchronized).
private static EngineVersion.Version engineVersion;

public static synchronized EngineVersion.Version getEngineVersion() {
  if (engineVersion == null) {
    engineVersion = resolveEngineVersion();
  }
  return engineVersion;
}
// move the existing body into: private static EngineVersion.Version resolveEngineVersion()
🤖 Prompt for agents
Code Review: Adds a `skipJavascriptReleasabilityChecks` override to `sonar-release` and pins ITS integration tests to the 2026.1 LTA via a shared `DEV[2026.1]` selector, with fast QA loading the scanner engine from the lightweight enterprise server ZIP. Consider caching the resolved LTA engine version in a static field in `SonarScannerIntegrationHelper`, since `getEngineVersion()` currently re-queries Artifactory on every call, adding serialized network round trips across about 20 test classes and risking inconsistent engine versions if a new 2026.1 build is promoted mid-run.

1. 💡 Performance: LTA engine alias is re-resolved against Artifactory on every call
   Files: its/plugin/fast-tests/src/test/java/com/sonar/javascript/it/plugin/SonarScannerIntegrationHelper.java:57-71, its/plugin/fast-tests/src/test/java/com/sonar/javascript/it/plugin/SonarScannerIntegrationHelper.java:109

   `getEngineVersion()` runs from the static `SERVER_CONTEXT` initializer of about 20 test classes, both through `getContext()` and directly. With the default `DEV[2026.1]`, every call builds a new `PackagingResolver` and calls `resolve()`. That goes through `locators.maven().resolveVersion(...)` to `DefaultArtifactory`, which sends an `api/search/versions` HTTP request each time. Orchestrator caches the downloaded ZIP but not the alias-to-version lookup ([DefaultArtifactory.java](https://github.com/SonarSource/orchestrator/blob/6.4.4.4797/sonar-orchestrator-locators/src/main/java/com/sonar/orchestrator/locator/DefaultArtifactory.java#L64-L102), [PackagingResolver.java](https://github.com/SonarSource/orchestrator/blob/6.4.4.4797/sonar-orchestrator/src/main/java/com/sonar/orchestrator/server/PackagingResolver.java)).
   
   So each fast-QA JVM makes about 20 serialized network round trips, and the `synchronized` lock makes test classes wait on each other. If a new 2026.1 build is promoted during a run, different test classes in the same run can also get different scanner engines. Because the method is already `synchronized`, storing the result in a static field once fixes both problems.

   Fix (Memoize the resolved engine for the JVM lifetime (method is already synchronized).):
   private static EngineVersion.Version engineVersion;
   
   public static synchronized EngineVersion.Version getEngineVersion() {
     if (engineVersion == null) {
       engineVersion = resolveEngineVersion();
     }
     return engineVersion;
   }
   // move the existing body into: private static EngineVersion.Version resolveEngineVersion()

Verification Rules 2/2 met PRs 1 inspected

Functional validation No results

Rules 2 passed 1 not applicable

✅ Internal artifact registries
✅ Repository license compliance

Broader impact PRs 1 inspected
Cross-PR 1 PR inspected 0 open impacts

PR 8212: JS-2714 Ship Node.js runtime binaries as an on-demand resources ZIP instead of bundling them in the JAR Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

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

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

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

@datadog-sonarsource

This comment has been minimized.

@vdiez
vdiez merged commit db333e4 into branch-11-X Oct 23, 2026
71 of 74 checks passed
@vdiez
vdiez deleted the codex/release-releasability-11-x branch October 23, 2026 11:56
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