feat: 失敗時もジョブサマリに落ちたフェーズ+理由を出力(#78)#85
Merged
Merged
Conversation
run() のパイプラインを try/catch で囲み、throw 時に core.summary へ 失敗フェーズ・エラー・収集済みの部分情報(version/asset/cache/checksum)を 表形式で出力してから re-throw する(既存の outer catch が setFailed)。 - summary に phase を追加し各ステップ境界で更新(resolving version / downloading / verifying checksum / extracting & caching / installing) - 失敗サマリ write 自体は best-effort(失敗しても action を落とさない) - 成功時サマリ(#39)の挙動は不変 Closes #78 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📝 WalkthroughWalkthrough
Changes失敗時ジョブサマリー
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant run
participant writeFailureSummary
participant core.summary
run->>run: 主要ステップの phase を更新
run->>writeFailureSummary: summary と err を渡す
writeFailureSummary->>core.summary: 失敗テーブルを書き込む
run-->>run: 元のエラーを再スロー
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #85 +/- ##
==========================================
- Coverage 72.18% 70.81% -1.37%
==========================================
Files 13 14 +1
Lines 266 281 +15
Branches 68 70 +2
==========================================
+ Hits 192 199 +7
- Misses 65 74 +9
+ Partials 9 8 -1
🚀 New features to boost your workflow:
|
run()/writeFailureSummary を import 副作用なくテストできるよう、ncc エントリを src/index.ts に分離(run().catch は index.ts へ移動)。build script も index.ts に。 tests/main.test.ts で #78 の失敗サマリ経路(落ちたフェーズ / エラー / 部分情報 / write 失敗の握りつぶし / '—' プレースホルダ)を検証する。self-test は happy path のみでこの経路に届かないため単体テストで担保。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AECzAv2vcdATecuvLjBSa6
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.
概要
core.summaryのジョブサマリは従来 成功時のみ出力で、run()が途中で throw するとcore.setFailedでログに出るだけだった。本 PR で 失敗時も「落ちたフェーズ + エラー理由 + 収集済みの部分情報」を表形式でジョブサマリに出す(NFR-5 可観測性 / #39 成功時サマリの補完)。変更点
RunSummary.phaseを導入し、パイプライン各ステップの頭でsummary.phaseを逐次更新(reading configuration→resolving asset→resolving version→checking tool cache→downloading release asset→verifying checksum→extracting & caching→installing onto PATH)。run()のcatchでwriteFailureSummary()を呼び、Phase / Error / Version / Asset / Cache / Checksumを出力してから re-throw。setSecret前提を維持。レビュー修正(Codex P2)
configureProxyFromEnv()とcore.getInput(...)/parseRetryInput(...)を try の外 に置いていたため、不正なretries/retry-base-ms入力やプロキシ設定で throw すると catch に入らず failure summary が出ないまま死ぬ穴があった。summaryを関数先頭で先に宣言(phase: 'reading configuration')し、setup 一式を try 内へ移動。設定読込段階の失敗も failure summary が拾えるようにした。受け入れ条件
run()throw 時も落ちたフェーズ / エラー / 部分情報(version・asset・cache・checksum)を表出力setSecret維持)検証
ローカル
pnpm run allgreen(typecheck / biome / vitest 95 passed / ncc build)。実 IO 経路はself-test.ymlのマトリクスで E2E 検証される。Closes #78
🤖 Generated with Claude Code
https://claude.ai/code/session_01AECzAv2vcdATecuvLjBSa6
Summary by cubic
Adds a failure-aware job summary so failed installs show the phase that broke, the error, and partial state. Also splits the action entry point to make
run()/writeFailureSummarytestable and adds unit tests; success behavior stays the same.New Features
summary.phaseacross steps and, on error, write a failure summary viawriteFailureSummary()from therun()catch.core.setSecret.Refactors
tryblock so config/proxy errors also produce a failure summary.nccentry tosrc/index.ts(movesrun().catchout ofmain), update build script, and document the entry inCLAUDE.md.vitestunit tests for the failure summary path (tests/main.test.ts), including placeholders and handling a failed summary write.Written for commit e6e1b01. Summary will update on new commits.