Skip to content

fix!: add validation for names of task queue funcs - #10834

Open
IzaakGough wants to merge 20 commits into
mainfrom
@invertase/fix-issue-7365
Open

IzaakGough wants to merge 20 commits into
mainfrom
@invertase/fix-issue-7365

Conversation

@IzaakGough

@IzaakGough IzaakGough commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7365

Cloud Functions names may contain underscores, but Cloud Tasks queue IDs may not, and the queue name is derived from the function id. So a task queue function like dummy_function deploys, its queue is never created, and deleting it later calls updateQueue with an illegal name and fails with a 400. There is no way to remove the function through the CLI.

Two changes:

  • taskQueueFunctionNamesAreValid rejects task queue function names that are not legal queue IDs at deploy time, so no new functions get into this state.
  • disableTaskQueue skips the call when the function id is not a legal queue ID. No queue by that name can exist, so this is a no-op for every validly named function and unblocks deletion for the ones already stuck.

The queue ID rule now lives in cloudtasks.isValidQueueId so both sides use the same definition.

Decision

This is a breaking change, deliberately. endpointsAreValid runs over every endpoint in the codebase, not just the filtered set, so anyone with an underscore-named task queue function in source now has their whole deploy fail rather than just that function. Those functions were already broken (their queue never existed), so this surfaces a silent failure rather than creating a new one, but it will be a new error for people who have not noticed yet.

Python is the main population: endpoint ids come from func.__name__ verbatim, and Python names cannot contain hyphens, so the error tells those users to pick a name with no separator.

Testing

Unit tests for the predicate, the validation, its wiring into endpointsAreValid, and the delete-path skip. Manually verified the deploy-time error.

@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 introduces validation for task queue function names at deploy time to ensure they conform to Cloud Tasks queue ID naming rules, which prohibit underscores and limit names to 100 characters. It adds the taskQueueFunctionNamesAreValid validation function, integrates it into the deployment pipeline, and includes corresponding unit tests and a changelog entry. There are no review comments, and I have no additional feedback to provide.

@IzaakGough
IzaakGough marked this pull request as ready for review July 21, 2026 15:32
Function names may contain underscores, but Cloud Tasks queue IDs may not,
and the queue name is derived from the function id. Deleting such a function
called updateQueue with an illegal name and failed with a 400, leaving no way
to remove it via the CLI. Skip disableTaskQueue when the id is not a legal
queue ID, since no queue by that name can exist.

Also drops three already-released entries that a main merge reintroduced into
the changelog.
Python function names cannot contain hyphens, so telling a Python user to use
one has no remedy behind it. Name the real fix, and say that the queue was
never created so the message explains why an existing deploy now fails.
Cover the call from endpointsAreValid, which nothing exercised, so removing it
now fails the suite. Use the endpoint() helper's base override instead of
mutating the id, and add uppercase and 100 character boundary cases.
@CorieW

CorieW commented Aug 17, 2026

Copy link
Copy Markdown
Member

Since this is a breaking change, is there a convention that this repo follows for breaking changes, such as:

  • Renaming PR title to fix!: add validation for names of task queue funcs.
  • Or something in CHANGELOG.md, like [BREAKING]?

@CorieW CorieW left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, mostly nit picking.

Comment thread src/gcp/cloudtasks.spec.ts Outdated
Comment thread src/deploy/functions/validate.spec.ts Outdated
Comment thread src/deploy/functions/validate.ts Outdated
IzaakGough and others added 4 commits August 18, 2026 10:45
Co-authored-by: Corie Watson <watson.corie@gmail.com>
Co-authored-by: Corie Watson <watson.corie@gmail.com>
Co-authored-by: Corie Watson <watson.corie@gmail.com>
@IzaakGough IzaakGough changed the title fix: add validation for names of task queue funcs fix!: add validation for names of task queue funcs Aug 24, 2026

This branch has not been deployed

No deployments
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.

firebase deploy fails to delete task function with an underscore in its name

3 participants