Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Allow all executions to be stopped #6386

Merged

Conversation

flipswitchingmonkey
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Great PR! Please pay attention to the following items before merging:

Files matching packages/**:

  • If fixing bug, added test to cover scenario.
  • If addressing forum or Github issue, added link to description.

Files matching packages/**/*.ts:

  • Added unit tests to cover new or updated functionality.

Files matching packages/editor-ui/src/mixins/**:

  • Avoided adding new mixins (use composables instead). Only removed code from here.

Make sure to check off this list before asking for review.

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.08 ⚠️

Comparison is base (e95e8de) 28.33% compared to head (570dfba) 28.26%.

❗ Current head 570dfba differs from pull request most recent head f890ecc. Consider uploading reports for the commit f890ecc to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6386      +/-   ##
==========================================
- Coverage   28.33%   28.26%   -0.08%     
==========================================
  Files        2980     2980              
  Lines      184944   184944              
  Branches    20303    20300       -3     
==========================================
- Hits        52401    52270     -131     
- Misses     131756   131887     +131     
  Partials      787      787              
Impacted Files Coverage Δ
packages/cli/src/WaitTracker.ts 0.00% <0.00%> (ø)
packages/editor-ui/src/mixins/executionsHelpers.ts 38.55% <0.00%> (ø)

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jun 6, 2023
@flipswitchingmonkey flipswitchingmonkey marked this pull request as ready for review June 6, 2023 10:30
@@ -1246,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({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest changing only this file.

Instead of making this change here revert the change to be findOne instead of exists.

Then, below, after the check for queue mode where we do const result = await this.activeExecutionsInstance.stopExecution(executionId); we can then have a check such as:

const result = await this.activeExecutionsInstance.stopExecution(executionId);
				let returnData: IExecutionsStopData;
				if (result === undefined) {
					if (['running', 'new'].includes(execution.status)) {
            // Do the stop procedure here as it's an execution that's not currently running but it's marked as running in DB
					} else {
					  // If active execution could not be found check if it is a waiting one
					  returnData = await this.waitTracker.stopExecution(executionId);
					}
				} else {
					returnData = {
						mode: result.mode,
						startedAt: new Date(result.startedAt),
						stoppedAt: result.stoppedAt ? new Date(result.stoppedAt) : undefined,
						finished: result.finished,
						status: result.status,
					};
				}

@cypress
Copy link

cypress bot commented Jun 8, 2023

Passing run #1146 ↗︎

0 227 0 0 Flakiness 0

Details:

🌳 pay-497-change-stop-execution-to-allow-forced-stop 🖥️ browsers:node18.12.0-c...
Project: n8n Commit: f890ecc9b1
Status: Passed Duration: 07:02 💡
Started: Jun 8, 2023 7:10 AM Ended: Jun 8, 2023 7:17 AM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2023

✅ All Cypress E2E specs passed

@flipswitchingmonkey flipswitchingmonkey merged commit cc44af9 into master Jun 8, 2023
@flipswitchingmonkey flipswitchingmonkey deleted the pay-497-change-stop-execution-to-allow-forced-stop branch June 8, 2023 07:18
MiloradFilipovic added a commit that referenced this pull request Jun 13, 2023
* 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)
netroy pushed a commit that referenced this pull request Jun 14, 2023
* allow all executions to be stopped and fix display issue

* limit cancelation and add recover for unknown states
@janober
Copy link
Member

janober commented Jun 14, 2023

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants