Skip to content

Commit

Permalink
sync master
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoE105 committed Aug 26, 2024
2 parents 5e0c2a1 + f712812 commit 22a9171
Show file tree
Hide file tree
Showing 360 changed files with 13,445 additions and 12,338 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark-destroy-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
environment: benchmark
environment: benchmarking

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-images-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- main
- master
paths:
- 'packages/@n8n/benchmark/**'
- 'pnpm-lock.yaml'
Expand Down
23 changes: 16 additions & 7 deletions packages/@n8n/benchmark/scripts/runInCloud.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,22 @@ async function runBenchmarksOnVm(config, benchmarkEnv) {

console.log('Running benchmarks...');
const runScriptPath = path.join(scriptsDir, 'runOnVm.mjs');
await sshClient.ssh(
`npx zx ${runScriptPath} --n8nDockerTag=${config.n8nTag} --benchmarkDockerTag=${config.benchmarkTag} ${config.n8nSetupToUse}`,
{
// Test run should always log its output
verbose: true,
},
);

const flags = {
n8nDockerTag: config.n8nTag,
benchmarkDockerTag: config.benchmarkTag,
k6ApiToken: config.k6ApiToken,
};

const flagsString = Object.entries(flags)
.filter(([, value]) => value !== undefined)
.map(([key, value]) => `--${key}=${value}`)
.join(' ');

await sshClient.ssh(`npx zx ${runScriptPath} ${flagsString} ${config.n8nSetupToUse}`, {
// Test run should always log its output
verbose: true,
});
}

async function ensureVmIsReachable(sshClient) {
Expand Down
6 changes: 6 additions & 0 deletions packages/@n8n_io/eslint-config/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ module.exports = {
useAttrs: 'attrs',
},
],
'vue/block-order': [
'error',
{
order: ['script', 'template', 'style'],
},
],

// TODO: fix these
'@typescript-eslint/no-unsafe-call': 'off',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import type { WorkflowRepository } from '@db/repositories/workflow.repository';
import type { ExternalHooks } from './external-hooks';
import type { LICENSE_FEATURES, LICENSE_QUOTAS } from './constants';
import type { WorkflowWithSharingsAndCredentials } from './workflows/workflows.types';
import type { RunningJobSummary } from './scaling/types';
import type { RunningJobSummary } from './scaling/scaling.types';
import type { Scope } from '@n8n/permissions';

export interface ICredentialsTypeData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { Container } from 'typedi';
import type { StatusResult } from 'simple-git';
import type { PublicSourceControlRequest } from '../../../types';
import { globalScope } from '../../shared/middlewares/global.middleware';
import type { ImportResult } from '@/environments/sourceControl/types/importResult';
import { SourceControlService } from '@/environments/sourceControl/sourceControl.service.ee';
import { SourceControlPreferencesService } from '@/environments/sourceControl/sourceControlPreferences.service.ee';
import type { ImportResult } from '@/environments/source-control/types/import-result';
import { SourceControlService } from '@/environments/source-control/source-control.service.ee';
import { SourceControlPreferencesService } from '@/environments/source-control/source-control-preferences.service.ee';
import {
getTrackingInformationFromPullResult,
isSourceControlLicensed,
} from '@/environments/sourceControl/sourceControlHelper.ee';
} from '@/environments/source-control/source-control-helper.ee';
import { EventService } from '@/events/event.service';

export = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { VariablesService } from '@/environments/variables/variables.service.ee';
import { mockInstance } from '@test/mocking';
import { MessageEventBus } from '@/eventbus/MessageEventBus/MessageEventBus';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
import { getBase } from '@/workflow-execute-additional-data';
import Container from 'typedi';
import { CredentialsHelper } from '@/credentials-helper';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ActiveExecutions } from '@/active-executions';
import { ActiveWorkflowManager } from '@/active-workflow-manager';
import { Server } from '@/server';
import { EDITOR_UI_DIST_DIR, LICENSE_FEATURES } from '@/constants';
import { MessageEventBus } from '@/eventbus/MessageEventBus/MessageEventBus';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
import { License } from '@/license';
import { OrchestrationService } from '@/services/orchestration.service';
import { OrchestrationHandlerMainService } from '@/services/orchestration/main/orchestration.handler.main.service';
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { N8N_VERSION, inTest } from '@/constants';
import type { ICredentialsOverwrite } from '@/Interfaces';
import { CredentialsOverwrites } from '@/credentials-overwrites';
import { rawBodyReader, bodyParser } from '@/middlewares';
import { MessageEventBus } from '@/eventbus/MessageEventBus/MessageEventBus';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
import type { RedisServicePubSubSubscriber } from '@/services/redis/RedisServicePubSubSubscriber';
import { EventMessageGeneric } from '@/eventbus/EventMessageClasses/EventMessageGeneric';
import { EventMessageGeneric } from '@/eventbus/event-message-classes/event-message-generic';
import { OrchestrationHandlerWorkerService } from '@/services/orchestration/worker/orchestration.handler.worker.service';
import { OrchestrationWorkerService } from '@/services/orchestration/worker/orchestration.worker.service';
import { ServiceUnavailableError } from '@/errors/response-errors/service-unavailable.error';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/controllers/e2e.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import config from '@/config';
import { SettingsRepository } from '@db/repositories/settings.repository';
import { UserRepository } from '@db/repositories/user.repository';
import { ActiveWorkflowManager } from '@/active-workflow-manager';
import { MessageEventBus } from '@/eventbus/MessageEventBus/MessageEventBus';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
import { License } from '@/license';
import { LICENSE_FEATURES, LICENSE_QUOTAS, UNLIMITED_LICENSE_QUOTA, inE2ETests } from '@/constants';
import { Patch, Post, RestController } from '@/decorators';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import mock from 'jest-mock-extended/lib/Mock';
import { SourceControlExportService } from '../sourceControlExport.service.ee';
import type { SourceControlledFile } from '../types/sourceControlledFile';
import { SourceControlExportService } from '../source-control-export.service.ee';
import type { SourceControlledFile } from '../types/source-controlled-file';
import { Cipher, type InstanceSettings } from 'n8n-core';
import { SharedCredentialsRepository } from '@/databases/repositories/sharedCredentials.repository';
import { mockInstance } from '@test/mocking';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mock } from 'jest-mock-extended';
import { SourceControlGitService } from '../sourceControlGit.service.ee';
import { SourceControlGitService } from '../source-control-git.service.ee';
import { simpleGit } from 'simple-git';

const MOCK_BRANCHES = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import {
getTrackingInformationFromPrePushResult,
getTrackingInformationFromPullResult,
sourceControlFoldersExistCheck,
} from '@/environments/sourceControl/sourceControlHelper.ee';
} from '@/environments/source-control/source-control-helper.ee';
import { License } from '@/license';
import { SourceControlPreferencesService } from '@/environments/sourceControl/sourceControlPreferences.service.ee';
import { SourceControlPreferencesService } from '@/environments/source-control/source-control-preferences.service.ee';
import { InstanceSettings } from 'n8n-core';
import path from 'path';
import {
SOURCE_CONTROL_SSH_FOLDER,
SOURCE_CONTROL_GIT_FOLDER,
} from '@/environments/sourceControl/constants';
} from '@/environments/source-control/constants';
import { constants as fsConstants, accessSync } from 'fs';
import type { SourceControlledFile } from '@/environments/sourceControl/types/sourceControlledFile';
import type { SourceControlPreferences } from '@/environments/sourceControl/types/sourceControlPreferences';
import type { SourceControlledFile } from '@/environments/source-control/types/source-controlled-file';
import type { SourceControlPreferences } from '@/environments/source-control/types/source-control-preferences';
import { mockInstance } from '@test/mocking';

const pushResult: SourceControlledFile[] = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SourceControlGitService } from '@/environments/sourceControl/sourceControlGit.service.ee';
import { SourceControlGitService } from '@/environments/source-control/source-control-git.service.ee';
import { mock } from 'jest-mock-extended';
import type { SourceControlPreferences } from '@/environments/sourceControl/types/sourceControlPreferences';
import type { SourceControlPreferences } from '@/environments/source-control/types/source-control-preferences';
import type { User } from '@/databases/entities/User';
import type { SimpleGit } from 'simple-git';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RequestHandler } from 'express';
import { Container } from 'typedi';
import { isSourceControlLicensed } from '../sourceControlHelper.ee';
import { SourceControlPreferencesService } from '../sourceControlPreferences.service.ee';
import { isSourceControlLicensed } from '../source-control-helper.ee';
import { SourceControlPreferencesService } from '../source-control-preferences.service.ee';

