Skip to content

feat: expand Queue/Job/Worker API parity with Node.js BullMQ [rust] - #4219

Merged
roggervalf merged 37 commits into
masterfrom
feat/add-flow-support-rust
Jun 18, 2026
Merged

feat: expand Queue/Job/Worker API parity with Node.js BullMQ [rust]#4219
roggervalf merged 37 commits into
masterfrom
feat/add-flow-support-rust

Conversation

@manast

@manast manast commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Port Impact Checklist

  • Python – does this change need to be ported or documented in the Python library?
  • Elixir – does this change need to be ported or documented in the Python library?
  • PHP – does this change need to be ported or documented in the PHP library?
  • Rust – this PR substantially expands the Rust client and its documentation/tests.

Why

This PR expands Rust BullMQ API parity with Node.js BullMQ across Queue, Job, Worker, and FlowProducer, and fixes a number of correctness and usability gaps found while iterating on the Rust port.

It also includes related CI/workflow and security follow-ups needed so PR checks reflect the intended behavior during review and the repository-wide OSV scan stays green:

  • the OSV scanner should only fail scheduled security scans, not PR checks
  • the Elixir workflow should still publish its expected matrix-named check even when Elixir files are unchanged
  • the repository lockfiles needed follow-up dependency updates to remediate reported OSV vulnerabilities

How

Implemented the Rust parity work across the Rust crate and supporting docs/tests, including:

  • Queue API additions for getters, ranges/counts, metrics, schedulers, dependency helpers, rate-limit helpers, and related error handling
  • Job API additions for logs, state helpers, retry/discard behavior, dependency APIs, and flow-related helpers
  • Worker behavior updates for processing control flow, stalled handling, metrics, and job lifecycle parity
  • FlowProducer support for parent/child flows, get_flow, bulk additions, per-queue defaults, prefix validation, dedup/parent edge cases, and usable returned/reconstructed Job contexts
  • typed Redis connection options plus credential-safe Debug redaction
  • public type, docs, changelog, README, and feature-parity updates
  • extensive Rust integration test coverage for the new APIs and follow-up fixes

Also updated repository workflows/configuration to match the intended PR behavior:

  • .github/workflows/osv-scanner.yml now uses fail-on-vuln: ${{ github.event_name == 'schedule' }}
  • .github/workflows/elixir-test.yml always creates the expected check, while skipping Elixir steps when no Elixir files changed
  • osv-scanner.toml was updated alongside the scanner workflow change
  • the root, elixir/, php/, and python/ Yarn lockfiles were updated to patched dependency versions for the OSV-reported npm vulnerabilities, including the follow-up form-data fix in python/yarn.lock
  • after merging the latest master, the root dependency fix now follows the upstream coveralls-next upgrade and no longer needs the temporary root js-yaml resolution

Additional Notes (Optional)

  • The PR now covers the Rust parity expansion plus the follow-up workflow/security fixes needed for CI and OSV validation.
  • Validation on the current head included successful GitHub checks for Rust, Elixir, OSV scanner, CodeQL, smoke, and the main language matrices, plus local lockfile/install validation for the updated dependency files.
  • Follow-up changes also addressed review feedback around flow error propagation, script contexts on returned jobs, dependency/parent semantics, prefix validation, credential redaction, the remaining OSV findings, and the final merge-conflict resolution against master.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 substantially expands the Rust port’s API surface toward Node.js BullMQ parity, adding queue getters/counts/metrics, new Job methods, a new FlowProducer implementation for dependency trees, typed/TLS Redis connection options, and accompanying documentation + test coverage updates.

Changes:

  • Add many Queue getter/count/metrics APIs (state-list getters, per-type counts, global concurrency/rate-limit getters, time-series metrics).
  • Add Job methods for logs/dependencies and Worker behavior updates (metrics collection, discard semantics, deferred-failure handling, rate-limit retry behavior).
  • Introduce FlowProducer (add/add_bulk/get_flow, per-queue defaults) and typed/TLS Redis connection options; update docs and integration tests accordingly.

Reviewed changes

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

