[Bug]: pipeline view/job list/artifacts list still lowercase mixed-case org slugs (normalizeSlug), unlike PR #686
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
internal/pipeline/resolver/cli.go の normalizeSlug と parsePipelineArg から始め、続いて internal/pipeline/resolver/resolver.go の WithOrg とその呼び出し元を調べます。大文字と小文字が混在する AcmeCorp の例を再現し、organization slugs を保持しながら、アンダースコアをハイフンに変換する意図された動作も維持して、影響を受ける pipeline、job、artifact、build-create、preflight コマンドが小文字化された organization を要求しなくなったことを検証します。
索引モデルが issue の本文から書いたものです。
説明
Contact Details
No response
What happened?
bk pipeline view, bk job list --pipeline, and bk artifacts list --pipeline all fail with
404 No organization found when the org slug is mixed case (e.g. AcmeCorp), because the org
value is silently lowercased before the API request.
$ bk pipeline view AcmeCorp/my-pipeline
Error: GET https://api.buildkite.com/v2/organizations/acmecorp/pipelines/my-pipeline: 404 No organization found
$ bk job list --pipeline AcmeCorp/my-pipeline --build 1234
Error: failed to list jobs: GET https://api.buildkite.com/v2/organizations/acmecorp/pipelines/my-pipeline/builds/1234/jobs?...: 404 No organization found
$ bk artifacts list 1234 --pipeline AcmeCorp/my-pipeline
Error: GET https://api.buildkite.com/v2/organizations/acmecorp/pipelines/my-pipeline/builds/1234/artifacts?per_page=100: 404 No organization found
bk build view AcmeCorp/my-pipeline/1234 and bk build list --pipeline AcmeCorp/my-pipeline work correctly — they don't go through the same resolver path.
Diagnosis
This looks like a resurgence of #424 / #685, which #686 only partially fixed. #686 fixed the
validation regex that rejected mixed-case slugs, but didn't touch the separate
normalizeSlug helper that actually lowercases the value:
// internal/pipeline/resolver/cli.go
func normalizeSlug(s string) string {
return strings.ToLower(strings.ReplaceAll(s, "_", "-"))
}
normalizeSlug is called from parsePipelineArg (used by both ResolveFromFlag and
ResolveFromPositionalArgument) and from WithOrg in internal/pipeline/resolver/resolver.go,
so any org parsed from a positional org/pipeline arg, --pipeline org/slug, or --org is
lowercased regardless of the actual casing on Buildkite.
Commands going through this resolver chain are affected:
pipeline view,pipeline copyjob list --pipelineartifacts list --pipelinebuild create,preflight
build view / build list --pipeline don't hit normalizeSlug and work fine.
Expected behavior
Org slugs should be preserved as given by the user (or resolved from git/config) and not
forced to lowercase, matching the fix intent of #686. normalizeSlug's underscore→hyphen
substitution is presumably still wanted for local repo-derived names, but the ToLower call
should not apply to org (and probably not pipeline) slugs.
Version
3.56.0
What environment are you seeing the problem on?
Local Development
Relevant log output
$ bk --debug pipeline view AcmeCorp/my-pipeline 2>&1 | head -5
DEBUG request uri=https://api.buildkite.com/v2/organizations/acmecorp/pipelines/my-pipeline
GET /v2/organizations/acmecorp/pipelines/my-pipeline HTTP/1.1
...
HTTP/2.0 404 Not Found
- 主要言語
- Go
- スター
- 207
- フォーク
- 71
- 平均マージ
- 3時間 48分
- マージ済み PR(30日)
- 32
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
buildkite/cli のほかの issue
-
Dependency Dashboardオープン
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
buildkite/cli#965 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
buildkite/cli#964 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
buildkite/cli#963 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
automation models
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug llm-stack needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Alert email subjects don't identify the host — same container on multiple hosts, identical subjectsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
P3 Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
grpc/grpc-go#9483 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
needs-area needs-kind needs-priority needs-status needs-triage
難易度 2/5 1時間未満 初心者へのやさしさ 85/100
cncf/automation#736 ·
メンテナーはふだん 1 日以内に返信