Skip to content
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

SLVSCODE-1004 multi region support #681

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

sophio-japharidze-sonarsource
Copy link
Contributor

@sophio-japharidze-sonarsource sophio-japharidze-sonarsource commented Feb 5, 2025

@sophio-japharidze-sonarsource sophio-japharidze-sonarsource force-pushed the SLVSCODE-1004_multi-region-support branch from 6f2aa67 to fbc20a7 Compare February 7, 2025 11:02
@@ -319,3 +320,23 @@ export function getSeverity(severity: number): vscode.DiagnosticSeverity {
return vscode.DiagnosticSeverity.Warning;
}
}

export function sonarCloudRegionToLabel(region: number): SonarCloudRegion {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to implement the conversion here instead of the language server because I would have to rewrite several classes to achieve it there

@sophio-japharidze-sonarsource sophio-japharidze-sonarsource force-pushed the SLVSCODE-1004_multi-region-support branch from fbc20a7 to cc8dbf2 Compare February 7, 2025 11:16
Copy link
Member

@jblievremont jblievremont left a comment

Choose a reason for hiding this comment

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

Looks good from a functional point of view 👍🏻 please check my comments about the implementation 👀

return {
label: s.projectKey,
description: s.organization || s.serverUrl,
detail: s.organization ? 'SonarQube Cloud' : 'SonarQube Server'
detail: s.organization ? `[${s.region}] SonarQube Cloud` : 'SonarQube Server',
Copy link
Member

Choose a reason for hiding this comment

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

For consistency, is it OK to always have the region displayed here vs what is done for the tree view items?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the check for Dogfooding Environment. Otherwise, in this case user needs to make an explicit choice, so the more details we display the better (I think). Also, users ending up in this branch is quite a rare case (I think) :D .

@@ -601,6 +607,7 @@ export interface AssistCreatingConnectionParams {
isSonarCloud: boolean;
serverUrlOrOrganisationKey: string;
token: string;
region?: number;
Copy link
Member

Choose a reason for hiding this comment

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

Is this type expected here? Should it be the same as the one used in ConnectionSuggestion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In fact, the type in ConnectionSuggestion should be a number too. I decided to do the conversion completely on the client side.

src/util/dogfoodingUtils.ts Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
webview-ui/connectionsetup.js Outdated Show resolved Hide resolved
@sophio-japharidze-sonarsource sophio-japharidze-sonarsource force-pushed the SLVSCODE-1004_multi-region-support branch from 1103c2c to f48c08a Compare February 7, 2025 13:54
@sophio-japharidze-sonarsource sophio-japharidze-sonarsource force-pushed the SLVSCODE-1004_multi-region-support branch from f48c08a to 5e39b88 Compare February 7, 2025 14:00
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.

2 participants