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(editor): Add workflow evaluation run views (no-changelog) #12258

Open
wants to merge 40 commits into
base: master
Choose a base branch
from

Conversation

OlegIvaniv
Copy link
Contributor

@OlegIvaniv OlegIvaniv commented Dec 17, 2024

Summary

This pull request extends the test definition feature by adding new views and routes for managing and inspecting test runs, metrics, node pinning, and related execution data. Changes are behind a feature flag and mainly front-end.

Routes & Views

  • /evaluation/:testId/runs (TEST_DEFINITION_RUNS):
    Lists all runs for a given test definition. Users can navigate from here to individual run details.

  • /evaluation/:testId/runs/:runId (TEST_DEFINITION_RUNS_DETAIL):
    Displays details for a specific test run, including metrics and linked executions.

These integrate into the existing /evaluation entry point:

  • /evaluation (TEST_DEFINITION):
    Lists test definitions, now with actions to start runs and navigate to the test runs page.

  • /evaluation/:testId (TEST_DEFINITION_EDIT):
    Updated to show node-pinning functionality and allow configuration of metrics and tags. A modal is available for selecting nodes to pin.

CleanShot.2024-12-17.at.12.58.43.mp4

Key UI Components & Changes

  • Node Pinning (NodesPinning.vue):
    Accessed from the test definition edit view, this modal lets users pin nodes. Pinned nodes keep consistent execution data across test runs.

  • Metrics Management (MetricsInput.vue, MetricsChart.vue):
    Users can define metrics(MetricsInput.vue) to track test performance. Metrics are displayed in charts over multiple runs (MetricsChart.vue) and handled with CRUD operations for metrics in useTestDefinitionForm.ts -> testDefinition.store.ee.ts -> @/api/testDefinition.ee.

  • N8nSelect & TagsDropdown:
    The N8nSelect and TagsDropdown components have been updated to include a multipleLimit prop and to handle tag creation and selection more gracefully.

  • Header Tabs (MainHeader.vue):
    The top navigation now relies on arrays of route names to determine the active tab. This approach supports new test definition routes alongside existing workflow and execution routes.

State & API Integrations

  • State Store (testDefinition.store.ee.ts):
    The store now manages:

    • Test runs: fetching all runs for a definition, getting a single run, starting a run, and deleting runs.
    • Metrics: fetching, creating, updating, deleting metrics per test definition.
      It integrates with new API client endpoints defined in @/api/testDefinition.ee.
  • TestRunnerService (test-runner.service.ee.ts):
    Temporarily includes logic to pass testRunId as metadata to evaluation workflow executions. This allows us to fetch executions related to a run.
    Note: This is a short-term solution; future backend improvements should supersede this.

Auto-Save & Polling

  • The test definition edit form auto-saves changes (e.g., description, tags, metrics) after a debounce period.
  • The store polls for test runs that are in 'new' or 'running' states, updating their status until completion or error.

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)

burivuhster and others added 30 commits November 27, 2024 14:35
- Add API endpoints for test metrics CRUD operations
- Implement metrics input component with add/delete functionality
- Simplify tags input component to use single tag selection
Add a new slot 'node-controls' to Canvas components hierarchy (Canvas, WorkflowCanvas, CanvasNode)
to allow custom node controls injection. The slot provides node data and class toggle functionality
to customize node appearance.
- Add tooltips to test definition steps explaining their purpose
- Limit tag selection to single tag in test definitions
- Add multiple-limit prop to N8nSelect component
- Update TagsDropdown to support multiple-limit
- Extract route lists into dedicated arrays for better organization
- Replace conditional tab selection with array-based lookup
- Remove mainHeaderTab from router meta in favor of route-based logic
This commit adds several improvements to the test runner functionality:

- Add test run detail view showing execution metrics and test case results
- Track test run IDs in evaluation workflow executions for better traceability
- Add dark mode support for metrics charts
- Fix tooltip behavior in evaluation steps
- Improve table cell handling for external links
- Update API types and response handling
- Clean up unused code and comments
This commit adds the ability to pin specific nodes during test runs. Key changes include:

- Add new NodesPinning.vue component for managing pinned nodes in test definitions
- Extend TestDefinitionRecord interface to support mockedNodes
- Add node toolbar slot to Canvas component for custom node actions
- Update CanvasNode to support dynamic class updates via event bus
- Add UI for pinning/unpinning nodes with visual feedback
- Remove debug console.logs from test definition store

This feature allows users to specify which nodes' execution data should be preserved during test runs by pinning them in the workflow canvas.
- Refactor NodesPinning component to fix TS errors and improve node selection
- Update test runs table layout with better column ordering and resizable columns
- Add empty state for test runs with action to start new test
- Show metrics chart only when metrics are available
- Update UI text to use "test runs" instead of "test cases"
- Improve test definition edit view with collapsible node selection
- Fix workflow loading sequence in NodesPinning component
- Add border and make columns resizable in TestDefinitionTable
…tion support

- Introduced a new method to update node classes for pinning/unpinning actions.
- Refactored the disableAllNodes function to utilize the new updateNodeClasses method.
- Added localization for the pin button tooltip in the
- Updated CanvasNodeEventBusEvents type to include payload structure for node class updates.
@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 Dec 17, 2024
- Updated import path for useMetricsChart to improve structure.
- Enhanced chart options to include dynamic x-axis title based on locale.
- Adjusted styling for metric selection to use max-width for better responsiveness.
@OlegIvaniv OlegIvaniv changed the title feat(editor): Add workflow evaluation run views (no-changelog) feat(editor): Add workflow evaluation run views (no-changelog) Dec 17, 2024
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 ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants