fix(pipeline): preserve casing when normalizing org/pipeline slugs - #986
Open
KnutZuidema wants to merge 1 commit into
Open
fix(pipeline): preserve casing when normalizing org/pipeline slugs#986KnutZuidema wants to merge 1 commit into
KnutZuidema wants to merge 1 commit into
Conversation
normalizeSlug lowercased org and pipeline slugs parsed from 'org/pipeline' arguments, --pipeline, and --org, causing 404s for organizations with mixed-case slugs (e.g. AcmeCorp). This affected 'pipeline view', 'pipeline copy', 'job list --pipeline', and 'artifacts list --pipeline'. Buildkite slugs may be mixed case, so only normalize underscores to hyphens and leave casing untouched. Fixes buildkite#985
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
bk pipeline view,bk pipeline copy,bk job list --pipeline, andbk artifacts list --pipelineall fail with404 No organization foundfor organizations with mixed-case slugs (e.g.AcmeCorp), becausenormalizeSlugininternal/pipeline/resolver/cli.golowercases org and pipeline slugs parsed fromorg/pipelineargs,--pipeline, and--org.This is a resurgence of #424 / #685. #686 only fixed the validation regex that rejected mixed-case slugs — it didn't touch
normalizeSlug, which still forces lowercase.Fixes #985
Changes
normalizeSlugno longer lowercases input; it still converts underscores to hyphens (for repo-directory-derived names likemy_pipeline).cli_test.goandresolver_test.gocases that asserted lowercasing, since mixed-case slugs are valid on Buildkite and should now be preserved.Testing
go test ./...)go fmt ./...)Disclosures / Credits
I used an AI coding assistant (Claude, via the Pi agent harness) to investigate the bug, trace it to
normalizeSlug, and implement this fix and the corresponding test updates. I reviewed and directed the change.