Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Execution curation #10342

Merged
merged 88 commits into from
Sep 2, 2024
Merged

Conversation

burivuhster
Copy link
Contributor

@burivuhster burivuhster commented Aug 9, 2024

Summary

This PR introduces the execution annotation feature.
Here is an overview of the changes:

  • DB migration to add tables:
    execution_annotations - annotation for executions
    annotation_tag_entity - all annotation tags
    execution_annotation_tags - connection between annotations and tags
  • New TypeORM entities (much similar to the workflow tags)
  • New endpoints for managing annotation tags (again, same API as for managing workflow tags)
  • New endpoint for adding/updating annotation to an execution
  • Add annotations to the executions endpoints (list and get by id)
  • Add tags and rating (vote) to the list of possible filters for executions list endpoint
  • Add corresponding execution filters to the UI
  • Add showing tags and rating for executions in the list
  • Add annotation sidebar in the executions viewer
    • Add UI to edit annotation tags and rating
    • Add UI for showing customData associated with an execution
  • Refactored tags store, to re-use it both for workflow tags and annotation tags
  • Refactored TagsDropdown, TagsContainer and TagsManager: made them store agnostic, so that we can use it with different tag stores
  • Add specific wrappers: WorkflowTagsDropdown, AnnotationTagsDropdpwn, etc.
  • Hide execution annotation behind the feature flag

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/AI-256/execution-curation-p0

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Aug 9, 2024
@burivuhster burivuhster changed the title wip: Execution curation feat(core): Execution curation Aug 15, 2024
# Conflicts:
#	packages/@n8n/permissions/src/types.ts
#	packages/cli/src/executions/execution.service.ts
#	packages/cli/src/executions/execution.types.ts
#	packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue
#	packages/editor-ui/src/components/TagsDropdown.vue
#	packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsCard.vue
#	packages/editor-ui/src/components/executions/workflow/WorkflowExecutionsList.vue
#	packages/editor-ui/src/stores/executions.store.ts
Copy link

cypress bot commented Aug 28, 2024

n8n    Run #6703

Run Properties:  status check passed Passed #6703  •  git commit 1fe7ef4621: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 burivuhster 🗃️ e2e/*
Project n8n
Branch Review ai-256-execution-curation-p0
Run status status check passed Passed #6703
Run duration 04m 45s
Commit git commit 1fe7ef4621: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 burivuhster 🗃️ e2e/*
Committer Eugene Molodkin
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 422
View all changes introduced in this branch ↗︎

Copy link
Contributor

@OlegIvaniv OlegIvaniv left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my points, and great work in general! 👏

Copy link
Contributor

github-actions bot commented Sep 2, 2024

✅ All Cypress E2E specs passed

Copy link
Contributor

@tomi tomi left a comment

Choose a reason for hiding this comment

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

LGTM. Just one nit comment. Feel free to ignore as this has been open for quite some time already 👌

});
const executions = await this.createQueryBuilder('execution')
.select('execution.id')
.where('execution.id NOT IN ' + annotatedExecutionsSubQuery.getQuery())
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Could move the .getQuery() part to where this is defined and then here

Suggested change
.where('execution.id NOT IN ' + annotatedExecutionsSubQuery.getQuery())
.where(`execution.id NOT IN (${annotatedExecutionsSubQuery})`)

Comment on lines +146 to +163
test('should not prune annotated executions', async () => {
const executions = [
await createSuccessfulExecution(workflow),
await createSuccessfulExecution(workflow),
await createSuccessfulExecution(workflow),
];

await annotateExecution(executions[0].id, { vote: 'up' }, [workflow.id]);

await pruningService.softDeleteOnPruningCycle();

const result = await findAllExecutions();
expect(result).toEqual([
expect.objectContaining({ id: executions[0].id, deletedAt: null }),
expect.objectContaining({ id: executions[1].id, deletedAt: expect.any(Date) }),
expect.objectContaining({ id: executions[2].id, deletedAt: null }),
]);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for adding tests 🙏

Copy link
Contributor

github-actions bot commented Sep 2, 2024

✅ All Cypress E2E specs passed

@burivuhster burivuhster merged commit 022ddcb into master Sep 2, 2024
62 checks passed
@burivuhster burivuhster deleted the ai-256-execution-curation-p0 branch September 2, 2024 13:20
MiloradFilipovic added a commit that referenced this pull request Sep 2, 2024
* master:
  fix(core): Flush responses for ai streaming endpoints (#10633)
  fix: Re-enable infra provisioning and teardown (no-changelog) (#10636)
  feat(core): Execution curation (#10342)
  fix(Webhook Node): Add tests for utils (no-changelog) (#10613)
  fix: Fixes to cloud benchmarks (no-changelog) (#10634)
  test: Add JS CodeNode benchmark scenario (#10632)
  refactor(editor): Migrate `MainSidebar.vue` to composition API (no-changelog) (#10538)
  build: Fix `cli` nodemon config (#10628)
  docs: Add 'benchmark' scope to PR Title Conventions documentation (#10624)
  ci: Fixes to benchmarks in cloud (#10626)
  test(editor): Increase test coverage for users settings page and modal (#10623)
  fix(Wait Node): Append n8n attribution option (#10585)
  refactor(editor): Migrate `NodeSettings.vue` to composition API (#10545)
  fix(editor): Add pinned data only to manual executions in execution view (#10605)
  ci: Omit benchmark scope commits from changelog (no-changelog) (#10618)
  fix: Disable errors obfuscation (no-changelog) (#10617)
  ci: Fix script name in gh workflow (#10619)
  ci: Fix nightly image not being pushed to ghcr (#10620)
@github-actions github-actions bot mentioned this pull request Sep 5, 2024
@janober
Copy link
Member

janober commented Sep 5, 2024

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants