You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[task] Extract sanitizeWorkflowName to dedicated helper file #3134
Extract the sanitizeWorkflowName function from pkg/workflow/js/parse_firewall_logs.cjs to its own dedicated helper file.
Context
The sanitizeWorkflowName function in parse_firewall_logs.cjs is a utility that could be reused. Following the pattern of "1 javascript helper per file so that they can be imported one by one", this should be extracted to its own module. Part of issue #3119.
Approach
Create new file: pkg/workflow/js/sanitize_workflow_name.cjs
Move the sanitizeWorkflowName function to the new file
Export the function as a CommonJS module: module.exports = { sanitizeWorkflowName };
Update pkg/workflow/js/parse_firewall_logs.cjs to import: const { sanitizeWorkflowName } = require('./sanitize_workflow_name.cjs');
Remove the function definition from parse_firewall_logs.cjs
Files to Modify
Create: pkg/workflow/js/sanitize_workflow_name.cjs (new helper file)
Update: pkg/workflow/js/parse_firewall_logs.cjs (import and remove definition)
Acceptance Criteria
New helper file sanitize_workflow_name.cjs contains the function
Function is properly exported as CommonJS module
parse_firewall_logs.cjs imports from the new helper
Function definition removed from parse_firewall_logs.cjs
Activity