geneva_drive 0.2.0 → 0.3.0

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/lib/geneva_drive/executor.rb +5 -7
  4. data/lib/geneva_drive/flow_control.rb +20 -5
  5. data/lib/geneva_drive/jobs/housekeeping_job.rb +1 -1
  6. data/lib/geneva_drive/version.rb +1 -1
  7. data/test/dummy/config/environments/development.rb +0 -18
  8. data/test/dummy/config/environments/production.rb +0 -19
  9. data/test/dummy/config/environments/test.rb +0 -14
  10. data/test/dummy/log/test.log +54290 -0
  11. data/test/dummy_install/config/environments/development.rb +0 -18
  12. data/test/dummy_install/config/environments/production.rb +0 -19
  13. data/test/dummy_install/config/environments/test.rb +0 -14
  14. data/test/dummy_install/db/schema.rb +1 -1
  15. data/test/dummy_install/log/test.log +417 -0
  16. data/test/workflow/flow_control_test.rb +6 -5
  17. data/test/workflow/resume_and_skip_test.rb +305 -0
  18. metadata +49 -17
  19. data/app/assets/stylesheets/geneva_drive/application.css +0 -15
  20. data/app/controllers/geneva_drive/application_controller.rb +0 -2
  21. data/app/helpers/geneva_drive/application_helper.rb +0 -2
  22. data/app/jobs/geneva_drive/application_job.rb +0 -2
  23. data/app/mailers/geneva_drive/application_mailer.rb +0 -4
  24. data/app/models/geneva_drive/application_record.rb +0 -3
  25. data/app/views/layouts/geneva_drive/application.html.erb +0 -17
  26. data/test/dummy/app/mailers/application_mailer.rb +0 -4
  27. data/test/dummy/config/storage.yml +0 -34
  28. data/test/dummy_install/app/mailers/application_mailer.rb +0 -4
  29. data/test/dummy_install/config/storage.yml +0 -34
  30. /data/test/dummy_install/db/migrate/{20260126091843_create_geneva_drive_workflows.rb → 20260126164025_create_geneva_drive_workflows.rb} +0 -0
  31. /data/test/dummy_install/db/migrate/{20260126091844_create_geneva_drive_step_executions.rb → 20260126164026_create_geneva_drive_step_executions.rb} +0 -0
  32. /data/test/dummy_install/db/migrate/{20260126091845_add_finished_at_to_geneva_drive_step_executions.rb → 20260126164027_add_finished_at_to_geneva_drive_step_executions.rb} +0 -0
  33. /data/test/dummy_install/db/migrate/{20260126091846_add_error_class_name_to_geneva_drive_step_executions.rb → 20260126164028_add_error_class_name_to_geneva_drive_step_executions.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7074e059a0948fb56fa74f002bba45573a5cd89a1018988a1c18046d643f5498
4
- data.tar.gz: 90cb36f2142415c9d515d713c5779dcbcfe9da514ee8e5d45db53d4672de7134
3
+ metadata.gz: 70c9ef44e4b9666d6eb8e4ad93e7e06a7bcc2b00c96ad2271572ab0fc0b11714
4
+ data.tar.gz: d6e2439f6d272d74eb9e155876416a22d28a097a992f7153954cd6be2eac9b02
5
5
  SHA512:
6
- metadata.gz: 4b7b5b2f7b41855bbd7650e92179a22eb800c7d8d124d5a2612972fd21469efa4bfc26422a57aff6b53a60564d1adeb27c317774e7e5c5f8ff0cb069d040d50e
7
- data.tar.gz: a9a6f805963916273d26f5f3fc6184cae8f2cc203494c1dc6ea18148c71a156c9437221d071d56fe9347e0783088239f55f5e7febb33e0245c22552bd051f56d
6
+ metadata.gz: f4fc719769aa9cd69604d9ac55d24bbdb06c390bb4009728b1f809247ed284e5aa23e155ab1cdcbf80b3b2e975c30e5d486c67953674550f3a0b58e063283796
7
+ data.tar.gz: bd0c110f3f0158e1fe8e48faaf957b81c4084b4dfa479be8704ec37f5717e5db54bc754de5738904fc06ef9b7a9bc297883505355274950e9671bc208e1d1373
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.3.0]
6
+
7
+ - Fix `resume!` to retry the failed step instead of skipping it
8
+ - Trim gem dependencies to only activerecord, activejob, activesupport, and railties (no longer depends on full rails gem)
9
+ - Remove unused engine scaffolding (controllers, views, helpers, assets)
10
+
5
11
  ## [0.2.0]
