Skip to content

fix: validate --env is not passed with an empty string#999

Merged
cjk7989 merged 3 commits into
Azure:mainfrom
monteiro-renato:main
Jul 16, 2026
Merged

fix: validate --env is not passed with an empty string#999
cjk7989 merged 3 commits into
Azure:mainfrom
monteiro-renato:main

Conversation

@monteiro-renato

Copy link
Copy Markdown
Contributor

Looks like the CLI accepts --env="", and the deployment seems to "work"; There were no error messages in the console at least.
Looking at the portal it doesn't seem like anything gets deployed however.

I am not exactly sure how I could dig deeper into what happens when the deployment code is actually running, but I guess adding this extra validation can't hurt.

@cjk7989

cjk7989 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Hi @monteiro-renato , thanks for the fix! The bug is real and worth addressing. A few concerns:

Validation fires too late

By the time this check runs (~line 258), line 190 has already printed:
Deploying to environment:

The validation should be moved to the top of the function alongside other input checks, before any logging or processing occurs.

Error message is slightly misleading

Users can specify any custom environment name, not just preview. Suggest:

"Use a named environment (e.g. 'preview') or omit the flag."

@monteiro-renato

Copy link
Copy Markdown
Contributor Author

@cjk7989, thanks for the review!
I've moved it upwards, let me know if there is anything else you would like me to change.

@cjk7989
cjk7989 merged commit 8a48576 into Azure:main Jul 16, 2026
20 checks passed
@cjk7989

cjk7989 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Looks good to me, approved. Thank you again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants