`--skip-git-metadata-upload` behavior broken in datadog-ci@2.19.0
joseph-galindo opened this issue · 3 comments
Bug description
Prior to datadog-ci@2.19.0
, commands like
$ pnpx @datadog/datadog-ci@2.18.1 junit upload --skip-git-metadata-upload [...options]
would work and was fully supported.
Starting with datadog-ci@2.19.0
however, the same commands break:
$ pnpx @datadog/datadog-ci@2.19.0 junit upload --skip-git-metadata-upload [...options]
Unknown Syntax Error: Not enough arguments to option --skip-git-metadata-upload.
Describe what you expected
Expected:
--skip-git-metadata-upload
to be supported, based on these docs
--skip-git-metadata-upload
(default:true
): if you want to upload git metadata, you may pass--skip-git-metadata-upload=0
or--skip-git-metadata-upload=false
.
Actual:
--skip-git-metadata-upload
behavior is changed/broken. Starting with @datadog/datadog-ci@2.19.0
, it must instead be specified as --skip-git-metadata-upload=true
Steps to reproduce the issue
Expected behavior repro:
$ pnpm i @datadog/datadog-ci@2.18.1
$ pnpm run dd version
> project@ dd /Users/joseph.galindo/project
> datadog-ci "version"
v2.18.1
$ DD_API_KEY=fake-key pnpm run dd junit upload --skip-git-metadata-upload --service fake-service --tags fake-appname --tags type:faketype --env fake-env fake-service fake-file-path
> project@ dd /Users/joseph.galindo/project
> datadog-ci "junit" "upload" "--skip-git-metadata-upload" "--service" "fake-service" "--tags" "fake-appname" "--tags" "type:faketype" "--env" "fake-env" "fake-service" "fake-file-path"
Starting upload with concurrency 20.
Will look for jUnit XML files in fake-service, fake-file-path
service: fake-service
✅ Uploaded 0 files in 0 seconds.
=================================================================================================
* View detailed reports on Datadog (they can take a few minutes to become available)
* Commit report:
* REDACTED
=================================================================================================
Actual behavior repro:
$ pnpm i @datadog/datadog-ci@2.19.0
$ pnpm run dd version
> project@ dd /Users/joseph.galindo/project
> datadog-ci "version"
v2.19.0
$ DD_API_KEY=fake-key pnpm run dd junit upload --skip-git-metadata-upload --service fake-service --tags fake-appname --tags type:faketype --env fake-env fake-service fake-file-path
> project@ dd /Users/joseph.galindo/project
> datadog-ci "junit" "upload" "--skip-git-metadata-upload" "--service" "fake-service" "--tags" "fake-appname" "--tags" "type:faketype" "--env" "fake-env" "fake-service" "fake-file-path"
Unknown Syntax Error: Not enough arguments to option --skip-git-metadata-upload.
$ datadog-ci junit upload [--verbose] [--dry-run] [--env #0] [--logs] [--max-concurrency #0] [--metrics #0] [--service #0] [--tags #0] [--report-tags #0] [--report-metrics #0] [--xpath-tag #0] [--git-repository-url #0] [--skip-git-metadata-upload #0] <basePaths> ...
ELIFECYCLE Command failed with exit code 1.
v2.19.0 example showing that --skip-git-metadata-upload=true
is now required to avoid errors:
$ pnpm i @datadog/datadog-ci@2.19.0
$ pnpm run dd version
> project@ dd /Users/joseph.galindo/project
> datadog-ci "version"
v2.19.0
$ DD_API_KEY=fake-key pnpm run dd junit upload --skip-git-metadata-upload=true --service fake-service --tags fake-appname --tags type:faketype --env fake-env fake-service fake-file-path
> project@ dd /Users/joseph.galindo/project
> datadog-ci "junit" "upload" "--skip-git-metadata-upload=true" "--service" "fake-service" "--tags" "fake-appname" "--tags" "type:faketype" "--env" "fake-env" "fake-service" "fake-file-path"
Starting upload with concurrency 20.
Will look for jUnit XML files in fake-service, fake-file-path
service: fake-service
✅ Uploaded 0 files in 0 seconds.
=================================================================================================
* View detailed reports on Datadog (they can take a few minutes to become available)
* Commit report:
* REDACTED
=================================================================================================
Additional context
Environment
- MacOS Ventura 13.6.5
- NodeJS v20.10.0
- pnpm 8.12.0
Github history
- I think at its root this is a validator bug introduced in v2.19.0
- Specifically I think the related line is https://github.com/DataDog/datadog-ci/blame/master/src/commands/junit/upload.ts#L131
- And the related PR is #1021
- It's also worth noting that #1021 is not mentioned in the v2.18.1 or v2.19.0 release notes. I ended up doing manual test runs from 2.18.0+ until I was able to repro in 2.19.0
Command
junit
Hi @joseph-galindo, thanks for reporting this, it's indeed because of the clipanion migration... and sorry, indeed it was not showing in the release notes (human error). I just edited the release notes to make that PR appear on it.
Working on a fix 🙇
The PR will be in the next release! 😉
Thank you!