Azure-Samples / contoso-real-estate

Intelligent enterprise-grade reference architecture for JavaScript, featuring OpenAI integration, Azure Developer CLI template and Playwright tests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Chore] CICD versus local dev for post-create-command

dfberry opened this issue · comments

When starting container locally, I get the following required manual input while the post-create-command is running. How does CICD handle this? Does it finish correctly?

image

I did notice that the .devcontainer and root package.json are out of sync for node but it seems to work locally and I can manually enter 'y' locally, just not sure how CICD handles this.

This means that we are calling npx playwright somewhere. Is this the recommended approach?

Looks like passing --yes to nox would help here: https://docs.npmjs.com/cli/v8/commands/npx#description

I forked the project and tried to open main using codespaces and end up in the same place @dfberry mentioned. Ctrl-shift-p to Codespaces: View Creation Log shows the following spew (just the tail). It looks like things are stuck on a, "Ok to proceed?" prompt and there's no way for me to respond.

...
65 packages can be upgraded. Run 'apt list --upgradable' to see them.
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: npm@10.4.0
npm ERR! notsup Not compatible with your version of node/npm: npm@10.4.0
npm ERR! notsup Required: {"node":"^18.17.0 || >=20.5.0"}
npm ERR! notsup Actual: {"npm":"9.5.0","node":"v18.15.0"}

npm ERR! A complete log of this run can be found in:
npm ERR! /home/node/.npm/_logs/2024-02-06T21_23_34_708Z-debug-0.log
Need to install the following packages:
playwright@1.41.2
Ok to proceed? (y)

Hi @jeffvan98 would mind editing your /.devcontainer/post-create-command.sh and let me know if that helps.

You can change this line:

npx playwright install --with-deps

to this:

npx --yes playwright install --with-deps

Note the --yes right after npx. You will also need to rebuild your devcontainer.

Fixed in #437