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

feat(core): Add commands to workers to respond with current state #7029

Conversation

flipswitchingmonkey
Copy link
Contributor

This PR adds new endpoints to the REST API: /orchestration/worker/status and /orchestration/worker/id

Currently these just trigger the return of status / ids from the workers via the redis back channel, this still needs to be handled and passed through to the frontend.

It also adds the eventbus to each worker, and triggers a reload of those eventbus instances when the configuration changes on the main instances.

@github-actions
Copy link
Contributor

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.

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

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Aug 28, 2023
@flipswitchingmonkey flipswitchingmonkey marked this pull request as ready for review August 28, 2023 10:36
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch coverage: 35.95% and project coverage change: +0.04% 🎉

Comparison is base (cc37a50) 31.90% compared to head (4ebb646) 31.94%.
Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7029      +/-   ##
==========================================
+ Coverage   31.90%   31.94%   +0.04%     
==========================================
  Files        3268     3271       +3     
  Lines      197657   197796     +139     
  Branches    21528    21551      +23     
==========================================
+ Hits        63058    63195     +137     
+ Misses     133561   133558       -3     
- Partials     1038     1043       +5     
Files Changed Coverage Δ
packages/cli/src/Server.ts 0.00% <0.00%> (ø)
packages/cli/src/commands/BaseCommand.ts 47.05% <0.00%> (+2.35%) ⬆️
...es/cli/src/controllers/orchestration.controller.ts 0.00% <0.00%> (ø)
packages/cli/src/requests.ts 100.00% <ø> (ø)
packages/cli/src/commands/workerCommandHandler.ts 20.68% <20.68%> (ø)
packages/cli/src/commands/worker.ts 24.87% <21.12%> (+24.87%) ⬆️
...li/src/eventbus/MessageEventBus/MessageEventBus.ts 45.64% <23.07%> (-2.17%) ⬇️
packages/cli/src/services/orchestration.service.ts 65.38% <65.38%> (ø)
packages/cli/src/AbstractServer.ts 48.57% <66.66%> (+5.37%) ⬆️
...ages/cli/src/eventbus/EventMessageClasses/index.ts 100.00% <100.00%> (ø)
... and 1 more

... and 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…-with-current-state

# Conflicts:
#	packages/cli/src/eventbus/eventBus.controller.ts
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 tested and working.

@cypress
Copy link

cypress bot commented Sep 7, 2023

1 flaky test on run #2133 ↗︎

0 238 0 0 Flakiness 1

Details:

🌳 pay-754-add-commands-to-workers-to-respond-with-current-state 🖥️ browsers:no...
Project: n8n Commit: 4ebb646f82
Status: Passed Duration: 07:14 💡
Started: Sep 7, 2023 12:36 PM Ended: Sep 7, 2023 12:43 PM
Flakiness  cypress/e2e/14-mapping.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Data mapping > shows you can drop to inputs, including booleans Output Screenshots Video

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 Sep 7, 2023

✅ All Cypress E2E specs passed

@flipswitchingmonkey flipswitchingmonkey merged commit 7b49cf2 into master Sep 7, 2023
50 of 51 checks passed
@flipswitchingmonkey flipswitchingmonkey deleted the pay-754-add-commands-to-workers-to-respond-with-current-state branch September 7, 2023 12:44
@github-actions github-actions bot mentioned this pull request Sep 13, 2023
netroy added a commit that referenced this pull request Sep 13, 2023
# [1.7.0](https://github.com/n8n-io/n8n/compare/n8n@1.6.0...n8n@1.7.0)
(2023-09-13)


### Bug Fixes

* **Code Node:** Disable WASM to address CVE-2023-37903
([#7122](#7122))
([36a8e91](36a8e91))
* **Code Node:** Upgrade vm2 to address CVE-2023-37466
([#7123](#7123))
([0a35025](0a35025))
* **core:** Disable Node.js custom inspection to address CVE-2023-37903
([#7125](#7125))
([a223734](a223734)),
closes [#7122](#7122)
* **editor** Account for nanoid workflow ids for subworkflow execute
policy ([#7094](#7094))
([67092c0](67092c0))
* **editor:** Unbind workflow endpoint events in case of workspace reset
([#7129](#7129))
([c9b7948](c9b7948))
* **editor:** Update git repo url validation regex
([#7151](#7151))
([e51f173](e51f173))
* **Google Cloud Firestore Node:** Fix empty string interpreted as
number ([#7136](#7136))
([915cfa0](915cfa0))
* **HubSpot Node:** Fix issue with contact lists not working
([#5582](#5582))
([6e5a4f6](6e5a4f6))
* **Postgres Node:** Fix automatic column mapping
([#7121](#7121))
([92af131](92af131))
* **Zoho CRM Node:** Fix issue with Sales Order not updating
([#6959](#6959))
([fd800b6](fd800b6))


### Features

* **core:** Add an option to enable WAL mode for SQLite
([#7118](#7118))
([1d1a022](1d1a022))
* **core:** Add commands to workers to respond with current state
([#7029](#7029))
([7b49cf2](7b49cf2))
* **Salesforce Node:** Add fax field to lead option
([#7030](#7030))
([01f875a](01f875a))

Co-authored-by: netroy <netroy@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Sep 13, 2023
netroy added a commit that referenced this pull request Sep 13, 2023
# [1.7.0](https://github.com/n8n-io/n8n/compare/n8n@1.6.0...n8n@1.7.0)
(2023-09-13)


### Bug Fixes

* **Code Node:** Disable WASM to address CVE-2023-37903
([#7122](#7122))
([36a8e91](36a8e91))
* **Code Node:** Upgrade vm2 to address CVE-2023-37466
([#7123](#7123))
([0a35025](0a35025))
* **core:** Disable Node.js custom inspection to address CVE-2023-37903
([#7125](#7125))
([a223734](a223734))
* **editor** Account for nanoid workflow ids for subworkflow execute
policy ([#7094](#7094))
([67092c0](67092c0))
* **editor:** Tweak hover area of workflow / cred cards
([#7108](#7108))
([217de21](217de21))
* **editor:** Unbind workflow endpoint events in case of workspace reset
([#7129](#7129))
([c9b7948](c9b7948))
* **editor:** Update git repo url validation regex
([#7151](#7151))
([e51f173](e51f173))
* **Google Cloud Firestore Node:** Fix empty string interpreted as
number ([#7136](#7136))
([915cfa0](915cfa0))
* **HubSpot Node:** Fix issue with contact lists not working
([#5582](#5582))
([6e5a4f6](6e5a4f6))
* **Postgres Node:** Fix automatic column mapping
([#7121](#7121))
([92af131](92af131))
* **Zoho CRM Node:** Fix issue with Sales Order not updating
([#6959](#6959))
([fd800b6](fd800b6))


### Features

* **core:** Add an option to enable WAL mode for SQLite
([#7118](#7118))
([1d1a022](1d1a022))
* **core:** Add commands to workers to respond with current state
([#7029](#7029))
([7b49cf2](7b49cf2))
* **Salesforce Node:** Add fax field to lead option
([#7030](#7030))
([01f875a](01f875a))

Co-authored-by: netroy <netroy@users.noreply.github.com>
@janober
Copy link
Member

janober commented Sep 14, 2023

Got released with n8n@1.7.1

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.

3 participants