Skip to content

feat!: Add id field to internal Job struct - #862

Merged
spencewenski merged 6 commits into
mainfrom
job-ids
Jul 19, 2025
Merged

spencewenski merged 6 commits into
mainfrom
job-ids

Conversation

@spencewenski

@spencewenski spencewenski commented Jul 19, 2025 •

Copy link
Copy Markdown
Member

To help with tracking background jobs in a uniform way across different worker backends, add an id field to our internal Job struct. The ID is logged at the debug level when the job is enqueued, at error level when an error occurs, and is added to the trace span around the worker's handle method.

This is technically a breaking change because any jobs that were enqueued before this change will not deserialize properly due to the missing id field. Additionally, our sidekiq integration was changed to enqueue the entire Job struct instead of just the args.

To help with tracking background jobs in a uniform way across different
worker backends, add an `id` field to our internal `Job` struct. The ID
is logged at the debug level when the job is enqueued, at error level
when an error occurs, and is added to the trace span around the worker's
`handle` method.
@codecov

codecov Bot commented Jul 19, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 3.89610% with 74 lines in your changes missing coverage. Please review.

Project coverage is 48.03%. Comparing base (b6de753) to head (cdcad6f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/worker/backend/pg/enqueue.rs 0.00% 27 Missing ⚠️
src/worker/backend/sidekiq/enqueue.rs 0.00% 12 Missing ⚠️
src/worker/backend/sidekiq/processor/builder.rs 0.00% 8 Missing ⚠️
src/util/tracing.rs 0.00% 7 Missing ⚠️
src/worker/job.rs 14.28% 6 Missing ⚠️
src/worker/mod.rs 25.00% 6 Missing ⚠️
src/worker/backend/pg/processor/mod.rs 0.00% 3 Missing ⚠️
src/worker/backend/sidekiq/roadster_worker.rs 0.00% 3 Missing ⚠️
src/worker/backend/sidekiq/processor/mod.rs 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/service/http/middleware/tracing/mod.rs 47.20% <ø> (+1.96%) ⬆️
src/worker/backend/sidekiq/processor/mod.rs 0.00% <0.00%> (ø)
src/worker/backend/pg/processor/mod.rs 2.84% <0.00%> (-0.02%) ⬇️
src/worker/backend/sidekiq/roadster_worker.rs 0.00% <0.00%> (ø)
src/worker/job.rs 82.35% <14.28%> (-17.65%) ⬇️
src/worker/mod.rs 24.46% <25.00%> (-0.36%) ⬇️
src/util/tracing.rs 0.00% <0.00%> (ø)
src/worker/backend/sidekiq/processor/builder.rs 0.00% <0.00%> (ø)
src/worker/backend/sidekiq/enqueue.rs 0.00% <0.00%> (ø)
src/worker/backend/pg/enqueue.rs 6.41% <0.00%> (-0.95%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6de753...cdcad6f. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@spencewenski
spencewenski merged commit 58686e6 into main Jul 19, 2025
@spencewenski
spencewenski deleted the job-ids branch July 19, 2025 22:04
spencewenski pushed a commit that referenced this pull request Jul 19, 2025
## 🤖 New release

* `roadster`: 0.8.0-rc.1 -> 0.8.0-rc.2 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.8.0-rc.2](roadster-v0.8.0-rc.1...roadster-v0.8.0-rc.2)
- 2025-07-19

### Added

- [**breaking**] Add `id` field to internal `Job` struct
([#862](#862))
- Add meaningful prefix to some generic trace event labels
([#861](#861))

### Other

- Disable auto release PRs for now
([#860](#860))
- Disable workflows on v0.8 branch
([#859](#859))
- Remove previous results from worker m3 benchmarks
([#858](#858))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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