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

SLVS-1400 Add migration mechanism to separate connections from bindings #5696

Conversation

gabriela-trutan-sonarsource
Copy link
Contributor

@gabriela-trutan-sonarsource gabriela-trutan-sonarsource commented Sep 18, 2024

Implemented the migration and called it in the SonarLintDaemonPackage at the very beginning, because it should be performed as early as possible. This package is also called if solutions or folders are opened, or even none of them, which is desirable.

When the migration is performed for the first time, if you open a solution super fast, it might not actually be bound. But if you re-open the solution, then everything works as expected.

I did not find a workaround for this issue (even triggering the binding manually did not help, I guess because it was too early). But I don't think I should invest too much effort into this, as it will only happen once: when the migration is performed, after the first update.

@terraform-techuser terraform-techuser changed the title SLVS-1400 Add migration mechanism to separate connections from bindings SLVS-1400 Add migration mechanism to separate connections from bindings Sep 18, 2024
Copy link
Contributor

@vnaskos-sonar vnaskos-sonar left a comment

Choose a reason for hiding this comment

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

Just a small ordering comment, the other is up to your preference. 👍

@@ -112,6 +114,15 @@ private async Task InitAsync()
logger?.WriteLine(Strings.Daemon_InitializationComplete);
}

/// <summary>
/// This migration should be performed before initializing other services, independent if a solution or a folder is opened.
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel that this comment should be above the method usage as it's a warning about the order.

}

private async Task InitAsync()
{
try
{
await MigrateBindingsToServerConnectionsIfNeededAsync();
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be below the logger initialization and the initialization message.

[ThreadId 58] [Connection Migration] Start migrating connections from existing bindings
[ThreadId 58] [Connection Migration] The server connection with the id duncanp-sonar-test was not migrated as it already exists.
[ThreadId 58] Initializing the daemon package...

to

[ThreadId 58] Initializing the daemon package...
[ThreadId 58] [Connection Migration] Start migrating connections from existing bindings
[ThreadId 58] [Connection Migration] The server connection with the id duncanp-sonar-test was not migrated as it already exists.

Copy link

@gabriela-trutan-sonarsource gabriela-trutan-sonarsource merged commit 6ce73f1 into feature/new-connected-mode Sep 19, 2024
2 checks passed
@gabriela-trutan-sonarsource gabriela-trutan-sonarsource deleted the gt/binding-to-connection-migration branch September 19, 2024 11:57
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