-
Notifications
You must be signed in to change notification settings - Fork 0
Add label support to workflow-launch node #34
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: main
Are you sure you want to change the base?
Conversation
Adds ability to specify comma-separated label names when launching workflows. Labels are automatically created if they don't exist in the workspace, following the same approach as tower-cli. The node resolves label names to IDs and includes them in the launch request. - Add labels field to workflow-launch node UI - Implement label name resolution and auto-creation - Support labels for both regular and resume workflows - Use workspaceId as query parameter per tower-cli implementation - Convert label IDs to strings as required by API - Add comprehensive error handling for label operations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
🐳 Docker PR Build
|
ewels
left a comment
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.
Great stuff!
Had a read through of the code, generally looks great - just a few minor comments.
Address PR #34 review feedback by refactoring label resolution logic: - Extract duplicate code into resolveLabelIds helper function - Add case-insensitive label handling (normalize to lowercase) - Change from warnings to errors for fail-fast behavior on label failures - Fix error handling to pass msg parameter for proper Node-RED context - Use search parameter in API calls to avoid pagination issues - Remove redundant header specifications (handled by apiCall utility) This improves code maintainability, scalability, and error handling while ensuring labels with different casing are treated as the same label. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Consolidate label resolution to single location after both regular launch and resume workflow paths have set up body.launch. Both code paths ultimately populate body.launch, so labels can be applied once instead of duplicating the logic in two places. Fix permission requirements in error messages and documentation: - Change from incorrect "label:write" permission to "Maintain role or higher" - Workspace labels (used by this node) can be created by Maintain role - Resource labels (for cost tracking) require Admin/Owner roles This reduces code duplication and provides accurate guidance to users about required token permissions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
ewels
left a comment
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.
Code LGTM. Haven't tested it myself but if it's working for you then I'm happy.
Could you please ask @claude to add some unit tests (we have those now), then should be good to merge 👍🏻
Thanks!
Adds 8 new test cases for workflow-launch node labels feature: - Label resolution and ID mapping for existing labels - Automatic label creation when labels don't exist - Permission error handling (403) with helpful error messages - Case-insensitive label matching - Whitespace trimming in comma-separated labels - Empty label handling - Integration with resume workflow functionality - Dynamic labels from message properties (typedInput) Also adds helper factories (createLabelsResponse, createLabelResponse) to test/helper.js for mocking Seqera API label endpoints. All 173 tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Adds ability to specify comma-separated label names when launching workflows. Labels are automatically created if they don't exist in the workspace, following the same approach as tower-cli. The node resolves label names to IDs and includes them in the launch request.
🤖 Generated with Claude Code