Skip to content

feat: Implement workflow versioning support - #162

Closed
timl3136 wants to merge 2 commits into
mainfrom
ltim/versioning-1
Closed

feat: Implement workflow versioning support#162
timl3136 wants to merge 2 commits into
mainfrom
ltim/versioning-1

Conversation

@timl3136

@timl3136 timl3136 commented Aug 5, 2026

Copy link
Copy Markdown
Member

What changed?

Why?

How did you test it?

Potential risks

Release notes

Documentation Changes

@gitar-bot

gitar-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Implements workflow versioning support with new APIs, decision manager integration, and comprehensive test coverage. Consider consolidating the duplicated get_version validation and selection logic in Context to prevent divergence.

💡 Quality: Duplicated get_version validation/selection logic risks divergence

📄 cadence/_internal/workflow/context.py:419-433 📄 cadence/testing/_workflow_environment.py:253-267

The change_id/min/max argument validation and the option-precedence selection (custom version > min > max) are reimplemented independently in Context._validate_version_arguments/_select_version and _InMemoryWorkflowContext.get_version. Because these two code paths must produce identical results for the same inputs (tests assert both raise the same errors and pick the same version), any future fix applied to one will silently drift from the other. Consider extracting the shared validation and selection helpers (e.g. the static methods on Context, or module-level functions in workflow.py) and calling them from both implementations.

🤖 Prompt for agents
Code Review: Implements workflow versioning support with new APIs, decision manager integration, and comprehensive test coverage. Consider consolidating the duplicated get_version validation and selection logic in Context to prevent divergence.

1. 💡 Quality: Duplicated get_version validation/selection logic risks divergence
   Files: cadence/_internal/workflow/context.py:419-433, cadence/testing/_workflow_environment.py:253-267

   The change_id/min/max argument validation and the option-precedence selection (custom version > min > max) are reimplemented independently in Context._validate_version_arguments/_select_version and _InMemoryWorkflowContext.get_version. Because these two code paths must produce identical results for the same inputs (tests assert both raise the same errors and pick the same version), any future fix applied to one will silently drift from the other. Consider extracting the shared validation and selection helpers (e.g. the static methods on Context, or module-level functions in workflow.py) and calling them from both implementations.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.70053% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cadence/testing/_workflow_environment.py 60.00% 7 Missing and 5 partials ⚠️
cadence/_internal/workflow/context.py 89.36% 6 Missing and 4 partials ⚠️
cadence/_internal/workflow/workflow_engine.py 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
...internal/workflow/statemachine/decision_manager.py 95.30% <100.00%> (+1.94%) ⬆️
...rnal/workflow/statemachine/marker_state_machine.py 96.61% <100.00%> (+0.11%) ⬆️
cadence/workflow.py 95.95% <100.00%> (+0.39%) ⬆️
cadence/_internal/workflow/workflow_engine.py 90.84% <0.00%> (ø)
cadence/_internal/workflow/context.py 91.86% <89.36%> (-1.60%) ⬇️
cadence/testing/_workflow_environment.py 83.16% <60.00%> (-1.97%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timl3136 timl3136 closed this Aug 5, 2026
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