Skip to content

Commit

Permalink
Merge branch 'master' into ADO-2220-agent-assistant-poc
Browse files Browse the repository at this point in the history
* master:
  feat(core): Upgrade all langchain related dependencies (#9504)
  ci: Switch to Node.js 20 by default. Add initial support for Node.js 22 (#9501)
  fix(core): Prevent re-parsing of dynamically loaded options (#9503)
  fix(core): Fix `level` in `warn` method of error reporter (no-changelog) (#9502)

# Conflicts:
#	packages/cli/package.json
#	packages/cli/src/requests.ts
#	pnpm-lock.yaml
  • Loading branch information
MiloradFilipovic committed May 24, 2024
2 parents a052454 + a77e8dd commit bafe9b3
Show file tree
Hide file tree
Showing 41 changed files with 1,195 additions and 2,196 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-documentation-urls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- uses: actions/checkout@v4.1.1

- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'

- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
uses: actions/checkout@v4.1.1

- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'

- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v4.0.1
uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x

- run: npm install --prefix=.github/scripts --no-package-lock

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

Expand Down
27 changes: 9 additions & 18 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@ jobs:
install-and-build:
runs-on: ubuntu-latest

timeout-minutes: 30

strategy:
matrix:
node-version: [18.x, 20.x]
timeout-minutes: 10

steps:
- uses: actions/checkout@v4.1.1

- run: corepack enable
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: ${{ matrix.node-version }}
node-version: 20.x
cache: pnpm

- name: Install dependencies
Expand All @@ -35,39 +30,35 @@ jobs:
uses: actions/cache/save@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
key: ${{ github.sha }}-base:build

unit-test:
name: Unit tests
uses: ./.github/workflows/units-tests-reusable.yml
needs: install-and-build
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
with:
ref: ${{ inputs.branch }}
nodeVersion: ${{ matrix.node-version }}
cacheKey: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
cacheKey: ${{ github.sha }}-base:build
collectCoverage: true

lint:
name: Lint changes
runs-on: ubuntu-latest
needs: install-and-build
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4.1.1
with:
repository: n8n-io/n8n
ref: ${{ inputs.branch }}

- run: corepack enable
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: ${{ matrix.node-version }}
node-version: 20.x
cache: pnpm

- name: Install dependencies
Expand All @@ -77,7 +68,7 @@ jobs:
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
key: ${{ github.sha }}-base:build

- name: Lint
env:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci-postgres-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

Expand All @@ -46,9 +46,9 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

Expand All @@ -72,9 +72,9 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

Expand Down Expand Up @@ -106,9 +106,9 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1
- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/ci-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ jobs:
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- run: corepack enable
- name: Use Node.js 18
uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: pnpm

- name: Install dependencies
Expand All @@ -29,15 +28,15 @@ jobs:
uses: actions/cache/save@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}-base:18-test-lint
key: ${{ github.sha }}-base:build

unit-test:
name: Unit tests
uses: ./.github/workflows/units-tests-reusable.yml
needs: install
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
cacheKey: ${{ github.sha }}-base:18-test-lint
cacheKey: ${{ github.sha }}-base:build

lint:
name: Lint changes
Expand All @@ -50,10 +49,9 @@ jobs:
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- run: corepack enable
- name: Use Node.js 18
uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: pnpm

- name: Install dependencies
Expand All @@ -63,7 +61,7 @@ jobs:
uses: actions/cache/restore@v4.0.0
with:
path: ./packages/**/dist
key: ${{ github.sha }}-base:18-test-lint
key: ${{ github.sha }}-base:build

- name: Lint
run: pnpm lint
3 changes: 2 additions & 1 deletion .github/workflows/docker-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ on:
description: 'Node.js version to build this image with.'
type: choice
required: true
default: '18'
default: '20'
options:
- '18'
- '20'
- '22'

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-create-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
ref: ${{ github.event.inputs.base-branch }}

- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x

- run: npm install --prefix=.github/scripts --no-package-lock

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
fetch-depth: 0

- run: corepack enable
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-push-to-channel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
- run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm dist-tag add n8n@${{ github.event.inputs.version }} ${{ github.event.inputs.release-channel }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
- run: corepack enable
working-directory: n8n

- uses: actions/setup-node@v4.0.1
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
cache-dependency-path: 'n8n/pnpm-lock.yaml'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/units-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
description: 'Version of node to use.'
required: false
type: string
default: '18.x'
default: 20.x
cacheKey:
description: 'Cache key for modules and build artifacts.'
required: false
Expand All @@ -37,7 +37,7 @@ jobs:

- run: corepack enable
- name: Use Node.js ${{ inputs.nodeVersion }}
uses: actions/setup-node@v4.0.1
uses: actions/setup-node@v4.0.2
with:
node-version: ${{ inputs.nodeVersion }}
cache: pnpm
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies are installed and the packages get linked correctly. Here's a short

#### Node.js

[Node.js](https://nodejs.org/en/) version 16.9 or newer is required for development purposes.
[Node.js](https://nodejs.org/en/) version 18.10 or newer is required for development purposes.

#### pnpm

Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/39-projects.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ describe('Projects', () => {
});

projects.getMenuItems().last().click();
cy.intercept('GET', '/rest/credentials*').as('credentialsList');
cy.intercept('GET', '/rest/credentials*').as('credentialsListProjectId');
projects.getProjectTabCredentials().click();
cy.wait('@credentialsList').then((interception) => {
cy.wait('@credentialsListProjectId').then((interception) => {
const url = new URL(interception.request.url);
const queryParams = new URLSearchParams(url.search);
const filter = queryParams.get('filter');
Expand All @@ -150,9 +150,9 @@ describe('Projects', () => {
projects.getHomeButton().click();
workflowsPage.getters.workflowCards().should('have.length', 2);

cy.intercept('GET', '/rest/credentials*').as('credentialsList');
cy.intercept('GET', '/rest/credentials*').as('credentialsListFilterless');
projects.getProjectTabCredentials().click();
cy.wait('@credentialsList').then((interception) => {
cy.wait('@credentialsListFilterless').then((interception) => {
expect(interception.request.url).not.to.contain('filter');
});

Expand Down
2 changes: 1 addition & 1 deletion docker/images/n8n-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NODE_VERSION=18
ARG NODE_VERSION=20

# 1. Use a builder step to download various dependencies
FROM node:${NODE_VERSION}-alpine as builder
Expand Down
2 changes: 1 addition & 1 deletion docker/images/n8n-custom/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NODE_VERSION=18
ARG NODE_VERSION=20

# 1. Create an image to build n8n
FROM --platform=linux/amd64 n8nio/base:${NODE_VERSION} as builder
Expand Down
2 changes: 1 addition & 1 deletion docker/images/n8n/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NODE_VERSION=18
ARG NODE_VERSION=20
FROM n8nio/base:${NODE_VERSION}

ARG N8N_VERSION
Expand Down
6 changes: 6 additions & 0 deletions packages/@n8n/nodes-langchain/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,11 @@ module.exports = {
'n8n-nodes-base/node-param-type-options-password-missing': 'error',
},
},
{
files: ['**/*.test.ts', '**/test/**/*.ts'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from 'n8n-workflow';

import { AgentExecutor, ChatAgent, ZeroShotAgent } from 'langchain/agents';
import type { BaseLanguageModel } from 'langchain/base_language';
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
import type { BaseOutputParser } from '@langchain/core/output_parsers';
import { PromptTemplate } from '@langchain/core/prompts';
import { CombiningOutputParser } from 'langchain/output_parsers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import type {
import { loadSummarizationChain } from 'langchain/chains';
import type { BaseLanguageModel } from '@langchain/core/language_models/base';
import type { Document } from '@langchain/core/documents';
import type { TextSplitter } from 'langchain/text_splitter';
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';
import type { TextSplitter } from '@langchain/textsplitters';
import { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';
import { N8nJsonLoader } from '../../../../utils/N8nJsonLoader';
import { N8nBinaryLoader } from '../../../../utils/N8nBinaryLoader';
import { getTemplateNoticeField } from '../../../../utils/sharedFields';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type SupplyData,
} from 'n8n-workflow';

import type { TextSplitter } from 'langchain/text_splitter';
import type { TextSplitter } from '@langchain/textsplitters';

import { logWrapper } from '../../../utils/logWrapper';
import { N8nBinaryLoader } from '../../../utils/N8nBinaryLoader';
Expand Down
Loading

0 comments on commit bafe9b3

Please sign in to comment.