Repository navigation
refactor: reduce complexity of build_conclusion_job in agentic_pipeline.rs - #1646
github-actions[bot] wants to merge 1 commit into
Conversation
…ne.rs Extract apply_tool_config_envs and apply_conclusion_tool_config helpers to flatten the 5-6 level deep per-tool config loop inside build_conclusion_job. Before: a single 65-line loop body with nested if/if-let/if-let/if-let/if-let chains for each of noop/missing-tool/missing-data. After: the loop body is a 3-line call to apply_conclusion_tool_config, which delegates to apply_tool_config_envs for the object-form config. The string- field fan-out is further condensed into a data-driven slice iteration so new config keys only require one entry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Triage note (automated-PR sweep): not merging yet. This touches |
|
Closing: high-risk change to |
What was complex
build_conclusion_jobinsrc/compile/agentic_pipeline.rscontained a 65-line loop body that applied per-tool conclusion env vars fornoop,missing-tool, andmissing-data. The body had 5–6 levels of nesting:The string-field fan-out (
title-prefix,work-item-type,area-path,iteration-path) was repeated verbatim five times.What changed
Two private helpers extracted:
apply_tool_config_envs(step, env_prefix, obj) -> BashStepHandles the object-form config for one tool. String fields are driven by a data-table slice so adding a new config key requires one entry, not a new
if letblock.apply_conclusion_tool_config(step, tool_key, tool_config) -> BashStepHandles the bool/object dispatch for one tool: derives
env_prefix, handles thefalse-bool early-return, then delegates toapply_tool_config_envs.The per-tool loop in
build_conclusion_jobbecomes:Verification
cargo test)cargo clippy --all-targets --all-features)Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comSee Network Configuration for more information.