export const sourceControlLicensedAndEnabledMiddleware: RequestHandler = (_req, res, next) => {
const sourceControlPreferencesService = Container.get(SourceControlPreferencesService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ import { ApplicationError, type ICredentialDataDecryptedObject } from 'n8n-workf
import { writeFile as fsWriteFile, rm as fsRm } from 'fs/promises';
import { rmSync } from 'fs';
import { Credentials, InstanceSettings } from 'n8n-core';
import type { ExportableWorkflow } from './types/exportableWorkflow';
import type { ExportableCredential } from './types/exportableCredential';
import type { ExportResult } from './types/exportResult';
import type { ExportableWorkflow } from './types/exportable-workflow';
import type { ExportableCredential } from './types/exportable-credential';
import type { ExportResult } from './types/export-result';
import {
getCredentialExportPath,
getVariablesPath,
getWorkflowExportPath,
sourceControlFoldersExistCheck,
stringContainsExpression,
} from './sourceControlHelper.ee';
} from './source-control-helper.ee';
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import type { SourceControlledFile } from './types/sourceControlledFile';
import type { SourceControlledFile } from './types/source-controlled-file';
import { VariablesService } from '../variables/variables.service.ee';
import { TagRepository } from '@db/repositories/tag.repository';
import { WorkflowRepository } from '@db/repositories/workflow.repository';
import { Logger } from '@/logger';
import { SharedCredentialsRepository } from '@db/repositories/sharedCredentials.repository';
import { SharedWorkflowRepository } from '@db/repositories/sharedWorkflow.repository';
import { WorkflowTagMappingRepository } from '@db/repositories/workflowTagMapping.repository';
import type { ResourceOwner } from './types/resourceOwner';
import type { ResourceOwner } from './types/resource-owner';

@Service()
export class SourceControlExportService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ import type {
SimpleGitOptions,
StatusResult,
} from 'simple-git';
import type { SourceControlPreferences } from './types/sourceControlPreferences';
import type { SourceControlPreferences } from './types/source-control-preferences';
import {
SOURCE_CONTROL_DEFAULT_BRANCH,
SOURCE_CONTROL_DEFAULT_EMAIL,
SOURCE_CONTROL_DEFAULT_NAME,
SOURCE_CONTROL_ORIGIN,
} from './constants';
import { sourceControlFoldersExistCheck } from './sourceControlHelper.ee';
import { sourceControlFoldersExistCheck } from './source-control-helper.ee';
import type { User } from '@db/entities/User';
import { Logger } from '@/logger';
import { ApplicationError } from 'n8n-workflow';
import { OwnershipService } from '@/services/ownership.service';
import { SourceControlPreferencesService } from './sourceControlPreferences.service.ee';
import { SourceControlPreferencesService } from './source-control-preferences.service.ee';

@Service()
export class SourceControlGitService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Container } from 'typedi';
import { License } from '@/license';
import { generateKeyPairSync } from 'crypto';
import type { KeyPair } from './types/keyPair';
import type { KeyPair } from './types/key-pair';
import { constants as fsConstants, mkdirSync, accessSync } from 'fs';
import {
SOURCE_CONTROL_GIT_KEY_COMMENT,
SOURCE_CONTROL_TAGS_EXPORT_FILE,
SOURCE_CONTROL_VARIABLES_EXPORT_FILE,
} from './constants';
import type { SourceControlledFile } from './types/sourceControlledFile';
import type { SourceControlledFile } from './types/source-controlled-file';
import path from 'path';
import type { KeyPairType } from './types/keyPairType';
import type { KeyPairType } from './types/key-pair-type';
import { Logger } from '@/logger';

