Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
406 stars 195 forks source link

[codespaces] New repository does not detect presence of new .devcontainer/ files on azd init #964

Open danieljurek opened 1 year ago

danieljurek commented 1 year ago

Repro steps:

  1. New repository (must have some file to get to "codespaces" experience on GitHub)
  2. Launch codespaces in the repo (it doesn't have a template in it yet and no .devcontainer folder)
  3. Install azd
  4. Run azd init select a template, commit, push

Expected: vscode inside of codespaces warns about changes to .devcontainer and offers to rebuild container

Actual: no warning observed

Workarounds:

rajeshkamal5050 commented 1 year ago

Does is resolve if we restart/reload Codespaces?

rajeshkamal5050 commented 1 year ago

@danieljurek assuming this is not a blocker for the Codespaces release in Jan. Moving it to backlog.

vhvb1989 commented 1 year ago

Does is resolve if we restart/reload Codespaces?

Yes, if you do F1 + Reload window, VSCode would detect the changes.

But, IMHO, this the flow mentioned on this issue shouldn't be the common/expected way for using codespaces. This use case is asuming that, as a user, I would start by creating a new repository to launch codespaces, and it should be more common to start by cloning or forking a template (to create the new repo) and then just open that repo with codespaces.

There's also the case where I have an existing repo and I want to azd-fy it, but in that case, there's unlikely to think that a user would pick a template to be pulled into the existing repo (as the repo might already contain a .vscode folder and other files).

So, in general, I would close this issue advising folks to start by forking an azd template (either using fork or by using the use template option) and then opening it with codespaces

danieljurek commented 1 year ago

@bwateratmsft -- Can you point us to someone in vscode who can help here?

bwateratmsft commented 1 year ago

@chuxel @chrmarti can you take a look? Thanks!

Chuxel commented 1 year ago

We're not on the codespaces team, so cc: @jkeech @joshspicer @edgonmsft @craiglpeters since this would be in that extension.

joshspicer commented 1 year ago

We'll take a look. We have a watcher that should provide that 'Prompt for rebuild' when files are added to the .devcontainer folder. 👍

savannahostrowski commented 1 year ago

@joshspicer Have you had a chance to investigate this at all? Happy to transfer to the remote containers repo if that makes more sense!