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

Packer-Images: bug within updatecli to update goss since exclusion of windows 2019 for vsstudio #4090

Closed
smerle33 opened this issue May 13, 2024 · 5 comments
Assignees
Labels

Comments

@smerle33
Copy link
Contributor

Service(s)

Other

Summary

since jenkins-infra/packer-images@7a2b820 (#1143) that is able to exclude windows 2022 but still test windows 2019
the updatecli process fail as the yaml file is no longer a correct yaml.

Reproduction steps

No response

@smerle33
Copy link
Contributor Author

smerle33 commented May 14, 2024

when using the scalar block:

skip: |
    {{ not (eq .Env.AGENT_OS_VERSION "2019") }}

updatecli is not complaining anymore and the yaml parsing go through
HOWEVER the goss templating is falling :

yaml: unmarshal errors:
 line 62: cannot unmarshal !!str `false
` into bool

if I put it back on one line:

skip: {{ not (eq .Env.AGENT_OS_VERSION "2019") }}

goss is working fine but then updatecli complain:

ERROR: something went wrong in target "updateJDK21VersionInGoss" : "updating yaml file: parsing yaml file: [62:12] unexpected mapping key\n      59 |     exit-status: 0\n      60 |     stdout:\n      61 |       - /16\\.\\d+\\.\\d+\\.\\d+/\n    > 62 |     skip: {{ not (eq .Env.AGENT_OS_VERSION \"2019\") }}\n                      ^\n      63 | file:\n      64 |   C:\\Program Files\\Chromium\\Application\\:\n      65 |     contains: []"

which is weird as the yaml file is seen as good with yaml online parser ... maybe this is coming from the library used by updatecli to parse yaml: https://github.com/goccy/go-yaml or a wrong behavior from goss

EDIT: setting yamlpath as the updatecli yaml engine solve the problem, but it need to be done on each file updating the goss yaml file.

I did open an issue on goss : goss-org/goss#913

@smerle33
Copy link
Contributor Author

for now the updatecli is more important for us to keep our image uptodate so I kept the scalar block version even if it mean to skip the goss test for visualstudio

@smerle33
Copy link
Contributor Author

lock on the exec for windows not behaving correctly :

[2024-05-17T14:18:59.052Z] �[0;32m2024-05-17T14:18:58Z:     azure-arm.windows: ......FF...................�[0m
[2024-05-17T14:18:59.052Z] �[1;31m2024-05-17T14:18:58Z: ==> azure-arm.windows: 2024-05-17T14:18:57Z [DEBUG][Command][visualstudio][stderr]  'C:\Program' is not recognized as an internal or external command,�[0m
[2024-05-17T14:18:59.052Z] �[0;32m2024-05-17T14:18:58Z:     azure-arm.windows:�[0m
[2024-05-17T14:18:59.052Z] �[1;31m2024-05-17T14:18:58Z: ==> azure-arm.windows: 2024-05-17T14:18:57Z [DEBUG][Command][visualstudio][stderr]  operable program or batch file.�[0m
[2024-05-17T14:18:59.052Z] �[1;31m2024-05-17T14:18:58Z: ==> azure-arm.windows: 2024-05-17T14:18:57Z [DEBUG][Command][visualstudio][stderr]�[0m
[2024-05-17T14:18:59.052Z] �[0;32m2024-05-17T14:18:58Z:     azure-arm.windows: Failures/Skipped:�[0m
[2024-05-17T14:18:59.052Z] �[0;32m2024-05-17T14:18:58Z:     azure-arm.windows:�[0m

@smerle33
Copy link
Contributor Author

smerle33 commented May 21, 2024

last error : The filename, directory name, or volume label syntax is incorrect

18:57:22  
2024-05-20T16:57:21Z: ==> azure-arm.windows: 2024-05-20T16:57:21Z [DEBUG][Command][visualstudio][stderr]  The filename, directory name, or volume label syntax is incorrect.

18:57:22  
2024-05-20T16:57:21Z: ==> azure-arm.windows: 2024-05-20T16:57:21Z [DEBUG][Command][visualstudio][stderr]

with :

exec: "'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe' -nologo -version"

@smerle33
Copy link
Contributor Author

working using () and " :

exec: ("C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe" "/nologo" "/version")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants