Repository navigation
CLI-1521 CLI: Gate Architecture commands in SQS for 2026.6 onwards #1239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
madalin-antonoiu-sonarsource
merged 6 commits into
master
from
codex/sqs-architecture-version-gate
Nov 10, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bdfd383
SONARCH: Gate CLI architecture on supported SQS versions
madalin-antonoiu-sonarsource e3a430d
CLI-1521 Exclude Community Build from Architecture support
madalin-antonoiu-sonarsource 85024ee
CLI-1521 Clarify Community Build availability
madalin-antonoiu-sonarsource 098ba1c
CLI-1521 Name the Community Build version threshold
madalin-antonoiu-sonarsource 79d9474
CLI-1521 Verify unavailable version and API handling
madalin-antonoiu-sonarsource 7747dde
CLI-1521 Remove Server version from Cloud-only fixtures
madalin-antonoiu-sonarsource File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
tests/integration/specs/architecture/architecture-version.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| /* | ||
| * SonarQube CLI | ||
| * Copyright (C) SonarSource Sàrl | ||
| * mailto:info AT sonarsource DOT com | ||
| * | ||
| * This program is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU Lesser General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 3 of the License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public License | ||
| * along with this program; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
| import { describe, expect, it } from 'bun:test'; | ||
|
|
||
| import { TestHarness } from '../../harness'; | ||
|
|
||
| describe('Architecture Server version', () => { | ||
| it.each(['2025.1', '2026.5.4', '26.11'])( | ||
| 'rejects Architecture operations on Server %s', | ||
| async (version) => { | ||
| const h = await TestHarness.create(); | ||
| try { | ||
| const server = await h | ||
| .newFakeServer() | ||
| .withVersion(version) | ||
| .withAuthToken('test-token') | ||
| .withProject('shop', (p) => p.withArchitecture(() => undefined)) | ||
| .start(); | ||
| h.withAuth(server.baseUrl(), 'test-token'); | ||
| h.cwd.writeFile('intended.json', JSON.stringify({ models: [] })); | ||
| h.cwd.writeFile('directives.json', JSON.stringify({ create: [] })); | ||
| for (const command of [ | ||
| 'arch current get -p shop', | ||
| 'arch intended get -p shop', | ||
| 'arch intended set -p shop --file intended.json --dry-run', | ||
| 'arch directives get -p shop', | ||
| 'arch directives set -p shop --file directives.json --dry-run', | ||
| 'arch findings get -p shop', | ||
| ]) { | ||
| const result = await h.run(command); | ||
| expect(result.exitCode).toBe(1); | ||
| expect(result.stderr).toContain('2026.6 or later is required'); | ||
| if (version === '26.11') { | ||
| expect(result.stderr).toContain('Community Build 26.11 does not include Architecture'); | ||
| expect(result.stderr).toContain('Use SonarQube Server or SonarQube Cloud'); | ||
| } | ||
| } | ||
| expect( | ||
| server.getRecordedRequests().filter((r) => r.path.includes('/architecture/')), | ||
| ).toHaveLength(0); | ||
| } finally { | ||
| await h.dispose(); | ||
| } | ||
| }, | ||
| ); | ||
|
|
||
| it('keeps Cloud available regardless of the Server version', async () => { | ||
| const h = await TestHarness.create(); | ||
| try { | ||
| const server = await h | ||
| .newFakeServer() | ||
| .withVersion('2025.1') | ||
| .asSonarCloud() | ||
| .withAuthToken('test-token') | ||
| .withProject('shop', (p) => p.withArchitecture(() => undefined)) | ||
| .start(); | ||
| h.withAuth(server.recordedAuthServerUrl(), 'test-token', 'my-org'); | ||
| const result = await h.run('arch current get -p shop --language java --format json'); | ||
| expect(result.exitCode).toBe(0); | ||
| } finally { | ||
| await h.dispose(); | ||
| } | ||
| }); | ||
|
|
||
| it('uses the API compatibility check if the Server version cannot be read', async () => { | ||
| const h = await TestHarness.create(); | ||
| try { | ||
| const server = await h | ||
| .newFakeServer() | ||
| .withSystemStatusCode(503) | ||
| .withAuthToken('test-token') | ||
| .withProject('shop', (p) => p.withArchitecture(() => undefined)) | ||
| .start(); | ||
| h.withAuth(server.baseUrl(), 'test-token'); | ||
| const result = await h.run('arch current get -p shop --language java --format json'); | ||
| expect(result.exitCode).toBe(0); | ||
| expect(server.getRecordedRequests().some((r) => r.path.includes('/architecture/'))).toBe( | ||
| true, | ||
| ); | ||
| } finally { | ||
| await h.dispose(); | ||
| } | ||
| }); | ||
|
|
||
| it('reports an unavailable Architecture API when the Server version cannot be read', async () => { | ||
| const h = await TestHarness.create(); | ||
| try { | ||
| const server = await h | ||
| .newFakeServer() | ||
| .withSystemStatusCode(503) | ||
| .withAuthToken('test-token') | ||
| .withProject('shop', (p) => | ||
| p.withArchitecture((architecture) => | ||
| architecture.withStatus('current-architectures', 404, '{}', 'GET'), | ||
| ), | ||
| ) | ||
| .start(); | ||
| h.withAuth(server.baseUrl(), 'test-token'); | ||
| const result = await h.run('arch current get -p shop --language java --format json'); | ||
| expect(result.exitCode).toBe(1); | ||
| expect(result.stderr).toContain('The public Architecture API endpoint was not found'); | ||
| expect(result.stderr).toContain('Server build that exposes the public Architecture APIs'); | ||
| } finally { | ||
| await h.dispose(); | ||
| } | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.