-
Notifications
You must be signed in to change notification settings - Fork 42.1k
fix( Switch Node): Disable expressions for Number of Outputs in v3.3 #19075
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
base: master
Are you sure you want to change the base?
fix( Switch Node): Disable expressions for Number of Outputs in v3.3 #19075
Conversation
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.
1 issue found across 3 files
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
|
||
describe('Version-specific behavior', () => { | ||
it('should have two numberOutputs parameters with different version conditions', () => { | ||
const baseDescription: INodeTypeBaseDescription = { |
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.
Duplicate baseDescription setup across tests; define it once in the describe scope to reduce repetition and ease maintenance.
Prompt for AI agents
Address the following comment on packages/nodes-base/nodes/Switch/V3/test/switch.node.test.ts at line 11:
<comment>Duplicate baseDescription setup across tests; define it once in the describe scope to reduce repetition and ease maintenance.</comment>
<file context>
@@ -1,5 +1,72 @@
+
+ describe('Version-specific behavior', () => {
+ it('should have two numberOutputs parameters with different version conditions', () => {
+ const baseDescription: INodeTypeBaseDescription = {
+ displayName: 'Switch',
+ name: 'n8n-nodes-base.switch',
</file context>
@claude review |
Claude finished @ShireenMissi's task —— View job Code Review Complete ✅Todo List:
Review SummaryThis PR successfully addresses the Switch Node expression mode visibility issue by implementing version 3.3 with ✅ Positive Aspects
🔧 Issues Found1. Test Code Duplication (Medium Priority)Location: packages/nodes-base/nodes/Switch/V3/test/switch.node.test.ts:11-16, 27-32, 43-49, 61-66 The Recommendation: describe('Version-specific behavior', () => {
const baseDescription: INodeTypeBaseDescription = {
displayName: 'Switch',
name: 'n8n-nodes-base.switch',
group: ['transform'],
description: 'Route items to different outputs',
};
it('should have two numberOutputs parameters with different version conditions', () => {
const switchNode = new SwitchV3(baseDescription);
// rest of test...
});
// other tests...
}); 2. Minor Documentation GapThe parameter descriptions (lines 95, 108) are identical but could clarify the version-specific behavior difference. 🔍 Technical AnalysisVersion Handling ✅
Implementation Pattern ✅
Test Quality ✅
🎯 Final RecommendationAPPROVE with minor refactoring suggestion. The PR effectively solves the reported issue and maintains excellent backward compatibility. The test duplication is a code quality improvement opportunity but doesn't block the fix. 💡 Suggested Follow-ups
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Updates Switch node to version 3.3 with noDataExpression: true for the "Number of Outputs" parameter to prevent
expression input while maintaining backward compatibility for earlier versions.
Changes:
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/NODE-3568/community-issue-switch-node-in-expression-mode-outputs-not-visible-in
Closes #18860
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)