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): Add workflowId filter to the test-definitions endpoint (no-changelog) #11831

Conversation

burivuhster
Copy link
Contributor

@burivuhster burivuhster commented Nov 21, 2024

Summary

This PR adds filter by workflowId to the /test-definitions list endpoint.

Related Linear tickets, Github issues, and Community forum posts

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 labels Nov 21, 2024
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/cli/src/middlewares/list-query/filter.ts 66.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@burivuhster burivuhster marked this pull request as ready for review November 21, 2024 14:16
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.

LGTM, just one minor comment but feel free to merge without it

Comment on lines +21 to +26
if (!accessibleWorkflowIds.includes(options.filter.workflowId as string)) {
throw new ForbiddenError('User does not have access to the workflow');
}

where.workflow = {
id: options.filter.workflowId as string,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we improve the type of options here instead of coercing it to string 2x?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be great to do for all places using filter middleware. I will check it later

Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Nov 26, 2024

n8n    Run #8082

Run Properties:  status check failed Failed #8082  •  git commit 4057ed4c14: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 burivuhster 🗃️ e2e/*
Project n8n
Branch Review ai-456-api-add-option-to-filter-test-definitions-by-a-specific
Run status status check failed Failed #8082
Run duration 38m 38s
Commit git commit 4057ed4c14: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 burivuhster 🗃️ e2e/*
Committer Eugene Molodkin
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
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 280
View all changes introduced in this branch ↗︎

Tests for review

Failed  45-workflow-selector-parameter.cy.ts • 1 failed test

View Output Video

Test Artifacts
Workflow Selector Parameter > should render add resource option and redirect to the correct route when clicked Test Replay Screenshots Video
Failed  30-editor-after-route-changes.cy.ts • 0 failed tests

View Output

Test Artifacts
Failed  42-nps-survey.cy.ts • 0 failed tests

View Output

Test Artifacts
Failed  6-code-node.cy.ts • 0 failed tests

View Output

Test Artifacts
Failed  11-inline-expression-editor.cy.ts • 0 failed tests

View Output

Test Artifacts

The first 5 failed specs are shown, see all 49 specs in Cypress Cloud.

Flakiness  e2e/30-langchain.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Langchain Integration > should be able to open and execute Agent node Test Replay Screenshots Video

Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

@burivuhster burivuhster force-pushed the ai-456-api-add-option-to-filter-test-definitions-by-a-specific branch from 4057ed4 to 0b94403 Compare November 26, 2024 11:46
@burivuhster burivuhster force-pushed the ai-456-api-add-option-to-filter-test-definitions-by-a-specific branch from 0b94403 to 73df6de Compare November 26, 2024 12:58
@burivuhster burivuhster merged commit 6b23ad0 into master Nov 26, 2024
22 checks passed
@burivuhster burivuhster deleted the ai-456-api-add-option-to-filter-test-definitions-by-a-specific branch November 26, 2024 14:01
@janober
Copy link
Member

janober commented Nov 27, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants