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

Step without commands passes validation, but fails API upload #68

Open
toothbrush opened this issue Oct 31, 2023 · 0 comments
Open

Step without commands passes validation, but fails API upload #68

toothbrush opened this issue Oct 31, 2023 · 0 comments

Comments

@toothbrush
Copy link

I ran into an issue when my build pipeline accidentally included a named step that lacked a command or other body. I whittled it down to this MWE:

# .buildkite/pipeline.yml
---
steps:
  - name: foo

I use buildkite-signed-pipeline, and what it shows me is the following:

~~~ Running commands
$ trap 'kill -- $$' INT TERM QUIT; buildkite-signed-pipeline upload
2023/10/31 02:19:03 Using secret from AWS SM arn:aws:secretsmanager:us-east-2:123:secret:/buildkite-agent/non-production/signed_pipeline-xyz
2023/10/31 02:19:03 $ buildkite-agent pipeline upload --dry-run
2023-10-31 02:19:03 INFO   Searching for pipeline config...
2023-10-31 02:19:03 INFO   Found config file ".buildkite/pipeline.yml"
2023-10-31 02:19:03 INFO   Updating BUILDKITE_COMMIT to "d34db33f"
2023-10-31 02:19:03 INFO   Reading pipeline config from STDIN
2023-10-31 02:19:04 ERROR  Unrecoverable error, skipping retries
2023-10-31 02:19:04 FATAL  Failed to upload and process pipeline: Pipeline upload rejected: Step is missing a type `{"name":"foo"}`
2023/10/31 02:19:04 exit status 1

I thought i'd be clever and introduce a JSON schema validation step using the jv tool, however it seems that your JSON schema doesn't prohibit the situation i describe:

$ jv -output detailed https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json ./.buildkite/pipeline.yml
{
  "valid": true
}

Is this behaviour expected? I would think the JSON schema should reject a pipeline the API will reject.

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

No branches or pull requests

1 participant