Skip to content

Commit

Permalink
Merge branch 'master' into sql-editor-support-expressions
Browse files Browse the repository at this point in the history
* master:
  test(editor): Unit test Version control frontend components (#6408)
  fix: Fist name to First Name in certain nodes (no-changelog) (#6404)
  fix(core): Allow all executions to be stopped (#6386)
  fix(core): RMC boolean value fix (#6397)
  fix(editor): Remove root level tag selector from css module to avoid making it a global style (#6392)
  fix(Ldap Node): Add DN field to update operation (#6371)
  feat: New trigger PostgreSQL  (#5495)
  build: Update pnpm lock file (no-changelog) (#6395)
  fix(Date & Time Node): Reset responseData at end of loop (#6385)
  refactor(core): Google service account remove duplicated functions (no-changelog) (#6368)
  refactor(LoneScale List Node)!: Rename to LoneScale (#6337)
  fix(editor): Update version control setup CTA tooltip (#6393)
  ci: Fix build (no-changelog) (#6391)
  fix(editor): Add button to refresh branches (#6387)
  fix(editor): Add Set up version control CTA (#6356)
  fix(editor): Remove explicit parameter name scanning for code editors (#6390)
  ci: Fix build (no-changelog) (#6379)
  fix(editor): Adding branch color (#6380)
  refactor(editor): Remove user activation modal (no-changelog) (#6361)
  feat(editor): Change upgrade CTA on community editions (no-changelog) (#6317)
  • Loading branch information
MiloradFilipovic committed Jun 13, 2023
2 parents 9dabc41 + df62e7e commit bad65fb
Show file tree
Hide file tree
Showing 81 changed files with 1,271 additions and 1,466 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- uses: pnpm/action-setup@v2.2.4
with:
version: 8.1.0
version: 8.6.1

- uses: actions/setup-node@v3
with:
Expand Down
66 changes: 0 additions & 66 deletions cypress/e2e/22-user-activation-modal.cy.ts

This file was deleted.

90 changes: 0 additions & 90 deletions cypress/fixtures/Settings_user_activation_modal_enabled.json

This file was deleted.

2 changes: 0 additions & 2 deletions cypress/pages/modals/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export * from './credentials-modal';
export * from './message-box';
export * from './workflow-sharing-modal';
export * from './user-activation-survey-modal';

10 changes: 0 additions & 10 deletions cypress/pages/modals/user-activation-survey-modal.ts

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"homepage": "https://n8n.io",
"engines": {
"node": ">=16.9",
"pnpm": ">=8.1"
"pnpm": ">=8.6"
},
"packageManager": "pnpm@8.1.0",
"packageManager": "pnpm@8.6.1",
"scripts": {
"preinstall": "node scripts/block-npm-install.js",
"build": "turbo run build",
Expand Down
13 changes: 13 additions & 0 deletions packages/cli/BREAKING-CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This list shows all the versions which include breaking changes and how to upgra
### What changed?

Due to Node.js/OpenSSL upgrade, the following crypto algorithms are not supported anymore.

- RSA-MD4
- RSA-MDC2
- md4
Expand All @@ -18,6 +19,18 @@ Due to Node.js/OpenSSL upgrade, the following crypto algorithms are not supporte

If you're using any of the above mentioned crypto algorithms in Crypto node in any of your workflows, then please update the algorithm property in the node to one of the supported values.

### What changed?

The `LoneScale List` node has been renamed to `LoneScale`.

### When is action necessary?

If you have used the `LoneScale List` node in any of your workflows.

### How to upgrade:

Update any workflows using `LoneScale List` to use the updated node.

## 0.226.0

### What changed?
Expand Down
4 changes: 1 addition & 3 deletions packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,6 @@ export class Server extends AbstractServer {
},
personalizationSurveyEnabled:
config.getEnv('personalization.enabled') && config.getEnv('diagnostics.enabled'),
userActivationSurveyEnabled:
config.getEnv('userActivationSurvey.enabled') && config.getEnv('diagnostics.enabled'),
defaultLocale: config.getEnv('defaultLocale'),
userManagement: {
enabled: isUserManagementEnabled(),
Expand Down Expand Up @@ -1248,7 +1246,7 @@ export class Server extends AbstractServer {
throw new ResponseHelper.NotFoundError('Execution not found');
}

const execution = await Db.collections.Execution.findOne({
const execution = await Db.collections.Execution.exist({
where: {
id: executionId,
workflowId: In(sharedWorkflowIds),
Expand Down
25 changes: 22 additions & 3 deletions packages/cli/src/WaitTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ import * as Db from '@/Db';
import * as ResponseHelper from '@/ResponseHelper';
import type {
IExecutionFlattedDb,
IExecutionResponse,
IExecutionsStopData,
IWorkflowExecutionDataProcess,
} from '@/Interfaces';
import { WorkflowRunner } from '@/WorkflowRunner';
import { getWorkflowOwner } from '@/UserManagement/UserManagementHelper';
import { recoverExecutionDataFromEventLogMessages } from './eventbus/MessageEventBus/recoverEvents';

@Service()
export class WaitTracker {
Expand Down Expand Up @@ -106,12 +108,29 @@ export class WaitTracker {
// Also check in database
const execution = await Db.collections.Execution.findOneBy({ id: executionId });

if (execution === null || !execution.waitTill) {
if (execution === null) {
throw new Error(`The execution ID "${executionId}" could not be found.`);
}

const fullExecutionData = ResponseHelper.unflattenExecutionData(execution);

if (!['new', 'unknown', 'waiting', 'running'].includes(execution.status)) {
throw new Error(
`Only running or waiting executions can be stopped and ${executionId} is currently ${execution.status}.`,
);
}
let fullExecutionData: IExecutionResponse;
try {
fullExecutionData = ResponseHelper.unflattenExecutionData(execution);
} catch (error) {
// if the execution ended in an unforseen, non-cancelable state, try to recover it
await recoverExecutionDataFromEventLogMessages(executionId, [], true);
// find recovered data
const recoveredExecution = await Db.collections.Execution.findOneBy({ id: executionId });
if (recoveredExecution) {
fullExecutionData = ResponseHelper.unflattenExecutionData(recoveredExecution);
} else {
throw new Error(`Execution ${executionId} could not be recovered or canceled.`);
}
}
// Set in execution in DB as failed and remove waitTill time
const error = new WorkflowOperationError('Workflow-Execution has been canceled!');

Expand Down
9 changes: 0 additions & 9 deletions packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1043,15 +1043,6 @@ export const schema = {
},
},

userActivationSurvey: {
enabled: {
doc: 'Whether user activation survey is enabled.',
format: Boolean,
default: true,
env: 'N8N_USER_ACTIVATION_SURVEY_ENABLED',
},
},

diagnostics: {
enabled: {
doc: 'Whether diagnostic mode is enabled.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ export class VersionControlPreferences {
): VersionControlPreferences {
return new VersionControlPreferences({
connected: preferences.connected ?? defaultPreferences.connected,
authorEmail: preferences.authorEmail ?? defaultPreferences.authorEmail,
repositoryUrl: preferences.repositoryUrl ?? defaultPreferences.repositoryUrl,
authorName: preferences.authorName ?? defaultPreferences.authorName,
authorEmail: preferences.authorEmail ?? defaultPreferences.authorEmail,
branchName: preferences.branchName ?? defaultPreferences.branchName,
branchColor: preferences.branchColor ?? defaultPreferences.branchColor,
branchReadOnly: preferences.branchReadOnly ?? defaultPreferences.branchReadOnly,
repositoryUrl: preferences.repositoryUrl ?? defaultPreferences.repositoryUrl,
branchColor: preferences.branchColor ?? defaultPreferences.branchColor,
});
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Authorized, Get, Post, RestController } from '@/decorators';
import { Authorized, Get, Post, Patch, RestController } from '@/decorators';
import {
versionControlLicensedMiddleware,
versionControlLicensedAndEnabledMiddleware,
Expand Down Expand Up @@ -83,10 +83,38 @@ export class VersionControlController {
}

@Authorized(['global', 'owner'])
@Post('/set-read-only', { middlewares: [versionControlLicensedMiddleware] })
async setReadOnly(req: VersionControlRequest.SetReadOnly) {
@Patch('/preferences', { middlewares: [versionControlLicensedMiddleware] })
async updatePreferences(req: VersionControlRequest.UpdatePreferences) {
try {
this.versionControlPreferencesService.setBranchReadOnly(req.body.branchReadOnly);
const sanitizedPreferences: Partial<VersionControlPreferences> = {
...req.body,
initRepo: false,
connected: undefined,
publicKey: undefined,
repositoryUrl: undefined,
authorName: undefined,
authorEmail: undefined,
};
const currentPreferences = this.versionControlPreferencesService.getPreferences();
await this.versionControlPreferencesService.validateVersionControlPreferences(
sanitizedPreferences,
);
if (
sanitizedPreferences.branchName &&
sanitizedPreferences.branchName !== currentPreferences.branchName
) {
await this.versionControlService.setBranch(sanitizedPreferences.branchName);
}
if (sanitizedPreferences.branchColor || sanitizedPreferences.branchReadOnly !== undefined) {
await this.versionControlPreferencesService.setPreferences(
{
branchColor: sanitizedPreferences.branchColor,
branchReadOnly: sanitizedPreferences.branchReadOnly,
},
true,
);
}
await this.versionControlService.init();
return this.versionControlPreferencesService.getPreferences();
} catch (error) {
throw new BadRequestError((error as { message: string }).message);
Expand All @@ -113,16 +141,6 @@ export class VersionControlController {
}
}

@Authorized(['global', 'owner'])
@Post('/set-branch', { middlewares: [versionControlLicensedMiddleware] })
async setBranch(req: VersionControlRequest.SetBranch) {
try {
return await this.versionControlService.setBranch(req.body.branch);
} catch (error) {
throw new BadRequestError((error as { message: string }).message);
}
}

@Authorized(['global', 'owner'])
@Post('/push-workfolder', { middlewares: [versionControlLicensedAndEnabledMiddleware] })
async pushWorkfolder(
Expand Down
Loading

0 comments on commit bad65fb

Please sign in to comment.