feat(taskqueue): migrate push queue client to Cloud Tasks v2 SDK - #117
Open
riddhi-shivhare wants to merge 34 commits into
Open
riddhi-shivhare wants to merge 34 commits into
riddhi-shivhare wants to merge 34 commits into
Conversation
…PHP TaskQueue diversion SDK
…o TaskAlreadyExistsException for tombstoned tasks
…rt PushTask.php whitespace
…sk names and remove dogfood comment
…equest with relativeUri, removing convertToDotNotation
…se to catch individual task creation errors
…th legacy TaskQueue precedence
…chCreateTasks support
…_CLOUDTASK_PUSH_QUEUE env vars
…ls to ^2.7 for PHP 7.2-8.2 compatibility
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.
Description
Prepares the App Engine TaskQueue PHP SDK for General Availability (GA) by routing Push Queue operations to the official Google Cloud Tasks
v2client SDK (google/cloud-tasks^2.0).Changes Summary
Dependency Addition (
composer.json):"google/cloud-tasks": "^2.0"torequire.Dual Environment Variable Routing (
PushQueue.php):GAE_PUSHQUEUE_BACKEND: CLOUD_TASKAPPENGINE_USE_CLOUDTASK_PUSH_QUEUE: true/1Task Creation (
PushQueue.php):\Google\Cloud\Tasks\V2\Client\CloudTasksClientwith\Google\Cloud\Tasks\V2\CreateTaskRequestandAppEngineHttpRequest.addTasks):batchCreateTaskssupport (BatchCreateTasksRequest) for future GA client library updates.createTaskcalls whenbatchCreateTasksis not yet generated in the installedgoogle/cloud-taskspackage, ensuring reliability across all versions.Request Normalization & Error Mapping:
AppEngineHttpRequestrelative URIs, headers (Content-Type,X-AppEngine-QueueName,X-AppEngine-TaskName), and delay schedules (Google\Protobuf\Timestamp).ALREADY_EXISTS(code 6 / 409) and tombstoned task errors toTaskAlreadyExistsException, preserving legacy SDK exception precedence.Verification
All changes were deployed and validated against live App Engine Standard (PHP 8.2) in project
rshivhare-demo-2016950:TaskAlreadyExistsExceptionaddTasksInvalidArgumentExceptionTaskQueueExceptionTaskQueueException(FAILED_PRECONDITION)