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): Fix update workflow cli command being unable to activate all workflows #8412

Merged
merged 5 commits into from
Jan 23, 2024

Conversation

despairblue
Copy link
Contributor

@despairblue despairblue commented Jan 22, 2024

Summary

This work is based on #6759, thank you @schroedan for tackling this ❤️

Before this change activating all workflows led to all workflows being deactivated instead:
image
image
image

Now it actually activates them:
image
image

This also adds WorkflowRepository#activateAll and a test for it, as well as a test for WorkflowRepository#deactivateAll

Related tickets and issues

https://linear.app/n8n/issue/PAY-1206/cli-activating-workflows-fails
https://community.n8n.io/t/setting-all-workflows-to-active-not-working/34901
#4753
#6759

Review / Merge checklist

  • PR title and summary are descriptive. Remember, the title automatically goes into the changelog. Use (no-changelog) otherwise. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.

    A bug is not considered fixed, unless a test is added to prevent it from happening again.
    A feature is not complete without tests.

@despairblue despairblue changed the title N8N 3763 fix update workflow command fix(core) fix update workflow cli command being unable to activate all workflows Jan 22, 2024
@despairblue despairblue changed the title fix(core) fix update workflow cli command being unable to activate all workflows fix(core) Fix update workflow cli command being unable to activate all workflows Jan 22, 2024
@despairblue despairblue changed the title fix(core) Fix update workflow cli command being unable to activate all workflows fix(core): Fix update workflow cli command being unable to activate all workflows Jan 22, 2024
@despairblue despairblue force-pushed the N8N-3763-fix-update-workflow-command branch from 6d5b495 to 6173a03 Compare January 22, 2024 17:22
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Jan 22, 2024
@despairblue despairblue marked this pull request as ready for review January 22, 2024 17:38
await Container.get(WorkflowRepository).deactivateAll();
this.logger.info(`${action} all workflows`);
if (newState) {
// TODO: Maybe there should be an `updateActiveStateForAll(state)`?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wondering if that makes sense? What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the existing deactivateAll is only used here, it's fine if we rename it and make it more generic so we can just use a single flag, but either work. The current naming is also very explicit and clear in what it does.

@despairblue despairblue marked this pull request as draft January 23, 2024 08:46
@despairblue despairblue force-pushed the N8N-3763-fix-update-workflow-command branch from 6173a03 to 86e9b97 Compare January 23, 2024 09:08
@despairblue despairblue marked this pull request as ready for review January 23, 2024 09:25
can be changed later
krynble
krynble previously approved these changes Jan 23, 2024
Copy link
Contributor

@krynble krynble left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

cypress bot commented Jan 23, 2024

2 flaky tests on run #3872 ↗︎

0 338 5 0 Flakiness 2

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 despairblue 🗃️ e2e/*
Project: n8n Commit: 276d097558
Status: Passed Duration: 03:29 💡
Started: Jan 23, 2024 9:51 AM Ended: Jan 23, 2024 9:54 AM
Flakiness  5-ndv.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > should not retrieve remote options when required params throw errors Test Replay Screenshots Video
Flakiness  24-ndv-paired-item.cy.ts • 1 flaky test

View Output Video

Test Artifacts
NDV > resolves expression with default item when input node is not parent, while still pairing items Test Replay Screenshots Video

Review all test suite changes for PR #8412 ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@despairblue despairblue merged commit ae06fde into master Jan 23, 2024
32 checks passed
@despairblue despairblue deleted the N8N-3763-fix-update-workflow-command branch January 23, 2024 09:59
@github-actions github-actions bot mentioned this pull request Jan 24, 2024
@janober
Copy link
Member

janober commented Jan 24, 2024

Got released with n8n@1.26.0

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants