Skip to content

Refactor Runnable with name, formatter, and hooks#26

Merged
santib merged 1 commit intomainfrom
santib/runnable-refactor
Mar 4, 2026
Merged

Refactor Runnable with name, formatter, and hooks#26
santib merged 1 commit intomainfrom
santib/runnable-refactor

Conversation

@santib
Copy link
Member

@santib santib commented Mar 1, 2026

Summary

  • Runnable now includes Hooks, has a name attribute (auto-derived from class name via step_name), and a formatter class-level DSL with instance-level override
  • Gate, Aggregator, Sequential, Parallel delegate name to Runnable's constructor instead of managing their own attr_reader :name
  • Expanded Runnable spec covering name derivation, formatter DSL, and hooks integration

Phase 2 of the v2 refactor. Depends on #24 (ExecutionContext, Formatter, Hooks).

Test plan

  • Name defaults to nil for anonymous classes, auto-derives for named classes (e.g. MyCustomStepmy_custom_step)
  • Formatter defaults to Mars::Formatter, respects class-level DSL and instance override
  • Hooks module mixed in — before_run/after_run work on any Runnable
  • All existing Gate, Aggregator, Sequential, Parallel specs still pass
  • 62 specs total, 0 failures
  • Rubocop clean

🤖 Generated with Claude Code

@santib santib changed the base branch from main to santib/execution-context-formatter-hooks March 1, 2026 16:11
@santib santib force-pushed the santib/runnable-refactor branch from 6cb834e to dcdc38d Compare March 1, 2026 16:13
@santib santib force-pushed the santib/execution-context-formatter-hooks branch from 23dbc74 to 4db2d42 Compare March 1, 2026 20:50
@santib santib force-pushed the santib/runnable-refactor branch from ad45966 to 1523685 Compare March 1, 2026 20:56
Base automatically changed from santib/execution-context-formatter-hooks to main March 4, 2026 15:10
Phase 2 of the Mars v2 refactor.

- Runnable: include Hooks, add `name` (auto-derived from class via
  `step_name`), add `formatter` class-level DSL with instance fallback
- Gate, Aggregator, Sequential, Parallel: delegate `name` to Runnable
  via super instead of managing their own attr_reader
- Runnable spec: cover name derivation, formatter DSL, hooks integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@santib santib force-pushed the santib/runnable-refactor branch from 1523685 to c08b53a Compare March 4, 2026 15:14
@santib santib merged commit 3463ef2 into main Mar 4, 2026
1 check passed
@santib santib deleted the santib/runnable-refactor branch March 4, 2026 15:15
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.

2 participants