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

Please don't remove pulumi env run [environment] shorthand #427

Open
EvanBoyle opened this issue Dec 23, 2024 · 0 comments
Open

Please don't remove pulumi env run [environment] shorthand #427

EvanBoyle opened this issue Dec 23, 2024 · 0 comments
Labels
kind/enhancement Improvements or new features

Comments

@EvanBoyle
Copy link
Contributor

EvanBoyle commented Dec 23, 2024

I recently noticed this deprecation message after updating from an older version of the CLI:

$ pulumi env run ai-dev pnpm dev 
Warning: Referring to an environment name ('ai-dev') without a project is deprecated.
Please use 'cortexclick/default/ai-dev' or 'default/ai-dev' instead.

I don't make use of the project structure (everything is in default) and I am really not excited about having to type out default/[env] every time I want to invoke the CLI. It just feels like an unnecessary inconvenience.

Today pulumi env run [environment] is just an alias to default-org/default/environment which is unambiguous.

This code even suggests that it is unambiguous and that this format is marked as "legacy":

esc/cmd/esc/cli/env.go

Lines 113 to 125 in e9e5988

hasAmbiguousPath := false
orgName = cmd.esc.account.DefaultOrg
projectName = client.DefaultProject
isUsingLegacyID := false
parts := strings.Split(refStr, "/")
switch l := len(parts); {
case l == 1:
// <environment-name>
envNameAndVersion = parts[0]
isUsingLegacyID = true

I'd love to get a clear picture of why this had to be marked as legacy and removed. I tried digging through some PRs, but I couldn't really find anything in issues or PR descriptions that outlined the rationale for the change. Closest thing I found was this PR comment:

#369 (comment)

My closest guess is that you all don't want people accidentally creating envs in the default project, or unexpectedly opening a env that exists in both default and another project. I can understand that, but I am not at the scale where I need or care about projects. I just don't want to unnecessarily type stuff every time - especially if there isn't a problem with ambiguity and the goal is to just protect me from myself.

Is there a happy medium here? Maybe support could be added for $PULUMI_ESC_DEFAULT_PROJECT so that the short commands can be kept?

@EvanBoyle EvanBoyle added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Dec 23, 2024
@komalali komalali removed the needs-triage Needs attention from the triage team label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants