Commit e221af7
refactor: reduce complexity of execute_impl in create_pull_request.rs (#1609)
Extract six focused helpers from the 883-line execute_impl method:
- handle_no_changes: no-changes branch with symlink suffix logic
- validate_and_build_labels: agent label validation + merge with operator labels
- push_new_branch: ADO push + TOCTOU branch-collision retry
- build_push_payload: pure function building the ADO push JSON body
- random_branch_suffix: encapsulates rand usage
- rename_branch_suffix: replaces inline rfind/format pattern used in two places
execute_impl shrinks from 883 lines to 718 lines. Each extracted function has
a single clear responsibility and is individually testable.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 375a202 commit e221af7
1 file changed
Lines changed: 248 additions & 186 deletions
0 commit comments