-
Notifications
You must be signed in to change notification settings - Fork 19.7k
feat: add task type #31201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add task type #31201
Conversation
Summary of ChangesHello @GareArc, 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 introduces a new task type for workspace synchronization operations. By adding a specific type identifier to the task payload, it enhances the clarity and manageability of tasks processed through the Redis queue, allowing for easier differentiation and potential future handling of various task categories. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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
Customization To customize 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this 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 adds a type field to workspace synchronization tasks. The implementation is straightforward. I've suggested an improvement to use a StrEnum for the task type, which will improve maintainability and align with existing code patterns in the repository, especially as more task types may be added in the future.
| WORKSPACE_SYNC_QUEUE = "enterprise:workspace:sync:queue" | ||
| WORKSPACE_SYNC_PROCESSING = "enterprise:workspace:sync:processing" | ||
|
|
||
| TASK_TYPE_SYNC_TO_WORKSPACE = "sync_to_workspace" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve maintainability and align with existing patterns in the codebase (e.g., ProviderType in api/models/provider.py), it would be better to define task types using a StrEnum. This makes the code more robust, especially if more task types are added in the future. You'll need to add from enum import StrEnum at the top of the file.
| TASK_TYPE_SYNC_TO_WORKSPACE = "sync_to_workspace" | |
| class TaskType(StrEnum): | |
| SYNC_TO_WORKSPACE = "sync_to_workspace" |
| "retry_count": 0, | ||
| "created_at": datetime.now(UTC).isoformat(), | ||
| "source": source, | ||
| "type": TASK_TYPE_SYNC_TO_WORKSPACE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a task type identifier to workspace synchronization tasks published to Redis. The change introduces a constant TASK_TYPE_SYNC_TO_WORKSPACE and includes it in the task payload to help the enterprise backend worker distinguish between different types of tasks in the queue.
Changes:
- Added
TASK_TYPE_SYNC_TO_WORKSPACEconstant for task type identification - Updated task payload to include the "type" field with the new constant value
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "retry_count": 0, | ||
| "created_at": datetime.now(UTC).isoformat(), | ||
| "source": source, | ||
| "type": TASK_TYPE_SYNC_TO_WORKSPACE, |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newly added task type field is not covered by automated tests. Since this is an API contract with the enterprise backend worker that consumes these tasks, adding a test would help ensure the task structure remains consistent and prevent accidental breaking changes. Consider adding a unit test similar to the existing test in api/tests/unit_tests/services/enterprise/test_traceparent_propagation.py that verifies the task payload includes all expected fields including the new "type" field.
Important
Fixes #<issue number>.Summary
Screenshots
Checklist
make lintandmake type-check(backend) andcd web && npx lint-staged(frontend) to appease the lint gods