Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fix-chat-response-t…
Browse files Browse the repository at this point in the history
…o-webhook
  • Loading branch information
ShireenMissi committed Aug 15, 2024
2 parents c29c71d + c5a0c04 commit fbb63c0
Show file tree
Hide file tree
Showing 2,000 changed files with 62,024 additions and 41,508 deletions.
1 change: 1 addition & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ services:
- ..:/workspaces:cached
command: sleep infinity
environment:
DB_POSTGRESDB_HOST: postgres
DB_TYPE: postgresdb
DB_POSTGRESDB_PASSWORD: password
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ packages/**/.turbo
packages/**/*.test.*
.git
.github
!.github/scripts
*.tsbuildinfo
packages/cli/dist/**/e2e.*
docker/compose
Expand Down
44 changes: 44 additions & 0 deletions .github/scripts/ensure-provenance-fields.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { writeFile, readFile, copyFile } from 'fs/promises';
import { resolve, dirname } from 'path';
import child_process from 'child_process';
import { fileURLToPath } from 'url';
import { promisify } from 'util';

const exec = promisify(child_process.exec);

const commonFiles = ['LICENSE.md', 'LICENSE_EE.md'];

const baseDir = resolve(dirname(fileURLToPath(import.meta.url)), '../..');
const packages = JSON.parse((await exec('pnpm ls -r --only-projects --json')).stdout);

for (let { name, path, version, private: isPrivate } of packages) {
if (isPrivate) continue;

const packageFile = resolve(path, 'package.json');
const packageJson = {
...JSON.parse(await readFile(packageFile, 'utf-8')),
// Add these fields to all published package.json files to ensure provenance checks pass
license: 'SEE LICENSE IN LICENSE.md',
homepage: 'https://n8n.io',
author: {
name: 'Jan Oberhauser',
email: '[email protected]',
},
repository: {
type: 'git',
url: 'git+https://github.com/n8n-io/n8n.git',
},
};

// Copy over LICENSE.md and LICENSE_EE.md into every published package, and ensure they get included in the published package
await Promise.all(
commonFiles.map(async (file) => {
await copyFile(resolve(baseDir, file), resolve(path, file));
if (packageJson.files && !packageJson.files.includes(file)) {
packageJson.files.push(file);
}
}),
);

await writeFile(packageFile, JSON.stringify(packageJson, null, 2) + '\n');
}
2 changes: 1 addition & 1 deletion .github/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"debug": "4.3.4",
"glob": "10.3.10",
"p-limit": "3.1.0",
"picocolors": "1.0.0",
"picocolors": "1.0.1",
"semver": "7.5.4",
"tempfile": "5.0.0",
"typescript": "*"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
const { writeFileSync } = require('fs');
const { resolve } = require('path');
const baseDir = resolve(__dirname, '..');
const baseDir = resolve(__dirname, '../..');

const trimPackageJson = (packageName) => {
const filePath = resolve(baseDir, 'packages', packageName, 'package.json');
const { scripts, peerDependencies, devDependencies, dependencies, ...packageJson } = require(
filePath,
);
if (packageName === '@n8n/chat') {
packageJson.dependencies = dependencies;
}
writeFileSync(filePath, JSON.stringify(packageJson, null, 2) + '\n', 'utf-8');
};

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/[email protected]

- name: Build
run: pnpm build

Expand All @@ -38,12 +41,14 @@ jobs:
needs: install-and-build
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
node-version: [18.x, 20.x, 22.4]
with:
ref: ${{ inputs.branch }}
nodeVersion: ${{ matrix.node-version }}
cacheKey: ${{ github.sha }}-base:build
collectCoverage: true
collectCoverage: ${{ matrix.node-version == '20.x' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

lint:
name: Lint
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/ci-postgres-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/[email protected]

- name: Build Backend
run: pnpm build:backend

Expand All @@ -52,6 +55,9 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/[email protected]

- name: Restore cached build artifacts
uses: actions/cache/[email protected]
with:
Expand All @@ -60,7 +66,7 @@ jobs:

- name: Test SQLite Pooled
working-directory: packages/cli
run: pnpm jest --coverage
run: pnpm jest

mysql:
name: MySQL
Expand All @@ -78,6 +84,9 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/[email protected]

- name: Restore cached build artifacts
uses: actions/cache/[email protected]
with:
Expand Down Expand Up @@ -112,6 +121,9 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/[email protected]

- name: Restore cached build artifacts
uses: actions/cache/[email protected]
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/[email protected]

- name: Build
run: pnpm build

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Docker Image CI

on:
release:
types: [published]
push:
tags:
- 'n8n@*'

jobs:
build:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/e2e-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ jobs:
runTests: false
install: false
build: pnpm build
env:
VUE_APP_MAX_PINNED_DATA_SIZE: 16384

- name: Cypress install
working-directory: cypress
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linting-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/[email protected]

- name: Build
if: ${{ inputs.cacheKey == '' }}
run: pnpm build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/notify-pr-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
(github.event_name == 'pull_request' && github.event.pull_request.merged == false && github.event.action == 'closed')
steps:
- uses: fjogeleit/http-request-action@dea46570591713c7de04a5b556bf2ff7bdf0aa9c # v1
if: ${{!contains(github.event.pull_request.labels.*.name, 'community')}}
name: Notify
env:
PR_URL: ${{ github.event.pull_request.html_url }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
- name: Publish to NPM
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
node scripts/trim-fe-packageJson.js
node .github/scripts/trim-fe-packageJson.js
node .github/scripts/ensure-provenance-fields.mjs
sed -i "s/default: 'dev'/default: 'stable'/g" packages/cli/dist/config/schema.js
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc --no-git-checks
npm dist-tag rm n8n rc
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
env:
N8N_ENCRYPTION_KEY: ${{secrets.ENCRYPTION_KEY}}
SKIP_STATISTICS_EVENTS: true
DB_SQLITE_POOL_SIZE: 4
# -
# name: Export credentials
# if: always()
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/units-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
required: false
default: false
type: boolean
secrets:
CODECOV_TOKEN:
description: 'Codecov upload token.'
required: false

jobs:
unit-test:
Expand All @@ -45,6 +49,10 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup build cache
if: inputs.collectCoverage != true
uses: rharkor/[email protected]

- name: Build
if: ${{ inputs.cacheKey == '' }}
run: pnpm build
Expand All @@ -67,6 +75,6 @@ jobs:

- name: Upload coverage to Codecov
if: inputs.collectCoverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4.5.0
with:
files: packages/@n8n/chat/coverage/cobertura-coverage.xml,packages/@n8n/nodes-langchain/coverage/cobertura-coverage.xml,packages/@n8n/permissions/coverage/cobertura-coverage.xml,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/@n8n/codemirror-lang/coverage/cobertura-coverage.xml,packages/editor-ui/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
Loading

0 comments on commit fbb63c0

Please sign in to comment.