fix!: add validation for names of task queue funcs - #10834
Open
IzaakGough wants to merge 20 commits into
Open
IzaakGough wants to merge 20 commits into
IzaakGough wants to merge 20 commits into
Conversation
Contributor
There was a problem hiding this comment.
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
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.
…7365 # Conflicts: # CHANGELOG.md
Member
|
Since this is a breaking change, is there a convention that this repo follows for breaking changes, such as:
|
CorieW
approved these changes
Aug 18, 2026
CorieW
left a comment
Member
There was a problem hiding this comment.
Looks good, mostly nit picking.
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>
# Conflicts: # CHANGELOG.md
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_functiondeploys, its queue is never created, and deleting it later callsupdateQueuewith an illegal name and fails with a 400. There is no way to remove the function through the CLI.Two changes:
taskQueueFunctionNamesAreValidrejects task queue function names that are not legal queue IDs at deploy time, so no new functions get into this state.disableTaskQueueskips 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.isValidQueueIdso both sides use the same definition.Decision
This is a breaking change, deliberately.
endpointsAreValidruns 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.