-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
Description
Objective
Convert the update handlers and their factory generator to use the factory pattern.
Context
This is Phase 4 of the safe output manager refactoring (#8098). These handlers update existing GitHub resources rather than creating new ones.
Dependencies
- Requires: #aw_phase3_complex to be completed
Target Branch
sot (safe output transition)
Files to Refactor
actions/setup/js/update_runner.cjs- Factory generator for update handlersactions/setup/js/update_issue.cjs- Update existing issuesactions/setup/js/update_discussion.cjs- Update existing discussions
Implementation Pattern
update_runner.cjs (Factory Generator)
This file generates update handler factories dynamically:
async function main(config = {}) {
// Generate update handler factory
return async function(outputItem, resolvedTemporaryIds) {
// Resolve target ID (may be temporary)
// Apply updates to existing resource
// Return { repo, number }
};
}
module.exports = { main };update_issue.cjs & update_discussion.cjs
Use the generated factory pattern from update_runner.cjs.
Config Parameters
allowed_fields- Whitelisted fields for updatesrequire_confirmation- Require confirmation before updatesmax_updates- Maximum updates per workflow
Testing
# Run update handler tests
npm test -- update_runner.test.cjs
npm test -- update_issue.test.cjs
npm test -- update_discussion.test.cjs
# Integration test
npm test -- safe_output_handler_manager.test.cjsAcceptance Criteria
- All update handlers use factory pattern
- Factory generator works correctly
- Temporary ID resolution works for targets
- No direct
process.envaccess - All existing tests pass
- Config properly passed through
Related to Safe output manager #8098
AI generated by Plan Command for #8098