n8n/packages/core/test
Iván Ovejero cd08c8e4c6
refactor(core): Implement soft-deletions for executions (#7092)
Based on #7065 | Story: https://linear.app/n8n/issue/PAY-771

n8n on filesystem mode marks binary data to delete on manual execution
deletion, on unsaved execution completion, and on every execution
pruning cycle. We later prune binary data in a separate cycle via these
marker files, based on the configured TTL. In the context of introducing
an S3 client to manage binary data, the filesystem mode's mark-and-prune
setup is too tightly coupled to the general binary data management
client interface.

This PR...
- Ensures the deletion of an execution causes the deletion of any binary
data associated to it. This does away with the need for binary data TTL
and simplifies the filesystem mode's mark-and-prune setup.
- Refactors all execution deletions (including pruning) to cause soft
deletions, hard-deletes soft-deleted executions based on the existing
pruning config, and adjusts execution endpoints to filter out
soft-deleted executions. This reduces DB load, and keeps binary data
around long enough for users to access it when building workflows with
unsaved executions.
- Moves all execution pruning work from an execution lifecycle hook to
`execution.repository.ts`. This keeps related logic in a single place.
- Removes all marking logic from the binary data manager. This
simplifies the interface that the S3 client will meet.
- Adds basic sanity-check tests to pruning logic and execution deletion.

Out of scope:

- Improving existing pruning logic.
- Improving existing execution repository logic.
- Adjusting dir structure for filesystem mode.

---------

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2023-09-20 15:21:42 +02:00
..
helpers refactor: Use actual nodes/credentials in cli and core tests (no-changelog) (#7115) 2023-09-06 10:23:47 +02:00
workflows fix(core): Fix pairedItem for alwaysOutputData & multi identical resolve (#6405) 2023-06-21 10:38:28 +03:00
Credentials.test.ts refactor: Setup typescript project references across workflow, core, and cli (#4519) 2022-11-09 15:25:00 +01:00
NodeExecuteFunctions.test.ts refactor(core): Implement soft-deletions for executions (#7092) 2023-09-20 15:21:42 +02:00
setup.ts fix(HTTP Request Node): Show detailed error message in the UI again (#5959) 2023-04-12 14:58:05 +02:00
Validation.test.ts feat(Set Node): Overhaul (#6348) 2023-09-19 13:16:35 +03:00
WorkflowExecute.test.ts fix(core): Make node execution order configurable, and backward-compatible (#6507) 2023-07-05 18:47:34 +02:00
WorkflowExecutionMetadata.test.ts fix(core): Validate customData keys and values (#5920) (no-changelog) 2023-04-12 09:18:26 +01:00