Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

deploy: pre-flight Blaze-tier check + surface tier requirement in firebase init (avoid wasted deploys)

Đang mở
#10,751 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
cli, cloud

Hướng nghiên cứu

Bắt đầu trong src/deploy/functions/prepare.ts và theo dõi cách quá trình chuẩn bị deployment kích hoạt các bản build, sau đó kiểm tra src/deploy/functions/ensure.ts và nodeBillingError để tìm lỗi Blaze hiện có. So sánh luồng billing với src/extensions/checkProjectBilling.ts và src/dataconnect/provisionCloudSql.ts, rồi xem xét src/init/features/** để tìm các lời nhắc về tính năng. Hoàn thành có nghĩa là các deployment đủ điều kiện sẽ thất bại trước khi thực hiện công việc build và các lựa chọn init yêu cầu Blaze sẽ hiển thị ghi chú được chỉ định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

api: core polish
Which command?

deploy

Version info

firebase-tools 15.22.3

Platform

All (behaviour is deploy-time-only, platform-independent)

CLI/emulator log
Error: Cloud Functions deployment requires the pay-as-you-go (Blaze) billing plan. To upgrade your project, visit the following URL:
https://console.firebase.google.com/project/<PROJECT>/usage/details
Reproduction steps
  1. On a project on the free Spark plan, run firebase init functions (or add Cloud Functions, Extensions, or a Data Connect service).
  2. Write code. Run firebase deploy.
  3. Deploy proceeds through TS/JS build, packaging, artifact upload, and only then — after minutes of work — fails at cloudBuildEnabled (see src/deploy/functions/ensure.ts, nodeBillingError) with the Blaze-required error.

The same pattern exists for Extensions (src/extensions/checkProjectBilling.ts) and Data Connect / Cloud SQL provisioning (src/dataconnect/provisionCloudSql.ts calls cloudbilling.checkBillingEnabled). Each surface only detects the tier mismatch after significant work — never at firebase init time, and never up-front in firebase deploy.

Expected behavior

Two additive fixes, both cheap:

  1. Pre-flight billing check in deploy prepare phase. Before prepare.ts triggers builds, call cloudbilling.checkBillingEnabled(projectId) once. If the plan is Spark and the plan targets features known to require Blaze (Cloud Functions of any generation, Extensions, Data Connect with Cloud SQL, App Hosting), fail fast with the same Blaze error. Skips minutes of wasted CPU/network on every doomed deploy.

  2. Tier badge in firebase init. When the user picks a feature that requires Blaze, print an inline note (requires the Blaze billing plan) next to the choice — the same wording nodeBillingError produces at deploy time. Right now the tier requirement is invisible until first deploy fails.

Both changes reuse existing helpers (cloudbilling.checkBillingEnabled, nodeBillingError) — no new API surface, no new dependencies. Feature-to-tier mapping already implicit in the code; just needs to be surfaced.

Files: src/deploy/functions/prepare.ts, src/deploy/functions/ensure.ts, src/init/features/** (per-feature init prompts), src/gcp/cloudbilling.ts (helper, no change).

Ngôn ngữ chính
TypeScript
Star
4.5k
Fork
1.3k
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
88

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của firebase/firebase-tools

Tất cả issue của firebase/firebase-tools

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.