Skip to content

SLVS-1239 Migrate user notifications to Sloop #5745

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/Integration.UnitTests/SLCore/SLCoreConstantsProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ public void ClientConstants_ShouldBeExpected()
public void FeatureFlags_ShouldBeExpected()
{
var testSubject = CreateTestSubject();
var expectedFeatureFlags = new FeatureFlagsDto(true, true, true, true, false, false, true, true, true);
var expectedFeatureFlags = new FeatureFlagsDto(
shouldManageSmartNotifications: true,
taintVulnerabilitiesEnabled: true,
shouldSynchronizeProjects: true,
shouldManageLocalServer: true,
enableSecurityHotspots:true,
shouldManageServerSentEvents:false,
enableDataflowBugDetection:false,
shouldManageFullSynchronization:true,
enableTelemetry:true,
canOpenFixSuggestion:true);
var actual = testSubject.FeatureFlags;

actual.Should().BeEquivalentTo(expectedFeatureFlags);
Expand Down
12 changes: 11 additions & 1 deletion src/Integration/SLCore/SLCoreConstantsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ public SLCoreConstantsProvider(IVsInfoProvider vsInfoProvider)

public ClientConstantsDto ClientConstants => new(vsInfoProvider.Name, $"SonarLint Visual Studio/{VersionHelper.SonarLintVersion}", Process.GetCurrentProcess().Id);

public FeatureFlagsDto FeatureFlags => new(true, true, true, true, false, false, true, true, true);
public FeatureFlagsDto FeatureFlags => new(
shouldManageSmartNotifications:true,
taintVulnerabilitiesEnabled:true,
shouldSynchronizeProjects:true,
shouldManageLocalServer:true,
enableSecurityHotspots:true,
shouldManageServerSentEvents:false,
enableDataflowBugDetection:false,
shouldManageFullSynchronization:true,
enableTelemetry:true,
canOpenFixSuggestion:true);

public TelemetryClientConstantAttributesDto TelemetryConstants => new("visualstudio", "SonarLint Visual Studio", VersionHelper.SonarLintVersion, VisualStudioHelpers.VisualStudioVersion, new Dictionary<string, object>
{
Expand Down
2 changes: 1 addition & 1 deletion src/SLCore.IntegrationTests/SLCoreTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void Start()
var constantsProvider = Substitute.For<ISLCoreConstantsProvider>();
constantsProvider.ClientConstants.Returns(new ClientConstantsDto("SLVS_Integration_Tests",
$"SLVS_Integration_Tests/{VersionHelper.SonarLintVersion}", Process.GetCurrentProcess().Id));
constantsProvider.FeatureFlags.Returns(new FeatureFlagsDto(true, true, false, true, false, false, true, false, false));
constantsProvider.FeatureFlags.Returns(new FeatureFlagsDto(false, true, true, false, true, false, false, true, false, false));
constantsProvider.TelemetryConstants.Returns(new TelemetryClientConstantAttributesDto("slvs_integration_tests", "SLVS Integration Tests",
VersionHelper.SonarLintVersion, "17.0", new()));
SetLanguagesConfigurationToDefaults(constantsProvider);
Expand Down
2 changes: 1 addition & 1 deletion src/SLCore.UnitTests/SLCoreInstanceHandleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class SLCoreInstanceHandleTests
private const string UserHome = "userHomeSl";

private static readonly ClientConstantsDto ClientConstants = new(default, default, default);
private static readonly FeatureFlagsDto FeatureFlags = new(default, default, default, default, default, default, default, default, default);
private static readonly FeatureFlagsDto FeatureFlags = new(default, default, default, default, default, default, default, default, default, default);
private static readonly TelemetryClientConstantAttributesDto TelemetryConstants = new(default, default, default, default, default);

private static readonly SonarQubeConnectionConfigurationDto SonarQubeConnection1 = new("sq1", true, "http://localhost/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void Serialize_AsExpected()
var testSubject = new InitializeParams(
new ClientConstantsDto("TESTname", "TESTagent", 11223344),
new HttpConfigurationDto(new SslConfigurationDto()),
new FeatureFlagsDto(false, true, false, true, false, true, false, false, false),
new FeatureFlagsDto(true, false, true, false, true, false, true, false, false, false),
"storageRoot",
"workDir",
["myplugin1", "myplugin2"],
Expand Down Expand Up @@ -69,6 +69,7 @@ [new SonarCloudConnectionConfigurationDto("con2", false, "organization1")],
"sslConfiguration": {}
},
"featureFlags": {
"shouldManageSmartNotifications": true,
"taintVulnerabilitiesEnabled": false,
"shouldSynchronizeProjects": true,
"shouldManageLocalServer": false,
Expand Down
1 change: 1 addition & 0 deletions src/SLCore/Service/Lifecycle/Models/FeatureFlagsDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
namespace SonarLint.VisualStudio.SLCore.Service.Lifecycle.Models
{
public record FeatureFlagsDto(
bool shouldManageSmartNotifications,
bool taintVulnerabilitiesEnabled,
bool shouldSynchronizeProjects,
bool shouldManageLocalServer,
Expand Down