-
Notifications
You must be signed in to change notification settings - Fork 216
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
project: Use /
as path seperator in azure.yaml
#4263
Conversation
@vhvb1989 I didn't yet validate that this addresses the issue in GitHub, but based on what I understood from your investigation, it seemed like this is what we might want. Are you able to take the privates here and see if this addresses the issue as you understood it? |
Worked on my end.
Thank you @ellismg |
7f90091
to
83bcce9
Compare
Since we expect an `azd` project to be used across operating systems which use `/` and `\` as path seperators, we need a common way of writing paths in `azure.yaml` that works across both. In the path we supported using both `\` and `/` in `azure.yaml` (and went out ouf or way in the Aspire case to write the platform specific version during `init`) but in some cases this would lead to weird behavior when you then puth the project into GitHub actions and *nix runners would look for files that may not exist, due to the path seperator. To address this, we update our `ProjectConfig` yaml parsing and saving to assume forward slash seperated paths, and then use `filepath.FromSlash` and `filepath.ToSlash` on the boundaries. This means the data stored at runtime inside `ProjectConfig` is using the correct platform seperator, but when being saved to disk, we always use `/`. To support backwards compatability, for paths which have only `\` and no `/`, we treat as if they were written with `/` instead of `\` (and we will fix them up if we end up rewrting azure.yaml). Fixes Azure#3891
83bcce9
to
f6c53c3
Compare
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Since we expect an
azd
project to be used across operating systems which use/
and\
as path seperators, we need a common way of writing paths inazure.yaml
that works across both. In the path we supported using both\
and/
inazure.yaml
(and went out ouf or way in the Aspire case to write the platform specific version duringinit
) but in some cases this would lead to weird behavior when you then puth the project into GitHub actions and *nix runners would look for files that may not exist, due to the path seperator.To address this, we update our
ProjectConfig
yaml parsing and saving to assume forward slash seperated paths, and then usefilepath.FromSlash
andfilepath.ToSlash
on the boundaries. This means the data stored at runtime insideProjectConfig
is using the correct platform seperator, but when being saved to disk, we always use/
.To support backwards compatability, for paths which have only
\
and no/
, we treat as if they were written with/
instead of\
(and we will fix them up if we end up rewrting azure.yaml).Fixes #3891