Canceled active automation runs when an automation is disabled#28818
Canceled active automation runs when an automation is disabled#28818EvanHahn wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughA new 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run ghost:test:ci:integration |
✅ Succeeded | 2m 17s | View ↗ |
nx run ghost:test:ci:integration:no-coverage |
✅ Succeeded | 1m 27s | View ↗ |
nx build @tryghost/activitypub |
✅ Succeeded | 1s | View ↗ |
nx build @tryghost/admin-toolbar |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/sodo-search |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/comments-ui |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/announcement-bar |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/signup-form |
✅ Succeeded | <1s | View ↗ |
Additional runs (10) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-06-23 00:53:51 UTC
closes https://linear.app/ghost/issue/NY-1358 When an automation is marked inactive, we now cancel any active runs. To do this, we: - Mark all pending steps canceled. - If an automation is deactivated while a step is running: - Don't enqueue subsequent steps. - Don't retry failed steps. Note that, if a step is already locked and running, we may not be able to stop it. In addition to automated tests, I manually tested this by: 1. Temporarily set `automations.fakeWaitHoursMultiplier` to 2500 (one day becomes one minute). 2. Created a "send email, wait 2 days, send email" automation. 3. Signed up a member and got the first email. 4. Deactivated then reactivated the automation. 5. Verified that I never received the second email. I also ran through this *without* deactivating the automation and made sure I got both emails.
b8df697 to
cc1cc41
Compare

closes https://linear.app/ghost/issue/NY-1358
When an automation is marked inactive, we now cancel any active runs.
How it works
To do this, we:
Note that, if a step is already locked and running, we may not be able to stop it.
Manual test
In addition to automated tests, I manually tested this by:
automations.fakeWaitHoursMultiplierto 2500 (one day becomes one minute).I also ran through this without deactivating the automation and made sure I got both emails.