Skip to content

[Feature] Add saga id for step result#59

Merged
vadikko2 merged 3 commits intomasterfrom
add-saga-id-for-step-result
Feb 2, 2026
Merged

[Feature] Add saga id for step result#59
vadikko2 merged 3 commits intomasterfrom
add-saga-id-for-step-result

Conversation

@vadikko2
Copy link
Collaborator

@vadikko2 vadikko2 commented Feb 2, 2026

Summary by CodeRabbit

Release Notes - v4.8.1

  • Chores
    • Bumped version to 4.8.1
    • Improved code stability and type safety
    • Enhanced saga execution tracking capabilities

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

This change adds explicit saga_id tracking to saga step execution results. The version is bumped to 4.8.1, the SagaStepResult dataclass gains a new saga_id field with improved type safety, and the saga execution logic now injects saga_id into yielded results. Test validation confirms saga_id presence.

Changes

Cohort / File(s) Summary
Version Bump
pyproject.toml
Project version updated from 4.8.0 to 4.8.1.
Data Structure Enhancement
src/cqrs/saga/step.py
Added `saga_id: UUID
Execution Logic
src/cqrs/saga/saga.py
Added dataclasses import; reworked yield points to inject saga_id into SagaStepResult objects using dataclasses.replace; simplified conditionals and multi-line calls for code clarity without altering functional flow.
Test Validation
tests/unit/test_saga/test_saga_basic.py
Added runtime assertion validating that step_result.saga_id is populated in test_saga_step_result_contains_correct_metadata.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A saga now carries its ID with pride,
Dataclass fields refined, no more typing to hide,
Each step remembers where it came from within,
Type safety strengthens—let the saga begin! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and directly describes the main change: adding a saga_id field to SagaStepResult, which is implemented across multiple files with consistent purpose.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-saga-id-for-step-result

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.26%. Comparing base (976b3ba) to head (e490464).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
- Coverage   87.36%   87.26%   -0.11%     
==========================================
  Files          70       70              
  Lines        2478     2481       +3     
==========================================
  Hits         2165     2165              
- Misses        313      316       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@codspeed-hq
Copy link
Contributor

codspeed-hq bot commented Feb 2, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks


Comparing add-saga-id-for-step-result (e490464) with master (976b3ba)

Open in CodSpeed

@vadikko2 vadikko2 merged commit ce4dbdf into master Feb 2, 2026
10 of 11 checks passed
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