Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Port CLI tools to be global tools [Breaking change] #370

Merged
merged 1 commit into from
Dec 29, 2017

Conversation

natemcmaster
Copy link
Contributor

@natemcmaster natemcmaster commented Dec 12, 2017

⚠️ this will be a breaking change for some users because it drops support for tools working as a DotNetCliToolReference. The current design of CLI global tools does not allow structuring a package that supports both DotNetCliToolReference and the new dotnet install tool verb. Update: we are going to use new package IDs, instead of attempting to update existing ones.

Resolves #368

Ports our command-line tools to support global CLI commands.

The following NEW packages are created by this PR. Old packages won't be upgraded to support global tools.

Old Package ID (DotNetCliToolRefererence) New Package ID (dotnet install tool)
Microsoft.DotNet.Watcher.Tools dotnet-watch
Microsoft.Extensions.SecretManager.Tools dotnet-user-secrets
Microsoft.Extensions.Caching.SqlConfig.Tools dotnet-sql-cache
Microsoft.AspNetCore.DeveloperCertificates.Tools (* has never shipped) dotnet-dev-certs

cc @livarcocc @wli3 @DamianEdwards @glennc

Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

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

Looks good to me. It's missing the dev-certs rename.

@natemcmaster
Copy link
Contributor Author

I decided to keep the rename separate from the global-tool conversion: #371

@natemcmaster
Copy link
Contributor Author

cc @bricelam for dotnet-ef

@DamianEdwards
Copy link
Member

We need to discuss the breaking nature of this. I'm not ready to say this is OK, we might need to consider retiring the project tool packages and put the global tools in new packages, or something else.

@natemcmaster
Copy link
Contributor Author

natemcmaster commented Dec 13, 2017

Talked a little in person with @DamianEdwards. We think new package IDs is probably the best way to help users manage this big change.

The install gesture will be dotnet install tool <PackageId>, so the shorter the ID the better.
Here are some ideas for new package IDs we could use:

dotnet-*

  • dotnet-watch
  • dotnet-user-secrets
  • dotnet-ef (cc @divega)
  • dotnet-dev-certs

Microsoft.Tool.*

  • Microsoft.Tool.Watch
  • Microsoft.Tool.UserSecrets
  • Microsoft.Tool.EFCore
  • Microsoft.Tool.DevCerts

Microsoft.DotNet.Tool.*

Same as above, just with a longer prefix "Microsoft.DotNet.Tool"

Thoughts @DamianEdwards @muratg @Eilon @ajcvickers @divega @glennc ?

@DamianEdwards
Copy link
Member

I'm leaning towards the very short names, e.g. dotnet-watch. I think it's time.

@natemcmaster
Copy link
Contributor Author

+1 for short names

@bricelam
Copy link

As I've been trying to do for years, I'd like to package all of EF's global tools inside the Microsoft.EntityFrameworkCore.Tools package. Ultimately, we may have two tools: dotnet-ef for working with projects on the dev box, and ef for working with assemblies on the server. (in addition to the PMC tools)

@bricelam
Copy link

bricelam commented Dec 13, 2017

Have we talked to other tool builders about packaging/naming? I imagine there are some other toolchains that want to (eventually) ship multiple tools in a single package...

@natemcmaster
Copy link
Contributor Author

So far, the global tools discussion has been mostly done internally. I don't think we've looped in external contributors into the discussion yet.

I also would like to see enough flexibility in the global tools design to allow multiple tools in one package, and re-using a runtime package as a tool package, but the current design wouldn't allow that.

@bricelam
Copy link

multiple tools in one package

This is on their radar for the future, right?

re-using a runtime package as a tool package

What's preventing this now?

@natemcmaster
Copy link
Contributor Author

natemcmaster commented Dec 19, 2017

Per discussion this afternoon, I've updated the PR to include the rename of the package ID. The following NEW packages are created by this PR. Old packages won't be upgraded to support global tools.

Old Package ID (DotNetCliToolRefererence) New Package ID (dotnet install tool)
Microsoft.DotNet.Watcher.Tools dotnet-watch
Microsoft.Extensions.SecretManager.Tools dotnet-user-secrets
Microsoft.Extensions.Caching.SqlConfig.Tools dotnet-sql-cache
Microsoft.AspNetCore.DeveloperCertificates.Tools (* has never shipped) dotnet-dev-certs

@divega
Copy link

divega commented Dec 19, 2017

@natemcmaster sorry for the belated response. I think this is reasonable given all the constraints. It seems if we stick to this naming convention it should be easier to discover what to do when a tool I want to run is not installed. We could even consider improving the error you get from the CLI to say "missing a global tool? Try dotnet install -g dotnet-xyz" (or whatever the command is for installing it).

Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

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

Signing off for the dev-cert parts. I'll let @bricelam sign-off for the EF tools, but everything else looks good to me.

@natemcmaster
Copy link
Contributor Author

Two infrastructure issues we should resolve before we merge this:

@natemcmaster
Copy link
Contributor Author

Updated the "packageType" value to DotnetGlobalTool. This is just a placeholder value. The spec hasn't defined-yet what the value should be.

@wli3
Copy link

wli3 commented Dec 19, 2017

FYI package type issue is here NuGet/Home#6198

@natemcmaster
Copy link
Contributor Author

Thanks. I updated to "DotnetTool" per this comment https://github.com/dotnet/designs-microsoft/pull/12#discussion_r157843056

@natemcmaster
Copy link
Contributor Author

Added infrastructure improvements to allow us to sign our own assemblies, 3rd-party sign JSON.NET, and skip signing for assemblies that come from the dotnet-core team (should already be signed). cref aspnet/BuildTools#531

- Rename package IDs to dotnet-watch, dotnet-user-secrets, and dotnet-sql-cache
- Change packaging layout to support dotnet-install-tool
- Change package metadata to DotnetTool
- Drop support for DotNetCliToolReference (those will continue to be available under previous package ID's)
- Rename project files and folders
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.

6 participants