-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
Description
Objective
Convert the most complex safe output handler (create_issue.cjs) to use the factory pattern.
Context
This is Phase 3 of the safe output manager refactoring (#8098). This is the most complex handler with 355 lines and handles sub-issue linking, cross-repository support, and parent-child relationships.
Dependencies
- Requires: #aw_phase2_medium to be completed
Target Branch
sot (safe output transition)
Handler to Refactor
actions/setup/js/create_issue.cjs (355 lines)
Complex Features to Preserve
- Sub-issue linking logic - Parent-child issue relationships
- Cross-repository support - Issues in different repos
- Temporary ID resolution - Resolve parent temporary IDs
- Parent-child relationships - Link sub-issues to parents
- Label sanitization - Clean up labels before applying
- Issue type mapping - Support custom issue types
Implementation Pattern
async function main(config = {}) {
const {
max = 5,
expires = 7,
allowed_labels = [],
allowed_issue_types = {}
} = config;
return async function(outputItem, resolvedTemporaryIds) {
// Process single issue creation message
// Resolve parent temporary IDs
// Create issue with all features
// Return { temporaryId, repo, number }
};
}
module.exports = { main };Config Parameters
max- Maximum issues per workflowexpires- Days until issues expireallowed_labels- Whitelisted labelsallowed_issue_types- Custom issue type mappingsdefault_assignees- Default assignees for issues
Testing
# Run comprehensive tests
npm test -- create_issue.test.cjs
# Test sub-issue linking
npm test -- create_issue.test.cjs -t "sub-issue"
# Integration test
npm test -- safe_output_handler_manager.test.cjsAcceptance Criteria
- Factory pattern implemented
- Sub-issue linking preserved
- Cross-repository support maintained
- Temporary ID resolution works
- No direct
process.envaccess - All existing tests pass
- Parent-child relationships work correctly
Related to Safe output manager #8098
AI generated by Plan Command for #8098