-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
refactor: Use NodeConnectionType
consistently across the code base (no-changelog)
#10595
Conversation
NodeConnectionType
consistently across code base (no-changelog)
n8n Run #6665
Run Properties:
|
Project |
n8n
|
Branch Review |
refactor-types-NodeConnectionType
|
Run status |
Passed #6665
|
Run duration | 04m 48s |
Commit |
93a6afacd5: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 RicardoE105 🗃️ e2e/*
|
Committer | Ricardo Espinoza |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
421
|
View all changes introduced in this branch ↗︎ |
NodeConnectionType
consistently across code base (no-changelog)NodeConnectionType
consistently the across code base (no-changelog)
@@ -155,6 +155,7 @@ export class MemoryRedisChat implements INodeType { | |||
|
|||
const memory = new memClass({ | |||
memoryKey: 'chat_history', | |||
//@ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only ts-ignore I had to add. Very weird because I did not touch anything related to this. Wondering if @lanchain/core updated its types 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be related to the changes in pnpm-lock.yaml
? I guess it shouldn't have changed since there are no package.json
changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this was the case! Updated the pnpm-lock.yaml to have we have in master and it seems to have fixed the type issue 🙏
6e9da19
to
045512d
Compare
NodeConnectionType
consistently the across code base (no-changelog)NodeConnectionType
consistentlt across the code base (no-changelog)
NodeConnectionType
consistentlt across the code base (no-changelog)NodeConnectionType
consistently across the code base (no-changelog)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this improvement ❤️ Certainly wasn't a small feat. Mostly looking great 👌 Couple questions and also we shouldn't remove more specific types, or was there a reason for doing that?
@@ -155,6 +155,7 @@ export class MemoryRedisChat implements INodeType { | |||
|
|||
const memory = new memClass({ | |||
memoryKey: 'chat_history', | |||
//@ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be related to the changes in pnpm-lock.yaml
? I guess it shouldn't have changed since there are no package.json
changes?
@@ -66,13 +66,13 @@ module.exports = { | |||
'n8n-nodes-base/node-class-description-display-name-unsuffixed-trigger-node': 'error', | |||
'n8n-nodes-base/node-class-description-empty-string': 'error', | |||
'n8n-nodes-base/node-class-description-icon-not-svg': 'error', | |||
'n8n-nodes-base/node-class-description-inputs-wrong-regular-node': 'error', | |||
'n8n-nodes-base/node-class-description-inputs-wrong-regular-node': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these two turned off?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rules check if the output or input properties are and array of string with valid values. With the enum they do not work, we need to update the rule or get rid of it altogether! Will double check with Ivan as he created this rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synced with Ivan and suggested to leave them off until we update the rules validate the enums instead of an array of strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, can you create a follow-up for that so we don't forget 🙏
packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
✅ All Cypress E2E specs passed |
* master: (21 commits) feat: Add queue mode setup to benchmarks (no-changelog) (#10608) feat: Add n8n postgres setup to benchmarks (no-changelog) (#10604) fix(API): Update express-openapi-validator to resolve AIKIDO-2024-10229 (#10612) fix: Fix edge case in log in (no-changelog) (#10610) feat: Add local orchestration of benchmarks (no-changelog) (#10589) ci: Run nightly benchmark against nightly n8n image (no-changelog) (#10588) fix: Reduce variability in benchmarks (no-changelog) (#10606) docs: Add missing changelog entry (#10609) refactor(editor): Convert ResourceLocator to composition API (no-changelog) (#10526) feat(editor): Update new canvas node handle label rendering mechanism and design (no-changelog) (#10611) refactor(editor): Convert credential related components to composition API (no-changelog) (#10530) fix(HTTP Request Node): Sanitize authorization headers (#10607) refactor: Use `NodeConnectionType` consistently across the code base (no-changelog) (#10595) fix(editor): Hide execution buttons in readonly mode in new canvas (no-changelog) (#10603) fix(editor): Prevent keyboard shortcuts when ndv is open in new canvas (no-changelog) (#10601) fix(editor): Add confirmation toast when changing user role (#10592) feat(editor): Add support for changing sticky notes color in new canvas (no-changelog) (#10593) ci: Fix `forceConsistentCasingInFileNames` for aliased paths (no-changelog) (#10598) feat(editor): Allow sticky notes alongside fallback nodes in new canvas (no-changelog) (#10583) ci: Push nightly images to ghcr (no-changelog) (#10580) ...
Got released with |
eslint-plugin-n8n-nodes-base is not happy with NodeConnectionType.Main
if I put ['main'] then I am not sure how the community node developers are keeping up with you guys. :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint-plugin-n8n-nodes-base is not happy with NodeConnectionType.Main
30:3 error Replace with "['main']" [autofixable] n8n-nodes-base/node-class-description-outputs-wrong
if I put ['main'] then
INodeTypeDescription
yells at me.I am not sure how the community node developers are keeping up with you guys. :(
This caused TypeScript and ESLint errors for existing users of n8n-workflow
package:
@Juneezee apologies for the harm this caused. Us not realizing this is a breaking change for the |
@tomi Thanks for your reply. This fixes the TypeScript error, but the ESLint error still remain. The ESLint rule from this plugin https://github.com/ivov/eslint-plugin-n8n-nodes-base needs to be updated. See |
Summary
I was moving the
NodeSettings.vue
file #10545 to use the composition API and trying to fix one small type issue snowball into a lot of type issues because we have two types in the FE that represent the same. One is an enum, and the other is a type union that we use in the editor-ui, workflow, and nodes-base, and they do not match (a known problem with enums). So, to avoid this, I deleted theConnectionType
type and used theNodeConnectionType
enum everywhere.ALL unit, integration and e2e tests pass.
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)