6
12
 
7
13
  - Add source location tracking to step definitions
@@ -195,13 +195,11 @@ class GenevaDrive::Executor
195
195
  transition_step!("in_progress")
196
196
  transition_workflow!("performing") if workflow.ready?
197
197
 
198
- # Set current_step_name to the step being executed,
199
- # and next_step_name to what comes after
200
- following_step = workflow.steps.next_after(step_def.name)
201
- workflow.update!(
202
- current_step_name: step_def.name,
203
- next_step_name: following_step&.name
204
- )
198
+ # Set current_step_name to the step being executed.
199
+ # Don't advance next_step_name here - it already points to this step
200
+ # (set by create_step_execution). We only advance it after successful
201
+ # completion, so that resume! on a failed step will retry it.
202
+ workflow.update!(current_step_name: step_def.name)
205
203
 
206
204
  step_def
207
205
  end
@@ -186,17 +186,32 @@ module GenevaDrive::FlowControl
186
186
  # Skips the current step from outside a step execution.
187
187
  # Marks step as skipped and schedules next step (or finishes if last).
188
188
  #
189
- # @raise [InvalidStateError] if workflow is not in 'ready' state
189
+ # When called on a 'ready' workflow: marks the scheduled step as skipped.
190
+ # When called on a 'paused' workflow: skips the failed step (which caused the pause)
191
+ # and resumes execution with the next step.
192
+ #
193
+ # @raise [InvalidStateError] if workflow is not in 'ready' or 'paused' state
190
194
  # @return [void]
191
195
  def external_skip!
192
- raise GenevaDrive::InvalidStateError, "Cannot skip on a #{state} workflow" unless state == "ready"
196
+ unless %w[ready paused].include?(state)
197
+ raise GenevaDrive::InvalidStateError, "Cannot skip on a #{state} workflow"
198
+ end
193
199
 
194
- logger.info("Flow control: skip! called externally on step #{current_step_name.inspect}")
200
+ logger.info("Flow control: skip! called externally on step #{next_step_name.inspect}")
195
201
  with_lock do
196
202
  # with_lock reloads automatically; re-check state in case it changed
197
- raise GenevaDrive::InvalidStateError, "Cannot skip on a #{state} workflow" unless state == "ready"
203
+ unless %w[ready paused].include?(state)
204
+ raise GenevaDrive::InvalidStateError, "Cannot skip on a #{state} workflow"
205
+ end
206
+
207
+ if state == "paused"
208
+ # Workflow was paused (e.g., due to failed step). Resume and skip to next step.
209
+ update!(state: "ready", transitioned_at: nil)
210
+ else
211
+ # Workflow is ready with a scheduled step - mark it as skipped
212
+ current_execution&.mark_skipped!(outcome: "skipped")
213
+ end
198
214
 
199
- current_execution&.mark_skipped!(outcome: "skipped")
200
215
  schedule_next_step!
201
216
  end
202
217
  end
@@ -23,7 +23,7 @@
23
23
  # GenevaDrive.stuck_scheduled_threshold = 1.hour
24
24
  # GenevaDrive.stuck_recovery_action = :reattempt # or :cancel
25
25
  #
26
- class GenevaDrive::HousekeepingJob < GenevaDrive::ApplicationJob
26
+ class GenevaDrive::HousekeepingJob < ActiveJob::Base
27
27
  queue_as :default
28
28
 
29
29
  # Performs housekeeping tasks.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GenevaDrive
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -28,18 +28,6 @@ Rails.application.configure do
28
28
  # Change to :null_store to avoid any caching.
29
29
  config.cache_store = :memory_store
30
30
 
31
- # Store uploaded files on the local file system (see config/storage.yml for options).
32
- config.active_storage.service = :local
33
-
34
- # Don't care if the mailer can't send.
35
- config.action_mailer.raise_delivery_errors = false
36
-
37
- # Make template changes take effect immediately.
38
- config.action_mailer.perform_caching = false
39
-
40
- # Set localhost to be used by links generated in mailer templates.
41
- config.action_mailer.default_url_options = {host: "localhost", port: 3000}
42
-
43
31
  # Print deprecation notices to the Rails logger.
44
32
  config.active_support.deprecation = :log
45
33
 
@@ -58,12 +46,6 @@ Rails.application.configure do
58
46
  # Raises error for missing translations.
59
47
  # config.i18n.raise_on_missing_translations = true
60
48
 
61
- # Annotate rendered view with file names.
62
- config.action_view.annotate_rendered_view_with_filenames = true
63
-
64
- # Uncomment if you wish to allow Action Cable access from any origin.
65
- # config.action_cable.disable_request_forgery_protection = true
66
-
67
49
  # Raise error when a before_action's only/except options reference missing actions.
68
50
  config.action_controller.raise_on_missing_callback_actions = true
69
51
  end
@@ -21,9 +21,6 @@ Rails.application.configure do
21
21
  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
22
22
  # config.asset_host = "http://assets.example.com"
23
23
 
24
- # Store uploaded files on the local file system (see config/storage.yml for options).
25
- config.active_storage.service = :local
26
-
27
24
  # Assume all access to the app is happening through a SSL-terminating reverse proxy.
28
25
  config.assume_ssl = true
29
26
 
@@ -52,22 +49,6 @@ Rails.application.configure do
52
49
  # Replace the default in-process and non-durable queuing backend for Active Job.
53
50
  # config.active_job.queue_adapter = :resque
54
51
 
55
- # Ignore bad email addresses and do not raise email delivery errors.
56
- # Set this to true and configure the email server for immediate delivery to raise delivery errors.
57
- # config.action_mailer.raise_delivery_errors = false
58
-
59
- # Set host to be used by links generated in mailer templates.
60
- config.action_mailer.default_url_options = {host: "example.com"}
61
-
62
- # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
63
- # config.action_mailer.smtp_settings = {
64
- # user_name: Rails.application.credentials.dig(:smtp, :user_name),
65
- # password: Rails.application.credentials.dig(:smtp, :password),
66
- # address: "smtp.example.com",
67
- # port: 587,
68
- # authentication: :plain
69
- # }
70
-
71
52
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
72
53
  # the I18n.default_locale when a translation cannot be found).
73
54
  config.i18n.fallbacks = true
@@ -28,26 +28,12 @@ Rails.application.configure do
28
28
  # Disable request forgery protection in test environment.
29
29
  config.action_controller.allow_forgery_protection = false
30
30
 
31
- # Store uploaded files on the local file system in a temporary directory.
32
- config.active_storage.service = :test
33
-
34
- # Tell Action Mailer not to deliver emails to the real world.
35
- # The :test delivery method accumulates sent emails in the
36
- # ActionMailer::Base.deliveries array.
37
- config.action_mailer.delivery_method = :test
38
-
39
- # Set host to be used by links generated in mailer templates.
40
- config.action_mailer.default_url_options = {host: "example.com"}
41
-
42
31
  # Print deprecation notices to the stderr.
43
32
  config.active_support.deprecation = :stderr
44
33
 
45
34
  # Raises error for missing translations.
46
35
  # config.i18n.raise_on_missing_translations = true
47
36
 
48
- # Annotate rendered view with file names.
49
- # config.action_view.annotate_rendered_view_with_filenames = true
50
-
51
37
  # Raise error when a before_action's only/except options reference missing actions.
52
38
  config.action_controller.raise_on_missing_callback_actions = true
53
39
  end