Skip to content

Renamed WelcomeEmailAutomation model to Automation#27658

Merged
troyciesco merged 4 commits into
mainfrom
rename-welcome-email-automation-to-automation
May 18, 2026
Merged

Renamed WelcomeEmailAutomation model to Automation#27658
troyciesco merged 4 commits into
mainfrom
rename-welcome-email-automation-to-automation

Conversation

@EvanHahn
Copy link
Copy Markdown
Contributor

@EvanHahn EvanHahn commented May 4, 2026

closes https://linear.app/ghost/issue/NY-1282

This change should have no user impact.

This renames "welcome email automation" to "automation" across the codebase. It does not rename any other models, so WelcomeEmailAutomatedEmail and WelcomeEmailAutomationRun still exist.

This should be safe because we take sites offline for migrations.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 39edd91f-c9bd-4f7a-834f-a7a4bae091ea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

Walkthrough

Renames the database table welcome_email_automations to automations and replaces the WelcomeEmailAutomation Bookshelf model with Automation. Adds a non-transactional migration to perform the table rename and updates schema foreign-key targets to automations.id. Refactors models, API endpoints, services, and repositories to use the new model and relation names, updates queries/joins accordingly, and adjusts tests and fixtures to reference automations. Increments package versions in ghost/admin/package.json and ghost/core/package.json from 6.36.1-rc.0 to 6.37.0-rc.0.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change in the pull request: renaming the WelcomeEmailAutomation model to Automation across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description clearly relates to the changeset, describing a model rename from WelcomeEmailAutomation to Automation across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rename-welcome-email-automation-to-automation

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the migration [pull request] Includes migration for review label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

It looks like this PR contains a migration 👀
Here's the checklist for reviewing migrations:

General requirements

  • ⚠️ Tested performance on staging database servers, as performance on local machines is not comparable to a production environment
  • Satisfies idempotency requirement (both up() and down())
  • Does not reference models
  • Filename is in the correct format (and correctly ordered)
  • Targets the next minor version
  • All code paths have appropriate log messages
  • Uses the correct utils
  • Contains a minimal changeset
  • Does not mix DDL/DML operations
  • Tested in MySQL and SQLite

Schema changes

  • Both schema change and related migration have been implemented
  • For index changes: has been performance tested for large tables
  • For new tables/columns: fields use the appropriate predefined field lengths
  • For new tables/columns: field names follow the appropriate conventions
  • Does not drop a non-alpha table outside of a major version

Data changes

  • Mass updates/inserts are batched appropriately
  • Does not loop over large tables/datasets
  • Defends against missing or invalid data
  • For settings updates: follows the appropriate guidelines

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 82.85714% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.77%. Comparing base (82375b6) to head (0b12ed1).

Files with missing lines Patch % Lines
...mbers/members-api/repositories/event-repository.js 33.33% 2 Missing ⚠️
...ore/server/models/welcome-email-automated-email.js 50.00% 1 Missing ⚠️
...core/server/models/welcome-email-automation-run.js 50.00% 1 Missing ⚠️
...e/server/services/member-welcome-emails/service.js 80.00% 1 Missing ⚠️
...bers/members-api/repositories/member-repository.js 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27658      +/-   ##
==========================================
- Coverage   73.78%   73.77%   -0.01%     
==========================================
  Files        1522     1522              
  Lines      128637   128637              
  Branches    15415    15413       -2     
==========================================
- Hits        94911    94903       -8     
- Misses      32792    32800       +8     
  Partials      934      934              
Flag Coverage Δ
admin-tests 53.54% <ø> (ø)
e2e-tests 73.77% <82.85%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EvanHahn EvanHahn force-pushed the rename-welcome-email-automation-to-automation branch 4 times, most recently from 98f8bd5 to 3cf186d Compare May 5, 2026 18:42
@EvanHahn EvanHahn marked this pull request as ready for review May 5, 2026 19:08
@EvanHahn EvanHahn requested a review from troyciesco May 5, 2026 19:17
@EvanHahn EvanHahn force-pushed the rename-welcome-email-automation-to-automation branch from 3cf186d to bfdd26e Compare May 5, 2026 20:16
@EvanHahn EvanHahn marked this pull request as draft May 6, 2026 18:19
@EvanHahn EvanHahn force-pushed the rename-welcome-email-automation-to-automation branch from bfdd26e to 9ec10d0 Compare May 13, 2026 18:00
towards https://linear.app/ghost/issue/NY-1260

This change should have no user impact.

This renames "welcome email automation" to "automation" across the
codebase. It does *not* rename any other models, so
`WelcomeEmailAutomatedEmail` and `WelcomeEmailAutomationRun` still
exist.

This should be safe because we take sites offline for migrations.
@EvanHahn EvanHahn force-pushed the rename-welcome-email-automation-to-automation branch from 9ec10d0 to 9d015f8 Compare May 13, 2026 18:00
@EvanHahn EvanHahn marked this pull request as ready for review May 13, 2026 18:01
@EvanHahn EvanHahn added the ok to merge for me You can merge this on my behalf if you want. label May 13, 2026
Copy link
Copy Markdown
Contributor

@troyciesco troyciesco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one quick question, and also we'll have to move the migration to 6.40 and fix the merge conflicts

welcome_email_automated_emails: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
welcome_email_automation_id: {type: 'string', maxlength: 24, nullable: false, references: 'welcome_email_automations.id', constraintName: 'weae_automation_id_foreign', cascadeDelete: true},
welcome_email_automation_id: {type: 'string', maxlength: 24, nullable: false, references: 'automations.id', constraintName: 'weae_automation_id_foreign', cascadeDelete: true},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm guessing we'd change this column name to automation_id when we go about renaming this table? (same with runs)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I plan to do that in a followup (see NY-1293).

@EvanHahn EvanHahn requested a review from troyciesco May 18, 2026 19:36
@troyciesco troyciesco enabled auto-merge (squash) May 18, 2026 19:43
@troyciesco troyciesco merged commit 94c8be1 into main May 18, 2026
45 checks passed
@troyciesco troyciesco deleted the rename-welcome-email-automation-to-automation branch May 18, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migration [pull request] Includes migration for review ok to merge for me You can merge this on my behalf if you want.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants