Skip to content

refactor: complete Engine abstraction — move install, invocation, and paths behind Engine enum#296

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/refactor-engine-abstraction-again
Closed

refactor: complete Engine abstraction — move install, invocation, and paths behind Engine enum#296
Copilot wants to merge 3 commits intomainfrom
copilot/refactor-engine-abstraction-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

Pipeline templates hardcode Copilot CLI install steps, binary paths, invocation commands, config directories, and log paths. Adding a new engine requires touching templates directly.

Engine methods added (src/engine.rs)

  • install_steps() — generates NuGet install YAML (owns COPILOT_CLI_VERSION, moved from common.rs)
  • invocation(engine_args) / detection_invocation(engine_args) — AWF -- command for Agent/Detection jobs
  • version(), home_config_dir(), log_dir(), mcp_config_path() — engine-specific paths, all using $HOME consistently

Template markers replacing hardcoded Copilot references

Old New
Hardcoded NuGet install (×4 across both templates) {{ engine_install }}
'/tmp/awf-tools/copilot --prompt ... {{ copilot_params }}' {{ engine_run }} / {{ engine_run_detection }}
{{ copilot_version }} {{ engine_version }}
$HOME/.copilot {{ engine_home_config_dir }}
~/.copilot/logs {{ engine_log_dir }}
$HOME/.copilot/mcp-config.json {{ engine_mcp_config_path }}

{{ copilot_params }} is eliminated — engine args are now baked into {{ engine_run }} by Engine::invocation().

Renames

  • copilot_paramsengine_args in compile_shared() and run.rs
  • test_copilot_params_*test_engine_args_* (20 tests)
  • COPILOT_CLI_VERSION canonical location → src/engine.rs (re-export in common.rs preserved)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dev.azure.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-c05a54f0ee13c0b7 /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-c05a54f0ee13c0b7 /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-a820d47d98270560.09fjwx/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/init_tests-3bcc4ddce1e312d9.2ukf37jb0777k2y8ri9exqh0h.03qjqv5.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-a820d47d98270560.0adin8/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/init_tests-3bcc4ddce1e312d9.2ynn8gvql2fyvn7igwbexxwwe.03qjqv5.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-a820d47d98270560.0atqo9/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/init_tests-3bcc4ddce1e312d9.32e9rgsalv16jx9z0iqp0mleg.03qjqv5.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-a820d47d98270560.0cvrpt/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/init_tests-3bcc4ddce1e312d9.374c5aulltrl0bl9xey67nr26.03qjqv5.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-a820d47d98270560.0d2ci9/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/init_tests-3bcc4ddce1e312d9.3adno12ab0g5nlfulsvspfcq8.03qjqv5.rcgu.o 5.00l282qg8pqjpribuxk00ly57.0xvnnev.rcgu.o 5.04pvr3v3jq5s9cz4rxzmhqadv.0xvnnev.rcgu.o 5.08c7t5zps20p022563l9klb3b.0xvnnev.rcgu.o 5.0bjk4g2thkx4snzt4hcjhzjoa.0xvnnev.rcgu.o 5.0p1v9lnmnjhz6ksvg4k1grpru.0xvnnev.rcgu.o 5.0w6e3rq8q9fkdgxnclb4z636a.0xvnnev.rcgu.o 5.10gxe18j03s801iuvh69tvv0i.0xvnnev.rcgu.o 5.14fax48xdffz185im416a7elz.0xvnnev.rcgu.o 5.16gjxij8jx3sxiz8lpycmrnkd.0xvnnev.rcgu.o 5.17unxb5laoekqixkf4qnr6sbw.0xvnnev.rcgu.o 5.18g4t9rqadmplukldxxwfdghh.0xvnnev.rcgu.o 5.1if8uc8ofutahxkln01oe5axr.0xvnnev.rcgu.o 5.1qlvx6rnt00u2kwrwh6tk8tw3.0xvnnev.rcgu.o 5.21b9o5zsud4g3k1pq9q72uu2y.0xvnnev.rcgu.o (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-c05a54f0ee13c0b7 /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-c05a54f0ee13c0b7 s/ado_aw-27c82a3remote s/ado_aw-27c82a3get-url s/ado_aw-27c82a3origin s/ad�� (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-c05a54f0ee13c0b7 /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-c05a54f0ee13c0b7 s/ado_aw-a820d47remote s/ado_aw-a820d47get-url s/ado_aw-a820d47origin s/ad�� s/ado_aw-a820d47d98270560.09fjwx-pie s/ado_aw-a820d47d98270560.09z2t7-z s/ado_aw-a820d47d98270560.0cvrptnow s/ado_aw-a820d47git s/ado_aw-a820d47remote s/ado_aw-a820d47get-url s/ado_aw-a820d47origin s/ad�� s/ado_aw-a820d47d98270560.0xup3mnk95t0ow1j93oufmjyt.11yg6at.rcgu.o s/ado_aw-a820d47d98270560.0y5cyk7p4isxbw2hyvnoooob8.11yg6at.rcgu.o -aw /home/REDACTED/wor/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw kwkek02lbt7cng2acompile aeeuyv7zx3wtkxqd/tmp/agentic-pipeline-uwi-pass-12416/uwi-agent.md -aw (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits April 22, 2026 08:03
… paths behind Engine enum

- Move COPILOT_CLI_VERSION constant from compile/common.rs to engine.rs
  (re-export preserved for backward compatibility)
- Add Engine::install_steps() — generates NuGet install YAML steps
- Add Engine::invocation() — generates AWF agent command line
- Add Engine::detection_invocation() — generates AWF detection command line
- Add Engine::version() — returns engine CLI version string
- Add Engine::home_config_dir() — returns engine home config path
- Add Engine::log_dir() — returns engine log directory
- Add Engine::mcp_config_path() — returns engine MCP config path
- Replace hardcoded install steps in base.yml and 1es-base.yml with
  {{ engine_install }} marker
- Replace hardcoded AWF commands with {{ engine_run }} and
  {{ engine_run_detection }} markers
- Replace {{ copilot_version }} with {{ engine_version }}
- Replace {{ copilot_params }} with engine_args (now baked into
  {{ engine_run }})
- Replace hardcoded ~/.copilot paths with {{ engine_home_config_dir }},
  {{ engine_log_dir }}, {{ engine_mcp_config_path }}
- Rename copilot_params variable to engine_args in compile_shared()
  and run.rs
- Rename test_copilot_params_* test functions to test_engine_args_*
- Update version updater workflow docs for new constant location

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/f7532250-9a9d-45aa-9043-2ea43eb2c870

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor installation steps to use Engine abstraction refactor: complete Engine abstraction — move install, invocation, and paths behind Engine enum Apr 22, 2026
Copilot AI requested a review from jamesadevine April 22, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: complete Engine abstraction — move install, invocation, and paths behind Engine enum

2 participants