Skip to content

fix(ci): Node.js を 24.18.0 にアップグレードして firebase deploy の偽陽性失敗を解消 - #157

Merged
kuu13580 merged 1 commit into
developfrom
fix/firebase-preview-deploy
Jun 27, 2026
Merged

fix(ci): Node.js を 24.18.0 にアップグレードして firebase deploy の偽陽性失敗を解消#157
kuu13580 merged 1 commit into
developfrom
fix/firebase-preview-deploy

Conversation

@kuu13580

Copy link
Copy Markdown
Contributor

Summary

  • actions/setup-nodenode-version'22''24.18.0' に変更(3つの workflow 共通)
  • preview / merge / release 全ての firebase deploy job で観測される 偽陽性失敗 を根本治療

背景

Deploy to Firebase Hosting on PR job が、実際は deploy 成功しているのに必ず failure 扱いになる現象が PR #151 で発生していた。

失敗フロー

```
T+0.0s POST /releases?versionName=<新version> (1回目)
T+0.8s apiv2: "retrying ... after a premature close error"
T+1.8s POST /releases?versionName=<同じ新version> (リトライ)
T+2.5s <<< 400 "supplied version is the current active version"
```

1回目で release は成功しチャンネル更新済み。premature close でレスポンス取りこぼした firebase-tools の apiv2 が冪等でない POST を再送 → Firebase が FAILED_PRECONDITION 400 を返す → job 失敗。

根本原因

Node.js v24.17.0 で導入された keep-alive socket 再利用タイミング変更 (nodejs/node#63989) による node-fetch@2 の ERR_STREAM_PREMATURE_CLOSE バグ。firebase-tools のバージョンアップが原因ではない。

Node.js premature close
v24.16.0 ❌ 発生しない
v24.17.0 ✅ 発生
v24.18.0 修正済み (nodejs/node#64004)
v22.23.0 ✅ 発生
v22.23.1+ ❌ 修正済み(同じ upstream fix)

actions/setup-node@v4node-version: '22' を指定していたが、22.x の最新が引かれていたため premature close 発生バージョンを踏んでいた。

なぜ firebase-tools のバージョン pin では直らないか

firebase-tools 最新 v15.22.3 の PR #10697("Retry without keep-alive after a premature close error")は、本文で明示的に:

The normal path keeps using keep-alive, so flows like deploy are unaffected

deploy フローには適用されないため、firebase-tools 側で patch を待っても解消されない。Node.js 側で premature close を起こさないことが根本治療。

関連 issue / 参照

  • Node.js #63989 - 元 issue
  • Node.js #64004 - 修正 PR (v24.18.0 / v22.23.1 取り込み)
  • firebase-tools #10692 - 影響観測

Test plan

  • PR の preview deploy job が緑になる
  • preview URL が PR コメントに投稿される(action-hosting-deploy のデフォルト挙動が維持される)
  • 複数回 rerun しても安定して緑になる(過去なら premature close を踏んでいたタイミング)
  • preview URL を curl -I で叩いて 200 + 最新の last-modified を確認
  • develop マージ後、firebase-hosting-merge.yml の staging deploy が成功
  • main へのリリース時、firebase-hosting-release.yml の production deploy が成功

Fallback

万一 Node 24 で別の問題が発生した場合は、node-version: '22.22.0' への pin で対応する(22.23.0 を踏まないバージョン)。

🤖 Generated with Claude Code

actions/setup-node が引いていた Node.js 22 系で premature close
バグ (nodejs/node#63989) が発生し、firebase-tools の apiv2 が
POST /releases を冪等でないリトライしていた。結果 deploy 自体は
成功しているのに 400 "is the current active version" で job が
赤くなっていた。

修正済みの Node.js (24.18.0, PR nodejs/node#64004 取り込み) に
アップグレードすることで、premature close 自体を起こさないように
する。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@kuu13580
kuu13580 requested a review from a team as a code owner June 27, 2026 01:49
@kuu13580
kuu13580 requested review from bobtaroh and koki-fore June 27, 2026 01:49
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kuu13580, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 48 minutes and 39 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a86580b6-c8d6-45ba-bb0b-9f3d3e55e6ef

📥 Commits

Reviewing files that changed from the base of the PR and between c65c307 and 677473e.

📒 Files selected for processing (3)
  • .github/workflows/firebase-hosting-merge.yml
  • .github/workflows/firebase-hosting-pull-request.yml
  • .github/workflows/firebase-hosting-release.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/firebase-preview-deploy

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 677473e):

https://tabi-share-8ef6b--pr157-fix-firebase-preview-f7hox846.web.app

(expires Sat, 04 Jul 2026 01:56:08 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 9f2a87ede127df7673322845e34cf22c1372d720

kuu13580 added a commit that referenced this pull request Jun 27, 2026
PR #157 の preview deploy が安定して緑になるか確認するため。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@kuu13580
kuu13580 force-pushed the fix/firebase-preview-deploy branch from 0bfd0a7 to 677473e Compare June 27, 2026 01:55
@kuu13580
kuu13580 merged commit 05e825a into develop Jun 27, 2026
14 checks passed
@kuu13580
kuu13580 deleted the fix/firebase-preview-deploy branch June 27, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants