Skip to content

Fix Live Activity job scheduling with Cloud Tasks#316

Merged
kswift1 merged 1 commit into
mainfrom
kswift1/check-neon-cu-limit
May 21, 2026
Merged

Fix Live Activity job scheduling with Cloud Tasks#316
kswift1 merged 1 commit into
mainfrom
kswift1/check-neon-cu-limit

Conversation

@kswift1
Copy link
Copy Markdown
Owner

@kswift1 kswift1 commented May 21, 2026

Summary

  • Live Activity job scheduling now enqueues Cloud Tasks and removes the 5-second polling worker.
  • Adds the internal dispatch endpoint, scheduler config/docs/workflow envs, and regression coverage for enqueue success/failure paths.

변경 유형

  • feat: 새로운 기능
  • fix: 버그 수정
  • refactor: 코드 리팩토링
  • chore: 설정, 빌드 등 기타 변경
  • docs: 문서 수정
  • test: 테스트 추가/수정

변경 파일

  • infra/rust-backend/src/services/live_activity_service.rs
  • infra/rust-backend/src/routes/internal.rs, routes/schedules.rs, routes/mod.rs
  • .github/workflows/deploy-rust.yml, infra/rust-backend/.env.example, .ai/REST_API.md
  • infra/rust-backend/tests/live_activity_test.rs

스크린샷 (UI 변경 시)

N/A

Test plan

  • cargo test --manifest-path infra/rust-backend/Cargo.toml --test live_activity_test -- --test-threads=1
  • cargo test --manifest-path infra/rust-backend/Cargo.toml --test schedules_test
  • cargo test --manifest-path infra/rust-backend/Cargo.toml --test rust_migration_regression_test
  • Prod smoke: /health 200, internal dispatch 401 without secret / 200 processed:false with secret
  • cargo test --manifest-path infra/rust-backend/Cargo.toml --tests blocked by existing media_upload_urls_test base_path/basePath mismatch

관련 이슈

N/A

@github-actions
Copy link
Copy Markdown

PR 체크 스킵

⚡ 빌드 대상 코드 변경이 없어 빌드/테스트를 건너뛰었습니다.

상세 정보
  • Workflow: PR Check
  • Branch: kswift1/check-neon-cu-limit
  • Commit: 09c2f86
  • 빌드 모드: ⚡ 스킵 (빌드 대상 변경 없음)

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the Live Activity job scheduling mechanism by replacing the existing polling worker with Google Cloud Tasks. This change aims to improve the efficiency and reliability of Live Activity updates by leveraging a managed task queue service. It introduces a new internal endpoint for task dispatch, updates configuration, and includes thorough testing to ensure the robustness of the new system.

Highlights

  • Transition to Cloud Tasks: Live Activity job scheduling has been migrated from a 5-second polling worker to Google Cloud Tasks for improved efficiency and reliability.
  • New Internal Dispatch Endpoint: An internal API endpoint (POST /api/v1/internal/live-activity/jobs/{job_id}/dispatch) was added to allow Cloud Tasks to trigger Live Activity job processing securely.
  • Configuration and Documentation Updates: New environment variables (SCHEDULER_SECRET, LIVE_ACTIVITY_TASK_PROJECT_ID, LIVE_ACTIVITY_TASK_LOCATION, LIVE_ACTIVITY_TASK_QUEUE, LIVE_ACTIVITY_TASK_TARGET_BASE_URL) were introduced, and the API documentation was updated to reflect the new dispatch endpoint.
  • Comprehensive Regression Tests: New regression tests were added to cover both successful and failed Cloud Task enqueueing scenarios, as well as the functionality of the new internal dispatch endpoint.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/deploy-rust.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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 transitions the Live Activity job processing from an internal background worker to an external scheduling system using Google Cloud Tasks. It introduces a LiveActivityJobScheduler trait with a Cloud Tasks implementation, adds a new internal API endpoint for job dispatching with secret-based authentication, and updates the service layer to enqueue tasks upon job creation or update. Documentation and tests have been updated to reflect these architectural changes. I have no feedback to provide.

@kswift1 kswift1 merged commit 94a3292 into main May 21, 2026
2 checks passed
@kswift1 kswift1 deleted the kswift1/check-neon-cu-limit branch May 21, 2026 02:45
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