Skip to content

Commit

Permalink
Merge branch 'master' into ADO-1322-fix-name-field-code-injection
Browse files Browse the repository at this point in the history
* master: (24 commits)
  fix(Crypto Node): Fix issue with value not appearing for Sign action (#7619)
  feat(NocoDB Node): Add new data apis and workspace support (#7329)
  fix(Facebook Lead Ads Trigger Node): Fix issue with missing scope for business management  (#7616)
  refactor(core): Stop reporting to Sentry missing-node-on-retry error (no-changelog) (#7648)
  fix(editor): Fix workflow history prune time limit (getting hours instead of days) (#7644)
  fix(core): Comply with custom default for workflow saving settings (#7634)
  feat(core): Initial support for two-way communication over websockets (#7570)
  ci: Conditionally re-enable coverage for frontend packages (no-changelog) (#7641)
  ci(core): Load config schema after process.env has been overwritten (no-changelog) (#7550)
  fix(core): Make password-reset urls valid only for single-use (#7622)
  fix: Error handling on forgot password page (no-changelog) (#7633)
  ci: Improve CI performance (no-changelog) (#7637)
  fix(core): Ensure pruning starts only after migrations have completed (#7626)
  feat(core): Coordinate workflow activation in multiple main scenario in internal API (#7566)
  fix(editor): Fix local storage flags defaulting to undefined string (#7603)
  fix(editor): Reset canvas zoom before workspace reset in node view (#7625)
  fix(editor): More dark-mode fixes (no-changelog) (#7624)
  fix(core): Fix accessor error when running partial execution (#7618)
  fix(editor): Fix issue that frontend breaks with unkown nodes (#7596)
  fix(core): Ensure `init` before checking leader or follower in multi-main scenario (#7621)
  ...
  • Loading branch information
MiloradFilipovic committed Nov 8, 2023
2 parents 9477e66 + 5df583f commit 72d7e52
Show file tree
Hide file tree
Showing 113 changed files with 4,600 additions and 2,188 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:
with:
ref: ${{ inputs.branch }}
nodeVersion: ${{ matrix.node-version }}
cacheKey: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
cacheKey: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
collectCoverage: true

lint:
name: Lint changes
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/units-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ on:
required: false
default: ''
type: string
collectCoverage:
required: false
default: 'false'
type: string

jobs:
unit-test:
name: Unit tests
runs-on: ubuntu-latest
env:
COVERAGE_ENABLED: ${{ inputs.collectCoverage }}
steps:
- uses: actions/checkout@v3.5.3
with:
Expand Down Expand Up @@ -51,10 +57,14 @@ jobs:
path: ./packages/**/dist
key: ${{ inputs.cacheKey }}

- name: Test
run: pnpm test
- name: Test Backend
run: pnpm test:backend

- name: Test Frontend
run: pnpm test:frontend

- name: Upload coverage to Codecov
if: ${{ inputs.collectCoverage == 'true' }}
uses: codecov/codecov-action@v3
with:
files: packages/@n8n/client-oauth2/coverage/cobertura-coverage.xml,packages/cli/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/design-system/coverage/cobertura-coverage.xml,packages/editor-ui/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
36 changes: 36 additions & 0 deletions cypress/e2e/12-canvas.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,40 @@ describe('Canvas Node Manipulation and Navigation', () => {
NDVDialog.actions.close();
});
});

it('should render connections correctly if unkown nodes are present', () => {
const unknownNodeName = 'Unknown node';
cy.createFixtureWorkflow('workflow-with-unknown-nodes.json', 'Unknown nodes');

WorkflowPage.getters.canvasNodeByName(`${unknownNodeName} 1`).should('exist');
WorkflowPage.getters.canvasNodeByName(`${unknownNodeName} 2`).should('exist');
WorkflowPage.actions.zoomToFit();

cy.draganddrop(
WorkflowPage.getters.getEndpointSelector('plus', `${unknownNodeName} 1`),
WorkflowPage.getters.getEndpointSelector('input', EDIT_FIELDS_SET_NODE_NAME),
);

cy.draganddrop(
WorkflowPage.getters.getEndpointSelector('plus', `${unknownNodeName} 2`),
WorkflowPage.getters.getEndpointSelector('input', `${EDIT_FIELDS_SET_NODE_NAME}1`),
);

WorkflowPage.actions.executeWorkflow();
cy.contains('Node not found').should('be.visible');

WorkflowPage.getters
.canvasNodeByName(`${unknownNodeName} 1`)
.find('[data-test-id=delete-node-button]')
.click({ force: true });

WorkflowPage.getters
.canvasNodeByName(`${unknownNodeName} 2`)
.find('[data-test-id=delete-node-button]')
.click({ force: true });

WorkflowPage.actions.executeWorkflow();

cy.contains('Node not found').should('not.exist');
});
});
67 changes: 67 additions & 0 deletions cypress/e2e/30-editor-after-route-changes.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,40 @@ const editWorkflowMoreAndActivate = () => {
cy.get('.el-notification .el-notification--error').should('not.exist');
};

const switchBetweenEditorAndHistory = () => {
workflowPage.getters.workflowHistoryButton().click();
cy.wait(['@getHistory']);
cy.wait(['@getVersion']);

cy.intercept('GET', '/rest/workflows/*').as('workflowGet');
workflowHistoryPage.getters.workflowHistoryCloseButton().click();
cy.wait(['@workflowGet']);
cy.wait(1000);

workflowPage.getters.canvasNodes().first().should('be.visible');
workflowPage.getters.canvasNodes().last().should('be.visible');
}

const switchBetweenEditorAndWorkflowlist = () => {
cy.getByTestId('menu-item').first().click();
cy.wait(['@getUsers', '@getWorkflows', '@getActive', '@getCredentials']);

cy.getByTestId('resources-list-item').first().click();

workflowPage.getters.canvasNodes().first().should('be.visible');
workflowPage.getters.canvasNodes().last().should('be.visible');
}

const zoomInAndCheckNodes = () => {
cy.getByTestId('zoom-in-button').click();
cy.getByTestId('zoom-in-button').click();
cy.getByTestId('zoom-in-button').click();
cy.getByTestId('zoom-in-button').click();

workflowPage.getters.canvasNodes().first().should('not.be.visible');
workflowPage.getters.canvasNodes().last().should('not.be.visible');
}

describe('Editor actions should work', () => {
beforeEach(() => {
cy.enableFeature('debugInEditor');
Expand Down Expand Up @@ -149,3 +183,36 @@ describe('Editor actions should work', () => {
editWorkflowMoreAndActivate();
});
});

describe('Editor zoom should work after route changes', () => {
beforeEach(() => {
cy.enableFeature('debugInEditor');
cy.enableFeature('workflowHistory');
cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password });
workflowPage.actions.visit();
cy.createFixtureWorkflow('Lots_of_nodes.json', `Lots of nodes`);
workflowPage.actions.saveWorkflowOnButtonClick();
});

it('after switching between Editor and Workflow history and Workflow list', () => {
cy.intercept('GET', '/rest/workflow-history/workflow/*/version/*').as('getVersion');
cy.intercept('GET', '/rest/workflow-history/workflow/*').as('getHistory');
cy.intercept('GET', '/rest/users').as('getUsers');
cy.intercept('GET', '/rest/workflows').as('getWorkflows');
cy.intercept('GET', '/rest/active').as('getActive');
cy.intercept('GET', '/rest/credentials').as('getCredentials');

switchBetweenEditorAndHistory();
zoomInAndCheckNodes();
switchBetweenEditorAndHistory();
switchBetweenEditorAndHistory();
zoomInAndCheckNodes();
switchBetweenEditorAndWorkflowlist();
zoomInAndCheckNodes();
switchBetweenEditorAndWorkflowlist();
switchBetweenEditorAndWorkflowlist();
zoomInAndCheckNodes();
switchBetweenEditorAndHistory();
switchBetweenEditorAndWorkflowlist();
});
});
Loading

0 comments on commit 72d7e52

Please sign in to comment.