Skip to content

Extract ExecutionStatus sub-component from TransitionContext - #42

Merged
benrowe merged 7 commits into
masterfrom
feature/issue-21-execution-status
Dec 12, 2025
Merged

benrowe merged 7 commits into
masterfrom
feature/issue-21-execution-status

Conversation

@benrowe

@benrowe benrowe commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator

Summary

Implements issue #21: Extracts workflow status tracking (completed, paused, stopped, skippedDueToLock) into a dedicated ExecutionStatus class.

Changes

  • New ExecutionStatus class (src/ExecutionStatus.php)

    • Manages all status flags (completed, paused, stopped, skippedDueToLock)
    • Stores metadata associated with pause/stop reasons
    • Provides clean API for status management
    • Comprehensive test coverage (13 tests, 52 assertions)
  • Refactored TransitionContext to use ExecutionStatus

    • Replaced individual status fields with ExecutionStatus instance
    • Updated serialization to use executionStatus object format
    • Maintains backward compatibility with legacy status field format
    • Reduced cyclomatic complexity by extracting restoration methods
  • Updated StateWorker to pass metadata

    • Now passes action result metadata to markAsPaused() and markAsStopped()
    • Ensures metadata is properly tracked in ExecutionStatus
  • Test updates

    • Updated serialization tests to work with new format
    • All 360 tests passing with 100% code coverage maintained

Benefits

✅ Clear separation of concerns
✅ Easier to test status logic in isolation
✅ Status changes don't affect history tracking
✅ Clean serialization boundary
✅ Backward compatible deserialization

Testing

make check  # All quality checks pass

Closes #21

🤖 Generated with Claude Code

benrowe and others added 7 commits December 13, 2025 08:09
Introduces a dedicated ExecutionStatus class to manage workflow status flags
(completed, paused, stopped, skippedDueToLock) and associated metadata.

Benefits:
- Clear separation of concerns
- Easier to test status logic in isolation
- Status changes don't affect history tracking
- Clean serialization boundary

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replaces individual status tracking fields with a dedicated ExecutionStatus
instance. Updates serialization/deserialization to support both new format
(executionStatus object) and legacy format (status field) for backward
compatibility.

Changes:
- Replace $status and $skippedDueToLock with $executionStatus instance
- Update mark*/is* methods to delegate to ExecutionStatus
- Update getStatusMetadata() to check ExecutionStatus first, then fallback to history
- Refactor serialization to use executionStatus object structure
- Support legacy format deserialization for backward compatibility
- Reduce cyclomatic complexity by extracting restoration methods

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates StateWorker to pass action result metadata when calling
markAsPaused() and markAsStopped(), allowing ExecutionStatus to
store the metadata directly.

This completes the ExecutionStatus integration, ensuring metadata is
properly tracked with the current execution state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates TransitionContextSerializationTest to work with new executionStatus
serialization format. Regenerates PHPStan baseline to remove old ignored
errors for removed code (restoreStatus method, $skippedDueToLock property).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@benrowe
benrowe merged commit 21ac08e into master Dec 12, 2025
8 checks passed
@benrowe
benrowe deleted the feature/issue-21-execution-status branch December 12, 2025 21:24
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.

Extract ExecutionStatus sub-component from TransitionContext

1 participant