firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

validateQueueId does not accept underscores

Open tai-bo opened this issue 6 months ago • 2 comments

[REQUIRED] Environment info

firebase-tools: Firebase Emulator

Platform: Firebase CLI 14.4.0 on macOS

[REQUIRED] Test case

from firebase_admin import functions
task_queue=functions.task_queue(f"locations/australia-southeast1/functions/a_b_c")

[REQUIRED] Steps to reproduce

from firebase_admin import functions
task_queue=functions.task_queue(f"locations/australia-southeast1/functions/a_b_c")

[REQUIRED] Expected behavior

This should be an acceptable queue ID.

[REQUIRED] Actual behavior

Instead, it is throwing:

Error: Queue ID must start with a letter followed by up to 62 letters, numbers, hyphens, or underscores and must end with a letter or a number

This is due to the regex has not been updated to accomodate underscores:

https://github.com/firebase/firebase-tools/blob/d39d184eceaa33676dc951d26a1689db2a741bb7/src/emulator/tasksEmulator.ts#L194

in

https://github.com/firebase/firebase-tools/blob/d39d184eceaa33676dc951d26a1689db2a741bb7/src/emulator/tasksEmulator.ts#L185

tai-bo avatar May 27 '25 11:05 tai-bo

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

google-oss-bot avatar May 27 '25 11:05 google-oss-bot

Hey @tai-bo, thanks for reaching out. It looks like this might be a similar issue to #7884. Cloud Tasks enforces a naming limitation to Queue IDs, and since we use the function trigger's name as the Cloud Task Queue's ID during deployment, your function trigger names must also follow these rules. Specifically, Cloud Tasks Queue ID can contain only letters ([A-Za-z]), numbers ([0-9]), or hyphens (-), and must be between 1 and 100 characters.

It looks like the error message needs to be updated to specify that underscores are not allowed. Let me ask someone from our engineering team to verify this behavior.

aalej avatar May 28 '25 17:05 aalej