export function stringContainsExpression(testString: string): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ApplicationError, jsonParse, ErrorReporterProxy as ErrorReporter } from
import { readFile as fsReadFile } from 'fs/promises';
import { Credentials, InstanceSettings } from 'n8n-core';
import type { IWorkflowToImport } from '@/Interfaces';
import type { ExportableCredential } from './types/exportableCredential';
import type { ExportableCredential } from './types/exportable-credential';
import type { Variables } from '@db/entities/Variables';
import { SharedCredentials } from '@db/entities/SharedCredentials';
import type { WorkflowTagMapping } from '@db/entities/WorkflowTagMapping';
Expand All @@ -21,9 +21,9 @@ import { ActiveWorkflowManager } from '@/active-workflow-manager';
// eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import
import { In } from '@n8n/typeorm';
import { isUniqueConstraintError } from '@/response-helper';
import type { SourceControlWorkflowVersionId } from './types/sourceControlWorkflowVersionId';
import { getCredentialExportPath, getWorkflowExportPath } from './sourceControlHelper.ee';
import type { SourceControlledFile } from './types/sourceControlledFile';
import type { SourceControlWorkflowVersionId } from './types/source-control-workflow-version-id';
import { getCredentialExportPath, getWorkflowExportPath } from './source-control-helper.ee';
import type { SourceControlledFile } from './types/source-controlled-file';
import { VariablesService } from '../variables/variables.service.ee';
import { TagRepository } from '@db/repositories/tag.repository';
import { WorkflowRepository } from '@db/repositories/workflow.repository';
Expand All @@ -35,7 +35,7 @@ import { WorkflowTagMappingRepository } from '@db/repositories/workflowTagMappin
import { VariablesRepository } from '@db/repositories/variables.repository';
import { ProjectRepository } from '@/databases/repositories/project.repository';
import type { Project } from '@/databases/entities/Project';
import type { ResourceOwner } from './types/resourceOwner';
import type { ResourceOwner } from './types/resource-owner';
import { assertNever } from '@/utils';
import { UserRepository } from '@/databases/repositories/user.repository';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { writeFile, chmod, readFile } from 'node:fs/promises';
import Container, { Service } from 'typedi';
import { SourceControlPreferences } from './types/sourceControlPreferences';
import { SourceControlPreferences } from './types/source-control-preferences';
import type { ValidationError } from 'class-validator';
import { validate } from 'class-validator';
import { rm as fsRm } from 'fs/promises';
import { generateSshKeyPair, isSourceControlLicensed } from './sourceControlHelper.ee';
import { generateSshKeyPair, isSourceControlLicensed } from './source-control-helper.ee';
import { Cipher, InstanceSettings } from 'n8n-core';
import { ApplicationError, jsonParse } from 'n8n-workflow';
import {
Expand All @@ -14,7 +14,7 @@ import {
SOURCE_CONTROL_PREFERENCES_DB_KEY,
} from './constants';
import path from 'path';
import type { KeyPairType } from './types/keyPairType';
import type { KeyPairType } from './types/key-pair-type';
import config from '@/config';
import { Logger } from '@/logger';
import { SettingsRepository } from '@db/repositories/settings.repository';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import { Get, Post, Patch, RestController, GlobalScope } from '@/decorators';
import {
sourceControlLicensedMiddleware,
sourceControlLicensedAndEnabledMiddleware,
} from './middleware/sourceControlEnabledMiddleware.ee';
import { SourceControlService } from './sourceControl.service.ee';
} from './middleware/source-control-enabled-middleware.ee';
import { SourceControlService } from './source-control.service.ee';
import { SourceControlRequest } from './types/requests';
import { SourceControlPreferencesService } from './sourceControlPreferences.service.ee';
import type { SourceControlPreferences } from './types/sourceControlPreferences';
import type { SourceControlledFile } from './types/sourceControlledFile';
import { SourceControlPreferencesService } from './source-control-preferences.service.ee';
import type { SourceControlPreferences } from './types/source-control-preferences';
import type { SourceControlledFile } from './types/source-controlled-file';
import { SOURCE_CONTROL_DEFAULT_BRANCH } from './constants';
import type { ImportResult } from './types/importResult';
import type { ImportResult } from './types/import-result';
import { EventService } from '@/events/event.service';
import { getRepoType } from './sourceControlHelper.ee';
import { SourceControlGetStatus } from './types/sourceControlGetStatus';
import { getRepoType } from './source-control-helper.ee';
import { SourceControlGetStatus } from './types/source-control-get-status';
import { BadRequestError } from '@/errors/response-errors/bad-request.error';

@RestController('/source-control')
Expand Down
Loading

0 comments on commit 22a9171

Please sign in to comment.