Skip to content

feat(editor): Rollout improved log view #15202

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

Merged
merged 2 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cypress/composables/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
* Accessors
*/

export function getOverviewPanel() {
return cy.getByTestId('logs-overview');
}

export function getOverviewPanelBody() {
return cy.getByTestId('logs-overview-body');
}

export function getOverviewStatus() {
return cy.getByTestId('logs-overview-status');
}
Expand Down
11 changes: 0 additions & 11 deletions cypress/composables/modals/chat-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,10 @@ export function getManualChatModalCloseButton() {
return cy.getByTestId('workflow-chat-button');
}

export function getManualChatModalLogs() {
return cy.getByTestId('canvas-chat-logs');
}
export function getManualChatDialog() {
return getManualChatModal().getByTestId('workflow-lm-chat-dialog');
}

export function getManualChatModalLogsTree() {
return getManualChatModalLogs().getByTestId('lm-chat-logs-tree');
}

export function getManualChatModalLogsEntries() {
return getManualChatModalLogs().getByTestId('lm-chat-logs-entry');
}

/**
* Actions
*/
Expand Down
11 changes: 5 additions & 6 deletions cypress/e2e/233-AI-switch-to-logs-on-error.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { ExecutionError } from 'n8n-workflow';

import * as logs from '../composables/logs';
import {
closeManualChatModal,
getManualChatMessages,
getManualChatModalLogs,
getManualChatModalLogsEntries,
sendManualChatMessage,
} from '../composables/modals/chat-modal';
import { setCredentialValues } from '../composables/modals/credential-modal';
Expand Down Expand Up @@ -199,10 +198,10 @@ function checkMessages(inputMessage: string, outputMessage: string) {
messages.should('contain', inputMessage);
messages.should('contain', outputMessage);

getManualChatModalLogs().should('exist');
getManualChatModalLogsEntries()
.should('have.length', 1)
.should('contain', AI_MEMORY_POSTGRES_NODE_NAME);
logs.getOverviewPanelBody().should('exist');
logs.getLogEntries().should('have.length', 2);
logs.getSelectedLogEntry().should('have.text', 'AI Agent');
logs.getOutputPanel().should('contain', AI_MEMORY_POSTGRES_NODE_NAME);
}

describe("AI-233 Make root node's logs pane active in case of an error in sub-nodes", () => {
Expand Down
15 changes: 8 additions & 7 deletions cypress/e2e/30-langchain.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import {
EDIT_FIELDS_SET_NODE_NAME,
CHAT_TRIGGER_NODE_DISPLAY_NAME,
} from './../constants';
import * as logs from '../composables/logs';
import {
closeManualChatModal,
getManualChatInput,
getManualChatMessages,
getManualChatModal,
getManualChatModalLogs,
getManualChatModalLogsEntries,
getManualChatModalLogsTree,
sendManualChatMessage,
} from '../composables/modals/chat-modal';
import { setCredentialValues } from '../composables/modals/credential-modal';
Expand Down Expand Up @@ -308,12 +307,14 @@ describe('Langchain Integration', () => {
messages.should('contain', inputMessage);
messages.should('contain', outputMessage);

getManualChatModalLogsTree().should('be.visible');
getManualChatModalLogsEntries().should('have.length', 1);
logs.getOverviewPanel().should('be.visible');
logs.getLogEntries().should('have.length', 2);
logs.getLogEntries().eq(0).should('have.text', 'AI Agent');
logs.getLogEntries().eq(1).should('have.text', 'OpenAI Chat Model');

closeManualChatModal();
getManualChatModalLogs().should('not.exist');
getManualChatModal().should('not.exist');
logs.getOverviewPanelBody().should('not.exist');
getManualChatInput().should('not.exist');
});

it('should auto-add chat trigger and basic LLM chain when adding LLM node', () => {
Expand Down
3 changes: 2 additions & 1 deletion cypress/utils/executions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { stringify } from 'flatted';
import { pick } from 'lodash';
import type {
IDataObject,
IRunData,
Expand Down Expand Up @@ -114,7 +115,7 @@ export function runMockWorkflowExecution({
cy.push('nodeExecuteBefore', {
executionId,
nodeName,
data: nodeRunData,
data: pick(nodeRunData, ['startTime', 'executionIndex', 'source', 'hints']),
});
cy.push('nodeExecuteAfter', {
executionId,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export const schema = {
logs_view: {
enabled: {
format: Boolean,
default: false,
default: true,
Copy link

Choose a reason for hiding this comment

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

Enabling a feature marked as 'temporary' by default without updating its documentation

env: 'N8N_ENABLE_LOGS_VIEW',
doc: 'Temporary env variable to enable logs view',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ watch(
type="secondary"
icon="trash"
icon-size="medium"
data-test-id="clear-execution-data-button"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this intentionally have the same data-test-id as CanvasClearExecutionDataButton ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we only show either of the two (and we'll remove the other one eventually when we'll clean up the feature flag)

:class="$style.clearButton"
@click.stop="emit('clearExecutionData')"
>{{ locale.baseText('logs.overview.header.actions.clearExecution') }}</N8nButton
Expand Down
Loading