stepped 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -6
  3. data/lib/stepped/version.rb +1 -1
  4. metadata +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0687ebc619500dd18bf435c8fb6a67a5523590b811bb51c6f8532f1411ebd93a'
4
- data.tar.gz: 68d54113a3ef201aad85b083378848bfa633c5f5bbe41cdcd52e2a63a6b10f03
3
+ metadata.gz: a2b28a4bc4ba842e620bd426a1b887a0f25915dfae3dd9647090ba2b59053b8a
4
+ data.tar.gz: 5a324cda715b346839300aacb530852532700f4c656946d162ae35a255d2f1c7
5
5
  SHA512:
6
- metadata.gz: f975911ec89661747af26a32e98063e0e7c567a18c0d08e9f7113f7623cdba777a32a9e98af656612418a2e7640a9bbbe8bef3e415eb3f0189cd97bfbc54175e
7
- data.tar.gz: 90064479821a90ff7d2c13c2925f6903e962987092b25ae23985d525e1e79acd2b63a4a28a12b5b9024913e1898918ade9f0c2c2c8870c6ec768e45e43dbd5e7
6
+ metadata.gz: f9926045bb5cfa3ded4e3eedfbcc1b97e9e0293b8bf55b3f7f7177f69cbcdaf21e3f5f1e760e2808f513140a081876eeac598b2f5f30f16aa40cc546f4c1ca05
7
+ data.tar.gz: da2bbcf38f26a74e8cfa76513912253dffa758abb9e8c928c40b5509a78c69e3055b8856de847e35955f43fd28f1f20884ebc3ff89145cceb81614ef5844f160
data/README.md CHANGED
@@ -2,11 +2,16 @@
2
2
 
3
3
  Stepped is a Rails engine for orchestrating complex workflows as a tree of actions. Each action is persisted, runs through Active Job, and can fan out into more actions while keeping the parent action moving step-by-step as dependencies complete.
4
4
 
5
- The core ideas are:
5
+ <img width="1024" height="1024" alt="stepped-actions" src="https://github.com/user-attachments/assets/32577a1e-1240-44ec-af0a-493a48ec70ef" />
6
+
7
+ Stepped was extracted out of [Envirobly](https://klevo.sk/projects/envirobly-efficient-application-hosting-platform/) where it powers tasks like application deployment, that involve complex, out-of-the-band tasks like DNS provisioning, retries, waiting for instances to boot, running health checks and all the fun of a highly distributed networked system.
8
+
9
+ ## Concepts
6
10
 
7
11
  - **Action trees**: define a root action with multiple steps; each step can enqueue more actions and the step completes only once all the actions within it complete.
12
+ - **Models are the Actors**: in Rails, your business logic usually centers around database-persisted models. Stepped takes advantage of this and allows you to define and run actions on all your models, out of the box.
8
13
  - **Concurrency lanes**: actions with the same `concurrency_key` share a `Stepped::Performance`, so only one runs at a time while others queue up (with automatic superseding of older queued work).
9
- - **Reuse**: optional `checksum` lets Stepped skip work that is already achieved, or share a currently-performing action with multiple parents.
14
+ - **Reuse**: optional `checksum` lets Stepped skip work that is already achieved, or share a currently-performing action with multiple parents. Imagine you need to launch multiple workflows with different outcomes, that all depend on the outcome of the same action, somewhere in the action tree. Stepped makes this easy and efficient.
10
15
  - **Outbound completion**: actions can be marked outbound (or implemented as a job) and completed later by an external event.
11
16
 
12
17
  ## Installation
@@ -212,7 +217,9 @@ Under the hood, completion forwards to the current outbound action for that acto
212
217
 
213
218
  ## Job-backed actions
214
219
 
215
- If you prefer to implement an action as an Active Job, declare it with `job:`. Job-backed actions are treated as outbound and are expected to call `action.complete!` when finished:
220
+ This is especially useful if you'd like to have (delayed) retries on certain errors, that ActiveJob supports out of the box.
221
+
222
+ You can declare it with `job:`. Job-backed actions are treated as outbound and are expected to call `action.complete!` when finished. The action instance is passed as the first and only argument. To work with the action arguments, use the familiar `action.arguments`:
216
223
 
217
224
  ```ruby
218
225
  class TowJob < ActiveJob::Base
@@ -230,11 +237,14 @@ class Car < ApplicationRecord
230
237
  end
231
238
  ```
232
239
 
233
- You can extend existing actions (including job-backed ones) by prepending steps:
240
+ You can extend existing actions by prepending steps. This is especially useful when a parent class defines an action,
241
+ that you want to modify in a child class. For example:
234
242
 
235
243
  ```ruby
236
- Car.prepend_stepped_action_step :tow do
237
- honk
244
+ class SportsCar < Car
245
+ prepend_stepped_action_step :tow do |step|
246
+ step.do :something_special
247
+ end
238
248
  end
239
249
  ```
240
250
 
@@ -1,3 +1,3 @@
1
1
  module Stepped
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stepped
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Starsi
@@ -37,6 +37,20 @@ dependencies:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: minitest
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '6.0'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '6.0'
40
54
  email:
41
55
  - klevo@klevo.sk
42
56
  executables: []
@@ -78,14 +92,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
92
  requirements:
79
93
  - - ">="
80
94
  - !ruby/object:Gem::Version
81
- version: '0'
95
+ version: '3.2'
82
96
  required_rubygems_version: !ruby/object:Gem::Requirement
83
97
  requirements:
84
98
  - - ">="
85
99
  - !ruby/object:Gem::Version
86
100
  version: '0'
87
101
  requirements: []
88
- rubygems_version: 4.0.1
102
+ rubygems_version: 4.0.10
89
103
  specification_version: 4
90
104
  summary: Rails engine for orchestrating complex action trees.
91
105
  test_files: []