Skip to content

feat(job): add moveToCompleted method [python] #3251

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

Merged
merged 10 commits into from
May 13, 2025

Conversation

roggervalf
Copy link
Collaborator

@roggervalf roggervalf commented May 7, 2025

Why

  1. Why is this change necessary? In order to provide a way to do manual processing. moveToComplete method is not exposed in job instance

How

  1. How did you implement this? Add moveToCompleted method in job instance and allow manual processing

Additional Notes (Optional)

Any extra info here.

@roggervalf roggervalf force-pushed the feat-job-move-to-completed branch from 5bf5d2b to c145d61 Compare May 9, 2025 04:52
@roggervalf roggervalf requested review from Copilot and manast May 9, 2025 04:53
Copy link

@Copilot Copilot AI left a 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 introduces a new moveToCompleted method on the Job instance to support manual processing.

  • Adds moveToCompleted tests for both JavaScript and Python workers.
  • Refactors related functions in the Scripts and Worker modules to simplify moveToCompleted/Failed processing.
  • Updates the Job class to expose the new moveToCompleted behavior.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_worker.ts Adds assertions on attemptsMade and finishedOn for JS tests.
python/tests/worker_test.py Introduces a test for manual processing and verifies job properties.
python/bullmq/worker.py Updates moveToCompleted invocation; removes unused opts parameter.
python/bullmq/scripts.py Refactors moveToCompleted and moveToFailed methods and their args.
python/bullmq/job.py Implements moveToCompleted to update job status and properties.

@roggervalf roggervalf force-pushed the feat-job-move-to-completed branch from 9bdf684 to ed79d61 Compare May 10, 2025 20:46
Copy link
Contributor

@manast manast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@roggervalf roggervalf merged commit 6a8e3e2 into master May 13, 2025
17 checks passed
@roggervalf roggervalf deleted the feat-job-move-to-completed branch May 13, 2025 11:53
github-actions bot pushed a commit that referenced this pull request May 19, 2025
## [5.52.3](v5.52.2...v5.52.3) (2025-05-19)

### Bug Fixes

* **flow:** add new error code when parent has failed children ([#3268](#3268)) ([b8fba5e](b8fba5e))

### Features

* **job:** add moveToCompleted method [python] ([#3251](#3251)) ([6a8e3e2](6a8e3e2))
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.

2 participants