Skip to content

feat(taskqueue): migrate push queue client to Cloud Tasks v2 while retaining v2beta3 for QueueStats - #160

Open
riddhi-shivhare wants to merge 1 commit into
taskqueue-migration-previewfrom
migrate-taskqueue-v2-client
Open

feat(taskqueue): migrate push queue client to Cloud Tasks v2 while retaining v2beta3 for QueueStats#160
riddhi-shivhare wants to merge 1 commit into
taskqueue-migration-previewfrom
migrate-taskqueue-v2-client

Conversation

@riddhi-shivhare

@riddhi-shivhare riddhi-shivhare commented Sep 3, 2026

Copy link
Copy Markdown

Description

This PR prepares the App Engine TaskQueue Python SDK for General Availability (GA) by transitioning Push Queue operations to the Google Cloud Tasks v2 client SDK, while retaining v2beta3 exclusively for QueueStats.

Changes Summary

  1. Push Queue Operations (cloudtask.py):

    • Switched _create_single_task_in_cloud_tasks and _create_batch_tasks_in_cloud_tasks to instantiate tasks_v2.CloudTasksClient().
    • Switched delete_tasks_in_cloud_tasks and purge_queue_in_cloud_tasks to instantiate tasks_v2.CloudTasksClient().
    • Updated _build_ct_task_payload HTTP method enum mapping to use tasks_v2.HttpMethod.
  2. Transactional Tasks (cloudtask_transactional.py):

    • Replaced from google.cloud import tasks_v2beta3 with from google.cloud import tasks_v2.
    • Updated build_task_payload_for_transactional_task() and dispatch_task_payload() to instantiate tasks_v2.CloudTasksClient().
  3. Queue Statistics (cloudtask.py):

    • Retained fetch_queue_stats_in_cloud_tasks() on tasks_v2beta3.CloudTasksClient().
    • Added documentation clarifying that QueueStats is out of scope for Cloud Tasks v2 GA and remains on v2beta3.

  • Base branch set to taskqueue-migration-preview
  • Zero breaking changes for existing App Engine applications
  • Feature flag APPENGINE_USE_CLOUDTASK_PUSH_QUEUE preserved

…taining v2beta3 for QueueStats

- Switch CloudTasksClient in task creation, batch creation, task deletion, and queue purge to tasks_v2.
- Switch HttpMethod mappings in _build_ct_task_payload to tasks_v2.HttpMethod.
- Update cloudtask_transactional payload construction and task dispatch to use tasks_v2.CloudTasksClient.
- Retain tasks_v2beta3.CloudTasksClient in fetch_queue_stats_in_cloud_tasks as QueueStats is out of scope for v2 GA.
- Add unit tests verifying tasks_v2 for mutations and tasks_v2beta3 for QueueStats.
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.

1 participant