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-1378 Binding Dialog: Trigger binding #5695

Merged
merged 10 commits into from
Sep 19, 2024

Conversation

vnaskos-sonar
Copy link
Contributor

@vnaskos-sonar vnaskos-sonar commented Sep 18, 2024

The IUnintrusiveBindingController interface is internal,
which causes issues as it has to be accessed by the ConnectedMode
assembly. It's not possible to change it to public, because of the
access modifiers of its parameters. So the IBindingController is
added to overcome these limitations.
@vnaskos-sonar vnaskos-sonar changed the base branch from master to feature/new-connected-mode September 18, 2024 15:47
Copy link
Contributor

Choose a reason for hiding this comment

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

The binding does not seem to work (i.e. the suppressions and hotspots are not working in the sample project) if you completely delete the binding folder and try to bind with the new UI

@@ -33,10 +34,10 @@ public partial class ManageBindingDialog : Window
{
private readonly IConnectedModeServices connectedModeServices;

public ManageBindingDialog(IConnectedModeServices connectedModeServices, ISolutionInfoProvider solutionInfoProvider)
public ManageBindingDialog(IConnectedModeServices connectedModeServices, IBindingController bindingController, ISolutionInfoProvider solutionInfoProvider)

Choose a reason for hiding this comment

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

We already have the need to have more services than the ones provided by the IConnectedModeServices. Should we add another one that wraps the IBindingController and ISolutionInfoProvider?
It could have a name like "ConnectedModeBindingServices"

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 would leave that for a later stage on a separate PR when we finish adding new features, so we have a better view of what refactorings are needed.

@@ -247,4 +243,31 @@ internal bool LoadConnections()
BoundProject = SelectedProject;
return new AdapterResponse(BoundProject != null);
}

internal /* for testing */ async Task<AdapterResponse> BindAsync()

Choose a reason for hiding this comment

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

We don't need the comment /* for testing*/ as it is confusing. This is a code that is NOT used only for testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The BindAsync should have been private, but the architecture/design does not allow it to be testable (in this case due to the ProgressReporter.ExecuteTaskWithProgressAsync.)

The meaning of internal /* for testing */ is that this method is internal only for testing reasons. We have this in many places in the codebase, which also acts as a reminder for possible future improvements.

I'll keep it until we have a documented convention that cancels it out or a better solution.

Choose a reason for hiding this comment

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

I understand. I do find this solution unnecessary, though, so I will add it to the weekly discussion

src/ConnectedMode/Binding/IUnintrusiveBindingController.cs Outdated Show resolved Hide resolved
Copy link

Copy link
Contributor

Choose a reason for hiding this comment

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

I do have one comment. Otherwise the functionality seems to work now.

var connectionInformation = project.ServerConnection.Credentials.CreateConnectionInformation(project.ServerConnection.ServerUri);
await sonarQubeService.ConnectAsync(connectionInformation, cancellationToken);
await BindAsync(project, null, cancellationToken);
activeSolutionChangedHandler.HandleBindingChange(false);

Choose a reason for hiding this comment

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

I think we should add this to the other BindAsync overload, so that the BindWithMigrationAsync also has access to it

@vnaskos-sonar vnaskos-sonar merged commit 515857a into feature/new-connected-mode Sep 19, 2024
4 of 5 checks passed
@vnaskos-sonar vnaskos-sonar deleted the vn/bind branch September 19, 2024 13:53
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