Show a summary per file
File Description
rust/tests/queue_test.rs Adds integration tests for new Queue getters/counts and paired getters.
rust/tests/metrics_test.rs Adds integration tests for time-series metrics collection and retrieval.
rust/tests/job_test.rs Adds integration tests for clear_logs and discard semantics.
rust/tests/connection_test.rs Adds tests for typed connection fields and effective URL building.
rust/tests/common/mod.rs Updates shared test connection helper defaults and lint allowance.
rust/src/worker.rs Adds metrics packing, discard/unrecoverable handling, deferred-failure handling, rate-limit “move back to wait”, and better script error mapping for finishing.
rust/src/types.rs Adds public types for metrics and dependency query results/counts.
rust/src/scripts.rs Adds ScriptRegistry::load_all() to pre-load Lua scripts into Redis.
rust/src/redis_connection.rs Switches connection initialization to use effective_url().
rust/src/queue.rs Implements new getters/counts/metrics/dependency helpers and extends remove behavior.
rust/src/options.rs Adds typed Redis connection fields + TLS flag; adds Worker metrics options and new Job flow flags.
rust/src/lib.rs Exposes FlowProducer module and re-exports additional public API types/options.
rust/src/job.rs Adds discard flag plumbing, dependency APIs, waiting-children support, and log clearing.
rust/src/flow_producer.rs Introduces FlowProducer for atomic flow creation and flow retrieval.
rust/src/error.rs Adjusts Unrecoverable display and adds new job-state/script-related error variants.
rust/README.md Updates Rust crate feature list and architecture overview; links parity doc.
rust/FEATURE_PARITY.md Refreshes parity tracker and adds a detailed “Next PR” implementation plan.
rust/examples/benchmark.rs Updates connection options initialization to include defaults.
rust/Cargo.toml Renames published crate to bullmq-rust, keeps library name bullmq, adds TLS-enabled redis features.
rust/Cargo.lock Adds a lockfile for the Rust crate.
docs/gitbook/rust/introduction.md Updates installation instructions for bullmq-rust and documents typed/TLS connections.
docs/gitbook/rust/changelog.md Updates Rust changelog with the new APIs/features included in this PR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rust/src/queue.rs
Comment thread rust/src/options.rs
Comment thread rust/tests/connection_test.rs Outdated
Comment thread rust/src/queue.rs
Comment thread rust/src/flow_producer.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread rust/src/flow_producer.rs Outdated
Comment thread rust/src/flow_producer.rs Outdated
Comment thread rust/src/worker.rs Outdated
Comment thread rust/src/redis_connection.rs
Comment thread rust/src/error.rs
@manast

manast commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts by merging origin/master into this branch and fixing the conflict in yarn.lock in commit e1b86b20.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 25 changed files in this pull request and generated 3 comments.

Comment thread rust/src/flow_producer.rs
Comment thread rust/src/flow_producer.rs
Comment thread rust/src/queue.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 25 out of 27 changed files in this pull request and generated 4 comments.

Comment thread rust/src/flow_producer.rs Outdated
Comment thread rust/src/flow_producer.rs
Comment thread rust/src/flow_producer.rs
Comment thread rust/src/worker.rs
Comment thread package.json Outdated
@manast
manast requested review from Copilot and roggervalf June 12, 2026 07:02
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread rust/src/flow_producer.rs
Comment thread rust/src/job.rs
manast and others added 2 commits June 16, 2026 10:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated no new comments.

@manast

manast commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot we have some vulns to be fixed: osv-scanner .
Scanning dir .
Scanned /Users/manuelastudillo/dev/bullforce/bullmq/yarn.lock file and found 847 packages
Loaded filter from: /Users/manuelastudillo/dev/bullforce/bullmq/osv-scanner.toml
╭─────────────────────────────────────┬──────┬───────────┬─────────────┬─────────┬───────────╮
│ OSV URL │ CVSS │ ECOSYSTEM │ PACKAGE │ VERSION │ SOURCE │
├─────────────────────────────────────┼──────┼───────────┼─────────────┼─────────┼───────────┤
https://osv.dev/GHSA-h67p-54hq-rp68 │ 5.3 │ npm │ js-yaml │ 4.1.1 │ yarn.lock │
https://osv.dev/GHSA-6v5v-wf23-fmfq │ 5.3 │ npm │ markdown-it │ 14.1.1 │ yarn.lock │
https://osv.dev/GHSA-vmf3-w455-68vh │ 6.9 │ npm │ tar │ 7.5.15 │ yarn.lock │
https://osv.dev/GHSA-fx2h-pf6j-xcff │ 8.2 │ npm │ vite │ 8.0.12 │ yarn.lock │
https://osv.dev/GHSA-v6wh-96g9-6wx3 │ 5.5 │ npm │ vite │ 8.0.12 │ yarn.lock │
╰─────────────────────────────────────┴──────┴───────────┴─────────────┴─────────┴───────────╯

@manast

manast commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot continue

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@copilot we have some vulns to be fixed: osv-scanner .
Scanning dir .
Scanned /Users/manuelastudillo/dev/bullforce/bullmq/yarn.lock file and found 847 packages...

Addressed in 143f767. I updated the repository lockfiles to the patched js-yaml, tar, vite, markdown-it, and form-data versions and added a root js-yaml resolution so the recursive OSV scan no longer reports the remaining npm findings.

Copilot AI changed the title feat(rust): expand Queue/Job/Worker API parity with Node.js BullMQ feat(rust): expand Queue/Job/Worker API parity with Node.js BullMQ and related CI/security fixes Jun 16, 2026
Comment thread package.json Outdated
Comment thread rust/Cargo.toml
@manast

manast commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in 43f94da. I merged the latest master into this branch, kept the upstream coveralls-next bump, removed the now-unneeded root js-yaml resolution, and validated the root lockfile with yarn install --ignore-scripts --frozen-lockfile.

@roggervalf roggervalf changed the title feat(rust): expand Queue/Job/Worker API parity with Node.js BullMQ and related CI/security fixes feat: expand Queue/Job/Worker API parity with Node.js BullMQ [rust] Jun 18, 2026
@roggervalf
roggervalf merged commit eb9ae1d into master Jun 18, 2026
25 checks passed
@roggervalf
roggervalf deleted the feat/add-flow-support-rust branch June 18, 2026 05:04
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.79.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.25.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants