firebase / firebase/firebase-tools

validateQueueId does not accept underscores

Open
#8,659 2 comments 0 reactions 0 assignees View on GitHub
emulators: functions type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [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

Contributor guide

Open the contributing guide

Research direction

Inspect src/emulator/tasksEmulator.ts around lines 185-194, then reproduce the issue with the provided task_queue example using the a_b_c queue ID. Done means queue IDs containing underscores are accepted while the existing validation rules remain enforced.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.