Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Two copies of the job-step lookup on OperationPlan

オープン
#177 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
78/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
cli

調査の方向性

internal/onebox/job_plan.go の OperationPlan 型と JobPlan.validateContent から始めて、単一のジョブステップが保証される仕組みを理解します。次に、cmd/ob/commands.go と internal/onebox/expiry_errors.go にある 2 つの呼び出し元を調べます。両方の呼び出し元が、動作やスキーマを変更せずに、1 つのエクスポートされた OperationPlan accessor を使用すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

labstack/onebox のほかの issue

labstack/onebox の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。