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

[BUG] Format executor fails when installed dotnet-format is out of date #202

Closed
bcallaghan-et opened this issue Oct 13, 2021 · 6 comments
Closed
Assignees

Comments

@bcallaghan-et
Copy link
Collaborator

Describe the bug
The 3rd-party tool dotnet-format recently published an update (5.1.250801). After this update, all of my dotnet lint targets started failing with the following error

Cannot add package. Manifest file already contains version 5.1.225507 of the package dotnet-format. Uninstall/install or edit manifest file C:\Users\bcallaghan\Source\Repos\etogy-workspace\.config\dotnet-tools.json to specify the new version 5.1.250801.

To Reproduce

  1. Specify an older version of dotnet-format in the dotnet-tools.json manifest file (e.g. 5.1.225507)
  2. Run the lint target of a dotnet project (e.g. nx lint my-dotnet-proj)

Expected behavior
The executor should properly handle out-of-date versions so that the lint target can still run.

Environment:

  • OS: Windows
  • Version: 0.11.0

Additional context
The error is directly caused by the redundant tool install before running dotnet-format. One possible strategy for handling out-of-date versions is to update to the latest version each time. Another possible strategy is to lock-in to a specific version (as Nx does with Angular) and avoid re-installing the tool after that.

@bcallaghan-et bcallaghan-et added bug Something isn't working needs-triage This issue has yet to be looked over by a core team member labels Oct 13, 2021
@AgentEnder
Copy link
Member

Hey Ben, this is similar to #179, but has a different root cause. They should probably be handled in the same PR.

Do you want to work on this? I'll assign it to you if so. Otherwise, I can take a look at this sometime this weekend.

@bcallaghan-et
Copy link
Collaborator Author

I can work on it this week. Which version strategy do you want to go with?

@AgentEnder
Copy link
Member

It should go something like this:

If already specified in json file, leave as is. (user can update there tools file to update)
If not, install latest.

Make sure to take a look at #179, as in .NET SDK 6+ we don't want to install the tool at all as it is part of the .NET SDK itself, unfortunately they also decided it was worth changing the --check argument so the syntax is different.

@AgentEnder AgentEnder added hacktoberfest-accepted needs-triage This issue has yet to be looked over by a core team member scope: core and removed needs-triage This issue has yet to be looked over by a core team member labels Oct 13, 2021
@AgentEnder
Copy link
Member

I'm not sure if you are participating in Hacktoberfest at all, but it holds a soft spot in my heart. This repo's participating so if you want the free shirt and stuff you'll be at least a quarter of the way there 😋

@AgentEnder AgentEnder removed the needs-triage This issue has yet to be looked over by a core team member label Oct 13, 2021
bcallaghan-et referenced this issue in Etogy/nx-dotnet Oct 14, 2021
Do not install the tool if it is already installed or if part of the SDK

Fixes #202
github-actions bot pushed a commit that referenced this issue Oct 14, 2021
## [1.4.3](v1.4.2...v1.4.3) (2021-10-14)

### Bug Fixes

* **core:** Check SDK and tool installation before running format command ([#204](#204)) ([3ad6291](3ad6291)), closes [#179](#179) [#202](#202)

Oct 14, 2021, 11:24 PM
@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 1.4.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants