Deduplicated revisions when editing automations#28313
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR refines the automation action revision persistence layer to insert revisions conditionally rather than unconditionally. When editing an automation's action graph, the code now loads the latest stored revision for each submitted action and compares its persisted data against the incoming action payload using deep equality ( 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 unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a 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 |
33ba7a5 to
37f148e
Compare
37f148e to
3c9e76b
Compare
| type WaitActionData = Extract<AutomationAction, {type: 'wait'}>['data']; | ||
| type SendEmailActionData = Extract<AutomationAction, {type: 'send_email'}>['data']; | ||
| type RevisionDataFor<ActionDataT> = { | ||
| [FieldT in keyof ActionDataT]: ActionRevisionRow[FieldT & keyof ActionRevisionRow]; | ||
| }; | ||
| type WaitRevisionData = RevisionDataFor<WaitActionData>; | ||
| type SendEmailRevisionData = RevisionDataFor<SendEmailActionData>; |
There was a problem hiding this comment.
an attempt at type safety and being able to catch if fields are added/removed. i haven't looked to close at this.
There was a problem hiding this comment.
Made a related type safety improvement in e974b16.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #28313 +/- ##
==========================================
- Coverage 73.73% 73.72% -0.01%
==========================================
Files 1535 1536 +1
Lines 130958 131035 +77
Branches 15661 15665 +4
==========================================
+ Hits 96557 96606 +49
- Misses 33410 33462 +52
+ Partials 991 967 -24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Now that #28263 is merged, can we move this into ghost/core/test/unit/server/services/automations/automations-repository.test.ts?
| type WaitActionData = Extract<AutomationAction, {type: 'wait'}>['data']; | ||
| type SendEmailActionData = Extract<AutomationAction, {type: 'send_email'}>['data']; | ||
| type RevisionDataFor<ActionDataT> = { | ||
| [FieldT in keyof ActionDataT]: ActionRevisionRow[FieldT & keyof ActionRevisionRow]; | ||
| }; | ||
| type WaitRevisionData = RevisionDataFor<WaitActionData>; | ||
| type SendEmailRevisionData = RevisionDataFor<SendEmailActionData>; |
There was a problem hiding this comment.
Made a related type safety improvement in e974b16.
closes NY-1283