-
-
Notifications
You must be signed in to change notification settings - Fork 623
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
Feat: Add button to try and resume pending batches #1529
Conversation
|
WalkthroughA new component, Changes
Possibly related PRs
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
apps/webapp/app/components/runs/v3/CheckBatchCompletionDialog.tsxOops! Something went wrong! :( ESLint: 8.45.0 ESLint couldn't find the config "custom" to extend from. Please check that the name of the config is correct. The config "custom" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
apps/webapp/app/v3/services/resumeBatchRun.server.ts (1)
Line range hint
6-6
: Use a union type or enum for return values to enhance type safetyDefining a union type or an
enum
for the possible return values of thecall
method improves type safety and maintainability.You can define the return type as a union:
type ResumeBatchRunResult = "ERROR" | "ALREADY_COMPLETED" | "COMPLETED" | "PENDING";Or as an
enum
:enum ResumeBatchRunResult { ERROR = "ERROR", ALREADY_COMPLETED = "ALREADY_COMPLETED", COMPLETED = "COMPLETED", PENDING = "PENDING", }Then update the method signature:
public async call(batchRunId: string): Promise<ResumeBatchRunResult> { // ... }This change promotes better type checking and helps prevent typos or invalid return values.
apps/webapp/app/services/worker.server.ts (1)
566-566
: Return the promise from the handler function for consistencyReturning the promise from
service.call
in the handler function maintains consistency with other handlers and ensures proper error propagation.Apply this diff to adjust the handler:
"v3.resumeBatchRun": { priority: 0, maxAttempts: 5, handler: async (payload, job) => { const service = new ResumeBatchRunService(); - await service.call(payload.batchRunId); + return await service.call(payload.batchRunId); }, },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
apps/webapp/app/components/runs/v3/CheckBatchCompletionDialog.tsx
(1 hunks)apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.batches/route.tsx
(5 hunks)apps/webapp/app/routes/resources.batches.$batchId.check-completion.ts
(1 hunks)apps/webapp/app/services/worker.server.ts
(1 hunks)apps/webapp/app/v3/services/resumeBatchRun.server.ts
(9 hunks)
🔇 Additional comments (2)
apps/webapp/app/components/runs/v3/CheckBatchCompletionDialog.tsx (1)
13-57
: LGTM!
The CheckBatchCompletionDialog
component is well-structured and follows best practices.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.batches/route.tsx (1)
251-294
: LGTM!
The BatchActionsCell
component is correctly implemented and integrates seamlessly with the batches table.
In rare cases, parent runs don't continue after child runs have completed. We are working on a permanent fix for this, but this should help in the meantime.
Summary by CodeRabbit
Release Notes
New Features
CheckBatchCompletionDialog
component for checking batch completion status.Bug Fixes
Documentation