Started canceling runs when automation becomes inactive#27623
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 (3)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughThe change adds an 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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. Review rate limit: 6/8 reviews remaining, refill in 10 minutes and 52 seconds.Comment |
This comment was marked as outdated.
This comment was marked as outdated.
closes https://linear.app/ghost/issue/NY-1261 This was built by Kimi K2.6 with the following prompt: > @ghost/core/core/server/services/welcome-email-automations/poll.js runs pending automation runs. This is good! But it has a missing feature: if the welcome email automation is inactive (see `welcome_email_automations`'s `status` column), we still run the automation. Let's implement this behavior! > > Using red/green TDD (edit `poll.test.js`, probably), make it so that we cancel an automation run if the automation is disabled. This will also mean adding a new `exit_reason` to the `welcome_email_automation_runs` table (see @ghost/core/core/server/data/schema/schema.js), and a new type for the `exitReason` argument of `markExited` in poll.js. > > (There's a chance this feature already exists, in which case this request is a no-op. But I'm pretty sure we need to implement it.) I made a few small tweaks and put it up for review.
4a656a9 to
5575d37
Compare
| step_started_at: {type: 'dateTime', nullable: true}, | ||
| step_attempts: {type: 'integer', unsigned: true, nullable: false, defaultTo: 0}, | ||
| exit_reason: {type: 'string', maxlength: 50, nullable: true, validations: {isIn: [['email send failed', 'member unsubscribed', 'member changed status', 'finished']]}}, | ||
| exit_reason: {type: 'string', maxlength: 50, nullable: true, validations: {isIn: [['email send failed', 'member unsubscribed', 'member changed status', 'finished', 'automation disabled']]}}, |
There was a problem hiding this comment.
These validations don't get encoded into the schema, so we don't need to do a migration here.
closes https://linear.app/ghost/issue/NY-1261
This was built by Kimi K2.6 with the following prompt:
I made a few small tweaks and put it up for review.