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

Schema vs Doc inconsistency regarding key vs identifier vs id attributes? #76

Closed
AliSoftware opened this issue Aug 22, 2024 · 5 comments · Fixed by #92
Closed

Schema vs Doc inconsistency regarding key vs identifier vs id attributes? #76

AliSoftware opened this issue Aug 22, 2024 · 5 comments · Fixed by #92

Comments

@AliSoftware
Copy link

The inconsistency

My understanding of the current state

I believe the doc is correct, as it matches the behavior we see in practice.

My guess is that maybe (?) key was named id/identifier a long time ago, but Buildkite changed it to key since, and kept the identifier as an alias for backwards compatibility… while making id private because it would probably now be a generated UUID (the one corresponding to the BUILDKITE_STEP_ID env var value?) instead of a user-provided one. So they updated the docs accordingly… but forgot to fully update the schema in line, only adding a definition for the key attribute but not updating the schema definition to remove id nor to make identifier backwards-compat alias now point to #/definitions/commonOptions/key instead of #/definitions/commonOptions/identifier?

@thejcannon
Copy link
Contributor

@thejcannon
Copy link
Contributor

FWIW just tried a pipeline with id: mykey and identifier: mykey and the resulting build has a step whose key was mykey.

Additionally, you're (seemingly) allowed to pass multiple and key takes precedence over id which also takes precedence over identifier.

@thejcannon
Copy link
Contributor

Last bit: all of the above have the same "cannot look like UUID" restriction.

@AliSoftware
Copy link
Author

Thanks for the investigation!

I'm surprised that defining a id attribute on a step works (and seems to be an alias for key according to your findings above), especially given that the BUILDKITE_STEP_ID env var is a UUID—while given its name sounds like it would be expected to reflect the value of that id attribute, which you're saying isn't expected to be one according to your tests… 🤔

Clearly some documentation and schema update needed to clarify all that anyway

@thejcannon
Copy link
Contributor

Ok, PR up.

I also made one for the docs: buildkite/docs#3011

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 a pull request may close this issue.

2 participants