Started inserting automation run when member signs up#28263
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 (10)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (8)
WalkthroughThis PR adds a public automationsApi.trigger(options) entrypoint (event restricted to 'member_sign_up'), a repository-level trigger implementation that schedules automation runs/steps based on the first eligible action revision and action type (wait/send_email), ES-module and schema updates for the temporary fake automations DB, MemberRepository wiring to call the new trigger (while preserving the legacy welcome-email enqueue path), GiftService updates to use the new method for paid signups, and unit tests covering repository and integration behaviors. Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ 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)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.42.3)ghost/core/test/unit/server/services/members/members-api/repositories/member-repository.test.jsThanks 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 |
towards https://linear.app/ghost/issue/NY-1286 *I recommend reviewing this with whitespace changes disabled.* When a member signs up, we should trigger an automation run and possibly insert a new row. Nothing happens yet when these rows are inserted--that will be done in a future change. This is development-only; triggering is a no-op in production.
4289304 to
66fb886
Compare
There was a problem hiding this comment.
Had to convert this to TypeScript so I could import it from another TypeScript file. (Alternatively, I could've added temporary-fake-database.d.ts, but I think that's strictly worse.
towards https://linear.app/ghost/issue/NY-1286
ref #28120
I recommend reviewing this with whitespace changes disabled.
When a member signs up, we should trigger an automation run and possibly insert a new row.
Nothing happens yet when these rows are inserted. That will be done in a future change.
This is development-only; triggering is a no-op in production.
I tested this by:
Adding automated tests.
Verified that the old member welcome email is still sent on member signup.
Creating this temporary endpoint and verifying that the results looked expected after member signup: