Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Throw exception for missing dependencies #911

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Bouke
Copy link
Contributor

@Bouke Bouke commented Dec 13, 2019

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

feature

⤵️ What is the current behavior?

Missing packages are silently ignored when inspecting:

$ nuget inspect
Found 61 packages
Found 61 packages in use, 14 distinct, in 16 projects.
coverlet.msbuild, LibGit2Sharp, McMaster.Extensions.CommandLineUtils, Microsoft.CodeAnalysis.FxCopAnalyzers, Microsoft.NET.Test.Sdk, Newtonsoft.Json, NSubstitute, NuGet.CommandLine, NuGet.Protocol, NUnit, NUnit3TestAdapter, Octokit, SimpleInjector, System.Text.Encoding.CodePages
Found 0 possible updates
Found no package updates

C:\Program Files\dotnet\dotnet.exe (process 14792) exited with code 0.

🆕 What is the new behavior (if this is a feature change)?

An error is returned if there were missing packages during inspection.

$ nuget inspect
Found 61 packages
Found 61 packages in use, 14 distinct, in 16 projects.
coverlet.msbuild, LibGit2Sharp, McMaster.Extensions.CommandLineUtils, Microsoft.CodeAnalysis.FxCopAnalyzers, Microsoft.NET.Test.Sdk, Newtonsoft.Json, NSubstitute, NuGet.CommandLine, NuGet.Protocol, NUnit, NUnit3TestAdapter, Octokit, SimpleInjector, System.Text.Encoding.CodePages
Could not find package coverlet.msbuild.2.7.0 in these sources: file:///C:/Program Files (x86)/Microsoft SDKs/NuGetPackages/, https://dotnet.myget.org/F/roslyn/api/v3/index.json

C:\Program Files\dotnet\dotnet.exe (process 17888) exited with code -1.

💥 Does this PR introduce a breaking change?

Yes / no. inspect would silently ignore the problem. However update would fail, as a Nuget restore would also fail for missing packages. I think this is desirable, as inspect should handle situations where packages are missing.

🐛 Recommendations for testing

Add a non-existing package reference.

📝 Links to relevant issues/docs

🤔 Checklist before submitting

  • All projects build
  • Relevant documentation was updated

@Bouke
Copy link
Contributor Author

Bouke commented Dec 13, 2019

This fails some tests, due to the change in behaviour. I can change the tests to the new behaviour, but first wanted to know if you'd be willing to take this change?

@MarcBruins
Copy link
Member

Yes this looks like a informative change that clearly states if a package is missing to the user. Would be good if we could get this in!

@stale
Copy link

stale bot commented May 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 10, 2020
@Bouke
Copy link
Contributor Author

Bouke commented May 12, 2020

Why auto-close the PR?

@stale stale bot removed the wontfix label May 12, 2020
@AnthonySteele
Copy link
Member

This a a good change, can you rebase please?

@AnthonySteele
Copy link
Member

I wonder if we want to log all of the missing / unreachable packages.

@stale
Copy link

stale bot commented Aug 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 11, 2020
@Bouke
Copy link
Contributor Author

Bouke commented Aug 12, 2020

I can rebase the PR. Anything else that you want me to look into?

@stale stale bot removed the wontfix label Aug 12, 2020
@stale
Copy link

stale bot commented Nov 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 10, 2020
@Bouke
Copy link
Contributor Author

Bouke commented Nov 11, 2020

Why auto-close the PR?

@stale stale bot removed the wontfix label Nov 11, 2020
@Bouke
Copy link
Contributor Author

Bouke commented Nov 29, 2020

Ping @MarcBruins @AnthonySteele

@MarcBruins
Copy link
Member

Sorry but can you rebase again? After that i'll merge it in

@Bouke Bouke force-pushed the throw-exception-for-missing-packages branch 6 times, most recently from 5ae1daf to b6e59f9 Compare January 13, 2021 21:55
@Bouke
Copy link
Contributor Author

Bouke commented Jan 13, 2021

Happy to oblige! I've rebased the project and updated the relevant tests.

  • Please go over the tests as I've updated them to match the expected behaviour (throwing an error for missing packages instead of silently ignoring the package).
  • There's a test that keeps failing: ShouldFilterOutNonDotnetRepository. I'm not sure how my PR is affecting that test, please advice.
  • Finally there's the Windows build that fails to build. I don't think my changes are related to that build failure, please advice.

@Bouke
Copy link
Contributor Author

Bouke commented Jan 23, 2021

@MarcBruins can you give some pointers?

@stale
Copy link

stale bot commented Apr 23, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 23, 2021
@Bouke
Copy link
Contributor Author

Bouke commented Apr 23, 2021

Still waiting for feedback…

@stale stale bot removed the wontfix label Apr 23, 2021
@stale
Copy link

stale bot commented Jul 22, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 22, 2021
@Bouke
Copy link
Contributor Author

Bouke commented Jul 22, 2021

Still waiting for feedback…

@stale stale bot removed the wontfix label Jul 22, 2021
@msallin msallin self-assigned this Sep 20, 2021
@msallin
Copy link
Member

msallin commented Sep 20, 2021

@Bouke can you please rebase the branch on the latest master?

@Bouke Bouke force-pushed the throw-exception-for-missing-packages branch from b6e59f9 to 8397bb9 Compare September 20, 2021 18:50
@Bouke
Copy link
Contributor Author

Bouke commented Sep 20, 2021

@msallin sure, I just did.

@msallin
Copy link
Member

msallin commented Sep 20, 2021

@skolima fine with this? Then I will merge it.

@skolima
Copy link
Collaborator

skolima commented Sep 20, 2021

@msallin I'm offline for the night, I'll have a look tomorrow, if that's ok. I have free time tomorrow.

@msallin
Copy link
Member

msallin commented Sep 20, 2021

@msallin I'm offline for the night, I'll have a look tomorrow, if that's ok. I have free time tomorrow.

Sure! Enjoy!

@skolima
Copy link
Collaborator

skolima commented Sep 21, 2021

I'm only concerned how this interacts with #311 and #466 . NuKeeper should currently skip unversioned packages (yes, I know those went away now, but the tag without a version is still valid, even if unwise) and should skip packages with ranges specified (also not a particularly good idea when using any automated dependency upgrader, but hey). I realise both of those are quite niche corner cases, but I'm still not keen on breaking them. I haven't re-tested those interactions yet.

@Bouke
Copy link
Contributor Author

Bouke commented Sep 28, 2021

@skolima Are there any unit tests covering those cases?

Conceptually I expect a missing package to be something different from an unversioned package. So we should be able to tell the two apart and only throw in the first case.

@Bouke
Copy link
Contributor Author

Bouke commented Nov 16, 2021

@skolima I'm getting the impression my contributions are in vain. It's been open for close to 2 years now. On this PR but also various bugs the only interactions are me fighting with the stale bot to keep them open. I've already rebased this PR a few times on the master branch, only to see it linger further.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants