-
Notifications
You must be signed in to change notification settings - Fork 77
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-1407 Integrate BoundServerProject with IBindingProcess #5655
SLVS-1407 Integrate BoundServerProject with IBindingProcess #5655
Conversation
|
||
namespace SonarLint.VisualStudio.ConnectedMode.Persistence; | ||
|
||
[ExcludeFromCodeCoverage] // todo remove https://sonarsource.atlassian.net/browse/SLVS-1408 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is added temporarily
@@ -29,32 +30,57 @@ namespace SonarLint.VisualStudio.ConnectedMode.Binding | |||
internal interface IUnintrusiveBindingController | |||
{ | |||
Task BindAsync(BoundSonarQubeProject project, IProgress<FixedStepsProgress> progress, CancellationToken token); | |||
Task BindAsync(BoundServerProject project, IProgress<FixedStepsProgress> progress, CancellationToken token); | |||
} | |||
|
|||
[Export(typeof(IUnintrusiveBindingController))] | |||
[PartCreationPolicy(CreationPolicy.NonShared)] | |||
internal class UnintrusiveBindingController : IUnintrusiveBindingController | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class & interface is the main thing about this PR
public BindCommandArgs(string projectKey, string projectName, ConnectionInformation connection) | ||
public BoundServerProject ProjectToBind { get; } | ||
|
||
public BindCommandArgs(BoundServerProject projectToBind) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the args as the new UI will operate with proper models
ed9e1b9
to
c5a6bab
Compare
|
||
return new BoundServerProject("Solution Name Placeholder", // todo https://sonarsource.atlassian.net/browse/SLVS-1422 | ||
public static BoundServerProject FromBoundSonarQubeProject(BoundSonarQubeProject boundProject, string localBindingKey = null, ServerConnection connection = null) => | ||
new(localBindingKey ?? "Solution Name Placeholder", // todo https://sonarsource.atlassian.net/browse/SLVS-1422 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task is already resolved. Was another task intended here? Maybe https://sonarsource.atlassian.net/browse/SLVS-1408
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't have been resolved. I think I mentioned it in one of the other PRs and the system thought it was resolved. I unresolved it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, there was a PR that was approved. Not sure why are we ressurecting the ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mixed it up with the other ticket, re-closed it. I will replace the comment, as it should point to the repository migration ticket.
@@ -27,17 +28,11 @@ namespace SonarLint.VisualStudio.ConnectedMode.Binding | |||
/// </summary> | |||
public class BindCommandArgs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can completely drop the BindCommandArgs class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will. Now it's there to cause less compile errors. I will add this to the description of the task for the cleanup
|
||
if (!serverConnectionsRepository.TryGet(proposedConnection.Id, out var connection)) | ||
{ | ||
if (!serverConnectionsRepository.TryAdd(proposedConnection)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should document here why we are adding the connection, in case it doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We add it because it doesn't exist and it's a migration process🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly that you should document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can rename the method to mention migration specifically.
@@ -29,32 +30,57 @@ namespace SonarLint.VisualStudio.ConnectedMode.Binding | |||
internal interface IUnintrusiveBindingController | |||
{ | |||
Task BindAsync(BoundSonarQubeProject project, IProgress<FixedStepsProgress> progress, CancellationToken token); | |||
Task BindAsync(BoundServerProject project, IProgress<FixedStepsProgress> progress, CancellationToken token); | |||
} | |||
|
|||
[Export(typeof(IUnintrusiveBindingController))] | |||
[PartCreationPolicy(CreationPolicy.NonShared)] | |||
internal class UnintrusiveBindingController : IUnintrusiveBindingController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this class called "Unintrusive"? Should we change the name? If not, maybe we should add a documentation to the interface to explain the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unintrusive = does not add anything into the csproj files or other git tracked files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes sense to leave a comment to explain a pre-existing naming convention. This is not the only class that uses Unintrusive
in it's name and It was not renamed in this PR. The word was introduced in version 7.0 to distinguish it from the Obsolete binding (IObsoleteBindingConfigurationProvider).
Quality Gate failedFailed conditions |
09c0e6a
into
feature/new-connected-mode
[SLVS-1407](https://sonarsource.atlassian.net/browse/SLVS-1407) Part of <!-- Only for standalone PRs without Jira issue in the PR title: * Replace this comment with Epic ID to create a new Task in Jira * Replace this comment with Issue ID to create a new Sub-Task in Jira * Ignore or delete this note to create a new Task in Jira without a parent --> [SLVS-1407]: https://sonarsource.atlassian.net/browse/SLVS-1407?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[SLVS-1407](https://sonarsource.atlassian.net/browse/SLVS-1407) Part of <!-- Only for standalone PRs without Jira issue in the PR title: * Replace this comment with Epic ID to create a new Task in Jira * Replace this comment with Issue ID to create a new Sub-Task in Jira * Ignore or delete this note to create a new Task in Jira without a parent --> [SLVS-1407]: https://sonarsource.atlassian.net/browse/SLVS-1407?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[SLVS-1407](https://sonarsource.atlassian.net/browse/SLVS-1407) Part of <!-- Only for standalone PRs without Jira issue in the PR title: * Replace this comment with Epic ID to create a new Task in Jira * Replace this comment with Issue ID to create a new Sub-Task in Jira * Ignore or delete this note to create a new Task in Jira without a parent --> [SLVS-1407]: https://sonarsource.atlassian.net/browse/SLVS-1407?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[SLVS-1407](https://sonarsource.atlassian.net/browse/SLVS-1407) Part of <!-- Only for standalone PRs without Jira issue in the PR title: * Replace this comment with Epic ID to create a new Task in Jira * Replace this comment with Issue ID to create a new Sub-Task in Jira * Ignore or delete this note to create a new Task in Jira without a parent --> [SLVS-1407]: https://sonarsource.atlassian.net/browse/SLVS-1407?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
SLVS-1407
Part of