Repository navigation
JS-2729 Allow release check override and track 2026.1 integration tests on 11.x - #8235
Conversation
| 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 |
There was a problem hiding this comment.
💡 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 👍 / 👎
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 💡 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
So each fast-QA JVM makes about 20 serialized network round trips, and the Memoize the resolved engine for the JVM lifetime (method is already synchronized).🤖 Prompt for agentsVerification Rules 2/2 met PRs 1 inspectedFunctional validation No results Rules 2 passed 1 not applicable
Broader impact PRs 1 inspectedCross-PR 1 PR inspected 0 open impacts
Auto-approval Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|





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
skipJavascriptReleasabilityChecksboolean insonar-release, defaulting tofalse. 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:
11.8.2.46359and the engine from the latest promoted LTA build,2026.1.7.133283.git diff --checkpassed.