Skip to content

Commit

Permalink
Merge branch 'master' into N8N-5677-workflows-store-refactor
Browse files Browse the repository at this point in the history
* master: (358 commits)
  refactor: Remove n8n-core dependency in nodes-base (no-changelog) (#5649)
  🚀 Release 0.219.0 (#5659)
  fix(core): Fix trying to pipe a non stream on errors (no-changelog) (#5660)
  ci: Fix e2e tests (no-changelog) (#5658)
  fix(core): Fix issues with LDAP reset and LDAP init (no-changelog) (#5657)
  feat(HTTP Request Node): Move from Binary Buffer to Binary streaming (#5610)
  feat(editor): Only redirect new users to blank canvas (no-changelog) (#5654)
  feat(editor): Do not automatically add manual trigger on node plus (#5644)
  feat(core): Allow using middlewares with decorators on a per-route basis (no-changelog) (#5656)
  refactor(core): Convert more routes to use the decorator pattern (no-changelog) (#5611)
  fix: Fetch credentials on workflows view to include in duplicated workflows (#5532)
  ci: Add PR checklist (#5628)
  feat(Mindee Node): Add support for v4 API (#5559)
  feat(Microsoft SQL Node): Add support for self signed certificates (#5160)
  fix(editor): Only fetch new versions at app launch (#5647)
  fix(core): Use new version of riot-tmpl in workflow package (no-changelog) (#5619)
  feat(core): Refactor and add SAML preferences for service provider instance (#5637)
  docs(Github Trigger Node): Add notice and more meaningful error around permissions (#5551)
  feat(Cal Trigger Node): Update to support v2 webhooks (#5331)
  feat(editor): Redirect users to canvas if they don't have any workflows (#5629)
  ...
  • Loading branch information
MiloradFilipovic committed Mar 10, 2023
2 parents 029cbca + dd93c08 commit 8e2a475
Show file tree
Hide file tree
Showing 1,392 changed files with 56,535 additions and 23,789 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages/cli/src/databases/migrations/ @n8n-io/migrations-review
52 changes: 52 additions & 0 deletions .github/scripts/bump-versions.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import semver from 'semver';
import { writeFile, readFile } from 'fs/promises';
import { resolve } from 'path';
import child_process from 'child_process';
import { promisify } from 'util';
import assert from 'assert';

const exec = promisify(child_process.exec);

const rootDir = process.cwd();
const releaseType = process.env.RELEASE_TYPE;
assert.match(releaseType, /^(patch|minor|major)$/, 'Invalid RELEASE_TYPE');

// TODO: if releaseType is `auto` determine release type based on the changelog

const lastTag = (await exec('git describe --tags --match "n8n@*" --abbrev=0')).stdout.trim();
const packages = JSON.parse((await exec('pnpm ls -r --only-projects --json')).stdout);

const packageMap = {};
for (let { name, path, version, private: isPrivate, dependencies } of packages) {
if (isPrivate && path !== rootDir) continue;
if (path === rootDir) name = 'monorepo-root';

const isDirty = await exec(`git diff --quiet HEAD ${lastTag} -- ${path}`)
.then(() => false)
.catch((error) => true);

packageMap[name] = { path, isDirty, version };
}

assert.ok(packageMap['n8n'].isDirty, 'No changes found since the last release');

// Keep the monorepo version up to date with the released version
packageMap['monorepo-root'].version = packageMap['n8n'].version;

for (const packageName in packageMap) {
const { path, version, isDirty } = packageMap[packageName];
const packageFile = resolve(path, 'package.json');
const packageJson = JSON.parse(await readFile(packageFile, 'utf-8'));

packageJson.version = packageMap[packageName].nextVersion =
isDirty ||
Object.keys(packageJson.dependencies).some(
(dependencyName) => packageMap[dependencyName]?.isDirty,
)
? semver.inc(version, releaseType)
: version;

await writeFile(packageFile, JSON.stringify(packageJson, null, 2) + '\n');
}

console.log(packageMap['n8n'].nextVersion);
6 changes: 6 additions & 0 deletions .github/scripts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dependencies": {
"semver": "^7.3.8",
"conventional-changelog-cli": "^2.2.2"
}
}
11 changes: 6 additions & 5 deletions .github/workflows/check-documentation-urls.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Check Documentation URLs

on:
push:
tags:
- n8n@*
release:
types: [published]
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
build:
check-docs-urls:
runs-on: ubuntu-latest

timeout-minutes: 5
Expand All @@ -23,7 +24,7 @@ jobs:
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: pnpm install

- name: Build nodes-base
run: pnpm --filter n8n-workflow --filter=n8n-core --filter=n8n-nodes-base build
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- opened
- edited
- synchronize
branches:
- '**'
- '!release/*'

jobs:
check-pr-title:
Expand All @@ -15,8 +18,18 @@ jobs:
- name: Check out branch
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.2.4

- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Validate PR title
id: validate_pr_title
uses: ivov/validate-n8n-pull-request-title@v1
uses: n8n-io/validate-n8n-pull-request-title@v1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v3
Expand Down
117 changes: 101 additions & 16 deletions .github/workflows/ci-pull-requests.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,99 @@
name: Test Pull Requests
name: Build, unit/smoke test and lint branch

on: [pull_request]

jobs:
build:
install:
name: Install & Build
runs-on: ubuntu-latest

timeout-minutes: 30

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
with:
repository: n8n-io/n8n
ref: ${{ inputs.branch }}

- uses: pnpm/action-setup@v2.2.4

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
node-version: 16.x
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Cache build artifacts
uses: actions/cache@v3
with:
path: |
/github/home/.cache
/github/home/.pnpm-store
./node_modules
./packages
key: ${{ github.sha }}-base:16.18.1-test-lint

unit-test:
name: Unit tests
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v3
with:
repository: n8n-io/n8n
ref: ${{ inputs.branch }}

- name: Restore cached build artifacts
uses: actions/cache@v3
with:
path: |
/github/home/.cache
/github/home/.pnpm-store
./node_modules
./packages
key: ${{ github.sha }}-base:16.18.1-test-lint

- uses: pnpm/action-setup@v2.2.4

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- name: Test
run: pnpm test

- name: Test E2E
run: |
pnpm cypress:install
pnpm test:e2e:smoke
lint:
name: Lint changes
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v3
with:
repository: n8n-io/n8n
ref: ${{ inputs.branch }}

- name: Restore cached build artifacts
uses: actions/cache@v3
with:
path: |
/github/home/.cache
/github/home/.pnpm-store
./node_modules
./packages
key: ${{ github.sha }}-base:16.18.1-test-lint

- uses: pnpm/action-setup@v2.2.4

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- name: Fetch base branch for `git diff`
run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
Expand All @@ -44,3 +102,30 @@ jobs:
env:
ESLINT_PLUGIN_DIFF_COMMIT: ${{ github.event.pull_request.base.ref }}
run: pnpm lint

smoke-test:
name: E2E [Electron/Node 16]
uses: ./.github/workflows/e2e-reusable.yml
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-e2e') }}
with:
branch: ${{ github.event.pull_request.head.ref }}
user: ${{ github.event.inputs.user || 'PR User' }}
spec: ${{ github.event.inputs.spec || 'e2e/0-smoke.cy.ts' }}
run-env: base:16.18.1
record: false
parallel: false
containers: '[1]'
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

checklist_job:
runs-on: ubuntu-latest
name: Checklist job
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Checklist
uses: wyozi/contextual-qa-checklist-action@master
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
comment-footer: Make sure to check off this list before asking for review.
3 changes: 2 additions & 1 deletion .github/workflows/docker-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: ./docker/images/n8n-base
build-args: |
NODE_VERSION=${{github.event.inputs.node_version}}
platforms: linux/amd64,linux/arm64,linux/arm/v7
provenance: false
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/base:${{ github.event.inputs.node_version }}
3 changes: 2 additions & 1 deletion .github/workflows/docker-images-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ jobs:
shell: bash

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/images/n8n-custom/Dockerfile
platforms: linux/amd64
provenance: false
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/n8n:${{ github.event.inputs.tag || 'nightly' }}
no-cache: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Docker Image CI

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

jobs:
build:
Expand Down Expand Up @@ -40,12 +39,13 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: ./docker/images/n8n${{ matrix.docker-context }}
build-args: |
N8N_VERSION=${{ steps.vars.outputs.tag }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
provenance: false
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/n8n:${{ steps.vars.outputs.tag }}${{ matrix.docker-context }}
Expand Down
Loading

0 comments on commit 8e2a475

Please sign in to comment.