Skip to content

Reincorporating add package suggestions - #15019

Merged
sfoslund merged 2 commits into
dotnet:masterfrom
sfoslund:NuGetSuggestions
Jan 5, 2021
Merged

sfoslund merged 2 commits into
dotnet:masterfrom
sfoslund:NuGetSuggestions

Conversation

@sfoslund

@sfoslund sfoslund commented Dec 17, 2020 •

Copy link
Copy Markdown
Member

Fixes #15013

This is not a new addition, suggestions were lost when I switched to using system.command line in #14379 and I'm adding them back here. I added a test in this PR to ensure suggestions are not empty.

@sfoslund
sfoslund requested a review from a team as a code owner December 17, 2020 18:15
@aortiz-msft

Copy link
Copy Markdown
Contributor

Could you please add a PR description including what the change is and how it was validated?

@aortiz-msft aortiz-msft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add a PR description. I have added @dominoFire who owns the CLI for NuGet.

@sfoslund

Copy link
Copy Markdown
Member Author

Sure, just updated the description.

@sfoslund

Copy link
Copy Markdown
Member Author

Not sure why the test is failing occasionally unless we're QueryNuGet is failing. @dominoFire it looks like there aren't retries or anything, so do you think we need to have this test and if so is there a way to make it more reliable?

@dominoFire

dominoFire commented Jan 4, 2021 •

Copy link
Copy Markdown

Not sure why the test is failing occasionally unless we're QueryNuGet is failing. @dominoFire it looks like there aren't retries or anything, so do you think we need to have this test and if so is there a way to make it more reliable?

@sfoslund There's a good chance for flakiness in NuGetProvidesSuggestionsForAddPackages test, since it depends on an external service (nuget.org).

My recommendations are:

  1. Disable the test and create a follow up issue to test the whole command.
  2. Add a test for AddPackageParser.QueryNuGet()
  3. Refactor AddPackageParser.QueryNuGet() to include an injectable NuGet endpoint
  4. Create a temporary mocked http server to test the functionality.

Let me know what do you think.

@sfoslund

sfoslund commented Jan 4, 2021

Copy link
Copy Markdown
Member Author

@dominoFire thanks for taking a look, that test was added in this PR so if you think it's unnecessary I can definitely remove it. Since I didn't make any changes to QueryNuget itself I'm not sure I have a sufficient understanding to test it.

I think it's probably fine to remove this test and make this change without any test coverage, this issue only appeared because we completely switched out the parser which hopefully won't happen again for a long time :)

@dominoFire

Copy link
Copy Markdown

@sfoslund I'm OK with removing the test (NuGetProvidesSuggestionsForAddPackages). Don't forget to create a follow-up issue.

@sfoslund

sfoslund commented Jan 5, 2021

Copy link
Copy Markdown
Member Author

@aortiz-msft does anyone else need to review this PR or are we good to merge?

@dominoFire

Copy link
Copy Markdown

Tested by hand with dotnet complete. It works

@aortiz-msft

Copy link
Copy Markdown
Contributor

@aortiz-msft does anyone else need to review this PR or are we good to merge?

I think we are good from our side. Thanks for checking.

@sfoslund
sfoslund merged commit 80c457d into dotnet:master Jan 5, 2021
@sfoslund
sfoslund deleted the NuGetSuggestions branch January 5, 2021 23:25
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.

"dotnet add package Micr" tab completion doesn't work in .NET 6

3 participants