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

VSCode issue when running show with no init'd project. #2296

Closed
RailokGit opened this issue May 23, 2023 · 2 comments · Fixed by #2379
Closed

VSCode issue when running show with no init'd project. #2296

RailokGit opened this issue May 23, 2023 · 2 comments · Fixed by #2379
Assignees
Labels
customer-reported identify a customer issue question vscode Visual Studio Code

Comments

@RailokGit
Copy link

Does this occur consistently?
Repro steps:

Action: azure-dev.views.workspace.application.resolve
Error type: 1
Error Message: Process 'azd show --no-prompt --cwd "/workspaces/openai-plu...' exited with code 1
Error: Error: loading environment: reading environment name: no default response for prompt 'Please enter a new environment name:'

Version: 0.6.0
OS: linux
OS Release: 5.4.0-1106-azure
Product: Visual Studio Code
Product Version: 1.78.2
Language: ru

Call Stack
ChildProcess.<anonymous> extension.
</details>
@ghost ghost added needs-triage For new issues customer-reported identify a customer issue question labels May 23, 2023
@rajeshkamal5050 rajeshkamal5050 added the vscode Visual Studio Code label May 23, 2023
@ghost ghost removed the needs-triage For new issues label May 23, 2023
@ellismg
Copy link
Member

ellismg commented May 23, 2023

From the error it sounds like this was happening when an environment had not yet been created for the project (so azd init has not yet been run).

I wonder what the behavior of azd show should be in this case. There is some information we can provide (like project structure) but we wouldn't be able to load any information about the resources themselves.

@ellismg ellismg changed the title title VSCode issue when running show with no init'd project. May 23, 2023
@bwateratmsft
Copy link
Contributor

We only run azd show if an azure.yaml file exists, so the workspace got at least that far. But without an environment I guess azd show errors.

I like the idea of having it output as much info as it can; no environment isn't unlike an environment that just hasn't been deployed yet.

@rajeshkamal5050 rajeshkamal5050 added this to the Gallium milestone Jun 1, 2023
@rajeshkamal5050 rajeshkamal5050 mentioned this issue Jun 6, 2023
@ellismg ellismg modified the milestones: Gallium, July 2023 - 1.1.0 Jun 6, 2023
ellismg added a commit to ellismg/azure-dev that referenced this issue Jun 8, 2023
Today, `azd show` is used by VS Code to get information about the
current project, both the services that make it up (and information
about where the code for these services is) as well as the target
resources (if we can determine them)

In the case where an environment didn't exist (which is hard to have
happen during a normal course of action, but possible if you manually
go mucking around in `.azure`) `azd show` would prompt the user if
they wanted to go create an environment.

This caused issues with the VS integration, since the editor would not
expect `azd` to prompt in this case.

`azd show` already handles the case where the infrastructure for a
project has not been deployed. This change extends this behavior so
that if for some reason we can not fetch the current environment, we
just return information about the services that we can discover

Fixes Azure#2296
Fixes Azure#851
@rajeshkamal5050 rajeshkamal5050 mentioned this issue Jun 12, 2023
ellismg added a commit that referenced this issue Jun 12, 2023
Today, `azd show` is used by VS Code to get information about the
current project, both the services that make it up (and information
about where the code for these services is) as well as the target
resources (if we can determine them)

In the case where an environment didn't exist (which is hard to have
happen during a normal course of action, but possible if you manually
go mucking around in `.azure`) `azd show` would prompt the user if
they wanted to go create an environment.

This caused issues with the VS integration, since the editor would not
expect `azd` to prompt in this case.

`azd show` already handles the case where the infrastructure for a
project has not been deployed. This change extends this behavior so
that if for some reason we can not fetch the current environment, we
just return information about the services that we can discover

Fixes #2296
Fixes #851
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported identify a customer issue question vscode Visual Studio Code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants