Two copies of the job-step lookup on OperationPlan
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
internal/onebox/job_plan.go の OperationPlan 型と JobPlan.validateContent から始めて、単一のジョブステップが保証される仕組みを理解します。次に、cmd/ob/commands.go と internal/onebox/expiry_errors.go にある 2 つの呼び出し元を調べます。両方の呼び出し元が、動作やスキーマを変更せずに、1 つのエクスポートされた OperationPlan accessor を使用すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The problem
Two functions walk an OperationPlan's steps to find its single job step:
jobStepOf(cmd/ob/commands.go:900-910) returns the step, for the approval
summary and the typed token.jobNameOfOperation(internal/onebox/expiry_errors.go:67-76) returns just
the name, for expiry messages.
Same loop, same guarantee behind it — JobPlan.validateContent
(internal/onebox/job_plan.go:97-104) ensures exactly one StepJob whose
Component matches Artifact.Job. Two copies means a future change to what
"the job step" is has two places to land, and the CLI copy exists only because
the onebox one is unexported and returns the wrong shape.
Proposed change
Export one accessor on OperationPlan — JobStep() (OperationStep, bool) —
next to the type it belongs to, and have both callers use it.
jobNameOfOperation becomes a thin wrapper or disappears.
Current workaround
None needed; both copies are correct today. This is about keeping them that
way.
Scope and safety
Pure refactor. No behaviour change, no schema change, no new command surface.
Found while auditing #171.
- 主要言語
- Go
- スター
- 4
- フォーク
- 0
- 平均マージ
- 2時間 46分
- マージ済み PR(30日)
- 38
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
labstack/onebox のほかの issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
labstack/onebox の issue をすべて見る
似ている issue
-
bug frontend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
trust: update-propagation-directive requires developer mode while add and remove do not対応中かも @bhuvan-somisetty が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
oalders/clodhopper#133 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
peasant-labs/peasant#596 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
hatchet-dev/hatchet#5179 ·
メンテナーはふだん 1 日以内に返信