-
Notifications
You must be signed in to change notification settings - Fork 268
Closed
Description
Objective
Extract inline parsing logic for assign-to-agent configuration from safe_outputs.go into a dedicated parseAssignToAgentConfig() function in assign_to_agent.go.
Current State
Problem: Parsing logic is embedded inline in pkg/workflow/safe_outputs.go:202-225 (~24 lines)
File: pkg/workflow/assign_to_agent.go currently only contains buildAssignToAgentJob() (58 lines total)
Approach
- Create
parseAssignToAgentConfig()function inassign_to_agent.go - Move parsing logic from
safe_outputs.go:202-225to new function - Update
safe_outputs.goto callc.parseAssignToAgentConfig(outputMap) - Verify tests pass with
make test-unit
Implementation Details
New function signature:
func (c *Compiler) parseAssignToAgentConfig(outputMap map[string]any) *AssignToAgentConfigLogic to extract (from safe_outputs.go:202-225):
- Parse
namefield (default agent, optional) - Parse
targetandtarget-repoconfiguration usingParseTargetConfig() - Parse base configuration (github-token, max)
- Handle null case (create empty config)
Update in safe_outputs.go:
// Replace lines 202-225 with:
assignToAgentConfig := c.parseAssignToAgentConfig(outputMap)
if assignToAgentConfig != nil {
config.AssignToAgent = assignToAgentConfig
}Files to Modify
- Create:
parseAssignToAgentConfig()inpkg/workflow/assign_to_agent.go - Update:
pkg/workflow/safe_outputs.go(remove lines 202-225, add function call)
Expected Changes
assign_to_agent.go: 58 → ~88 lines (+30 lines)safe_outputs.go: ~1,310 → ~1,286 lines (-24 lines)
Acceptance Criteria
-
parseAssignToAgentConfig()function added toassign_to_agent.go - Inline parsing removed from
safe_outputs.go - Function called correctly in
safe_outputs.go - All tests pass (
make test-unit) - Build succeeds (
make build) - Generated YAML unchanged (byte-for-byte)
Related to [plan] Complete safe-output pattern consistency #5426
AI generated by Plan Command for #5382
Reactions are currently unavailable