Skip to content

chore: migrate region references from us-central1 to us-east4 - #1327

Merged
jhuleatt merged 1 commit into
mainfrom
feat/migrate-us-central1-to-us-east4
Oct 6, 2026
Merged

jhuleatt merged 1 commit into
mainfrom
feat/migrate-us-central1-to-us-east4

Conversation

@jhuleatt

@jhuleatt jhuleatt commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Replaces all us-central1 and US_CENTRAL1 references across Node, Node-1st-gen, and Python samples with us-east4 and US_EAST4, and uses SupportedRegion.US_EAST4.value when interpolating into URLs and queue paths (superseding #1120).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates multiple Firebase Cloud Functions samples across Node and Python to change the default region from us-central1 to us-east4 in documentation, configuration, and code. It also adds declarative API and IAM role requirements using requiresRole and requiresAPI. The review feedback highlights critical issues where requiresRole and requiresAPI are incorrectly imported from firebase-functions/v2 instead of the top-level firebase-functions package, which would cause runtime errors. Additionally, some region updates in comments are misleading, such as referencing us-east4 for Firebase Realtime Database (which is not available in that region) or contradicting the actual configured regions of the function.


// [START remote_config_server_vertex_init]
const { onCall, HttpsError } = require("firebase-functions/https");
const { requiresRole, requiresAPI } = require("firebase-functions/v2");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The functions requiresRole and requiresAPI are top-level exports of the firebase-functions package, not firebase-functions/v2. Importing them from firebase-functions/v2 will result in undefined and cause runtime/deployment errors.

Suggested change
const { requiresRole, requiresAPI } = require("firebase-functions/v2");
const { requiresRole, requiresAPI } = require("firebase-functions");

*/

const {onCall} = require("firebase-functions/https");
const {requiresRole, requiresAPI} = require("firebase-functions/v2");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The functions requiresRole and requiresAPI are top-level exports of the firebase-functions package, not firebase-functions/v2. Importing them from firebase-functions/v2 will result in undefined and cause runtime/deployment errors.

Suggested change
const {requiresRole, requiresAPI} = require("firebase-functions/v2");
const {requiresRole, requiresAPI} = require("firebase-functions");

// [START import]
// The Cloud Functions for Firebase SDK to set up triggers and logging.
const {onConfigUpdated} = require("firebase-functions/remoteConfig");
const {requiresRole, requiresAPI} = require("firebase-functions/v2");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The functions requiresRole and requiresAPI are top-level exports of the firebase-functions package, not firebase-functions/v2. Importing them from firebase-functions/v2 will result in undefined and cause runtime/deployment errors.

Suggested change
const {requiresRole, requiresAPI} = require("firebase-functions/v2");
const {requiresRole, requiresAPI} = require("firebase-functions");

@@ -1,11 +1,17 @@
// [START remote_config_server_vertex_init]
const { onRequest } = require("firebase-functions/https");
const { requiresRole, requiresAPI } = require("firebase-functions/v2");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The functions requiresRole and requiresAPI are top-level exports of the firebase-functions package, not firebase-functions/v2. Importing them from firebase-functions/v2 will result in undefined and cause runtime/deployment errors.

Suggested change
const { requiresRole, requiresAPI } = require("firebase-functions/v2");
const { requiresRole, requiresAPI } = require("firebase-functions");

// Dependencies for task queue functions.
const {onTaskDispatched} = require("firebase-functions/tasks");
const {onRequest, HttpsError} = require("firebase-functions/https");
const {requiresRole, requiresAPI} = require("firebase-functions/v2");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The functions requiresRole and requiresAPI are top-level exports of the firebase-functions package, not firebase-functions/v2. Importing them from firebase-functions/v2 will result in undefined and cause runtime/deployment errors.

Suggested change
const {requiresRole, requiresAPI} = require("firebase-functions/v2");
const {requiresRole, requiresAPI} = require("firebase-functions");

Comment on lines +40 to +44
* https://us-east4-<project-id>.cloudfunctions.net/date?format=MMMM%20Do%20YYYY%2C%20h%3Amm%3Ass%20a
* Example request using request body with cURL:
* curl -H 'Content-Type: application/json' /
* -d '{"format": "MMMM Do YYYY, h:mm:ss a"}' /
* https://us-central1-<project-id>.cloudfunctions.net/date
* https://us-east4-<project-id>.cloudfunctions.net/date

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The example URLs in the comments refer to us-east4, but the function is explicitly configured to deploy to us-west1 and us-east1 on line 48. The comments should be updated to use one of the configured regions (e.g., us-east1) to avoid confusing users.

Suggested change
* https://us-east4-<project-id>.cloudfunctions.net/date?format=MMMM%20Do%20YYYY%2C%20h%3Amm%3Ass%20a
* Example request using request body with cURL:
* curl -H 'Content-Type: application/json' /
* -d '{"format": "MMMM Do YYYY, h:mm:ss a"}' /
* https://us-central1-<project-id>.cloudfunctions.net/date
* https://us-east4-<project-id>.cloudfunctions.net/date
* https://us-east1-<project-id>.cloudfunctions.net/date?format=MMMM%20Do%20YYYY%2C%20h%3Amm%3Ass%20a
* Example request using request body with cURL:
* curl -H 'Content-Type: application/json' /
* -d '{"format": "MMMM Do YYYY, h:mm:ss a"}' /
* https://us-east1-<project-id>.cloudfunctions.net/date

// Listens for new messages added to /messages/:pushId/original and creates an
// uppercase version of the message to /messages/:pushId/uppercase
// for all databases in 'us-central1'
// for all databases in 'us-east4'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Firebase Realtime Database is not available in the us-east4 region. The only available regions for RTDB are us-central1, europe-west1, and asia-southeast1. Changing this comment to us-east4 is misleading as there are no RTDB instances in that region.

Suggested change
// for all databases in 'us-east4'
// for all databases in 'us-central1'

@jhuleatt
jhuleatt force-pushed the feat/migrate-us-central1-to-us-east4 branch from 82e8b82 to 9fa269a Compare October 6, 2026 15:42
@jhuleatt
jhuleatt force-pushed the feat/migrate-us-central1-to-us-east4 branch from 9fa269a to 5f49471 Compare October 6, 2026 15:55
@jhuleatt
jhuleatt merged commit 90765b3 into main Oct 6, 2026
17 of 19 checks passed
@jhuleatt
jhuleatt deleted the feat/migrate-us-central1-to-us-east4 branch October 6, 2026 16:00
jhuleatt added a commit that referenced this pull request Oct 7, 2026
Reverts the region strings from #1327 (90765b3). That change assumed
the default region for Cloud Functions had moved to us-east4. It
hasn't: the Firebase CLI still falls back to us-central1 for HTTP,
callable, scheduled, and task queue functions, and none of these
samples set a region. us-east4 is the new default for App Hosting and
Data Connect, not for Functions.

Kept from #1327:
- the `.value` on SupportedRegion in the Python task queue samples
- the requiresRole/requiresAPI import from the firebase-functions root
- the us-east1 example URLs in Node/quickstarts/https-time-server,
  which deploys to us-west1 and us-east1

Supersedes #1346.
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.

1 participant