refactor: complete Engine abstraction — move install, invocation, and paths behind Engine trait#291
Closed
refactor: complete Engine abstraction — move install, invocation, and paths behind Engine trait#291
Conversation
…hs, and logs behind Engine trait
- Add Engine trait methods: install_steps(), invocation(), version(), home_config_dir(), log_dir(), mcp_config_path()
- Implement all methods for GitHubCopilotCliEngine
- Move COPILOT_CLI_VERSION constant into engine.rs
- Replace hardcoded Copilot CLI install steps in base.yml and 1es-base.yml with {{ engine_install }} marker (Agent + Detection jobs)
- Replace hardcoded AWF invocation with {{ engine_run }} and {{ engine_run_detection }} markers
- Replace hardcoded $HOME/.copilot paths with {{ engine_home_config_dir }} marker
- Replace hardcoded ~/.copilot/logs paths with {{ engine_log_dir }} marker
- Replace hardcoded /tmp/awf-tools/mcp-config.json with {{ engine_mcp_config_path }} marker
- Rename generate_copilot_params → generate_engine_args (keep alias)
- Rename generate_copilot_ado_env → generate_engine_ado_env (keep alias)
- Add {{ engine_version }}, {{ engine_args }}, {{ engine_ado_env }} template markers
- Keep {{ copilot_params }}, {{ copilot_version }}, {{ copilot_ado_env }} as legacy aliases
- Update run.rs to use new function names
- Update compile/mod.rs re-exports
- Update compiler_tests.rs assertions
- Update version updater workflow doc to reference engine.rs
- Add comprehensive tests for new Engine methods
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/1ac4ad38-204d-4b8f-b7a0-1b2e04945060
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor engine abstraction to move install steps behind Engine enum
refactor: complete Engine abstraction — move install, invocation, and paths behind Engine trait
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several Copilot-specific artifacts (NuGet install steps, binary path,
$HOME/.copilot,~/.copilot/logs,/tmp/awf-tools/mcp-config.json) were hardcoded across both pipeline templates andcommon.rs. This makes adding a new engine require touching templates directly.Engine trait additions (
src/engine.rs)install_steps()— YAML steps to install the engine binaryinvocation(prompt_path, mcp_config_path, engine_args)— AWF command stringversion()— engine binary versionhome_config_dir(),log_dir(),mcp_config_path()— engine-specific pathsCOPILOT_CLI_VERSIONmoved here fromcompile/common.rsTemplate markers (
base.yml,1es-base.yml){{ engine_install }}— replaces hardcoded NuGet + Copilot CLI install (Agent + Detection jobs, both templates){{ engine_run }}/{{ engine_run_detection }}— replaces hardcoded/tmp/awf-tools/copilot --prompt ...invocations{{ engine_home_config_dir }}— replaces$HOME/.copilot{{ engine_log_dir }}— replaces~/.copilot/logs{{ engine_mcp_config_path }}— replaces/tmp/awf-tools/mcp-config.jsonRenamed identifiers
generate_copilot_params()generate_engine_args()generate_copilot_ado_env()generate_engine_ado_env(){{ copilot_params }}{{ engine_args }}{{ copilot_version }}{{ engine_version }}{{ copilot_ado_env }}{{ engine_ado_env }}Adding a new engine now requires implementing the
Enginetrait — no template changes needed: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/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e 629695600986dfb-cgu.1.rcgu.o 629695600986dfb-cgu.2.rcgu.o 629695600986dfb-cgu.3.rcgu.o 629695600986dfb-cgu.4.rcgu.o 20.schemars_derive.eddb870406910005-cgu.13.rcgu.o 8tlmpg451pd8u3zgt429y2.1emnwgg.rcgu.o mdgr9yaykb5spye22ig0pu.1emnwgg.rcgu.o nw14mu80bm3vzj0pdy1pc4.1emnwgg.rcgu.o qdfcgao1e84d0nfajb4me6.1emnwgg.rcgu.o 526y1a1cqcwbharsmuokdq.1emnwgg.rcgu.o 6nz4nw8w7t6pepoc7oi5a1.1emnwgg.rcgu.o x9q8zc1ogmo6qulijd3fty.1emnwgg.rcgu.o e28uxz4epjqhg959oscvwc.1emnwgg.rcgu.o t1ckqs5hmfjp7w5t0750wm.1emnwgg.rcgu.o celjdc7tie78hy59upe1bd.1emnwgg.rcgu.o gzh2ecko4htfvj02qd7mit.1emnwgg.rcgu.o hme4d5oiu98z0adljzbcxa.1emnwgg.rcgu.o fib0mlapxt11hb1im74dby.1emnwgg.rcgu.o 8qi2w49a7s1az0j1pdpwrc.1emnwgg.rcgu.o(dns block)/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 s73hj6uw9qoflfyew0r.02kix4b.rcgu.o 6jes4gw7h3gzqbgdkg7.02kix4b.rcgu.o 8sfzh4ujgg74v61mz8h.02kix4b.rcgu.o 9ainxqcxmqdcdiipj9a.02kix4b.rcgu.o xw1rzkmg0sdpjbg7v0n.02kix4b.rcgu.o ucmora8yxpzuarwgkds.02kix4b.rcgu.o 2dtufw8wpcfhycj90aq.02kix4b.rcgu.o wuzygqicdn6giuopyvy.02kix4b.rcgu.o 3hskrkqls9xf83m9n0k.02kix4b.rcgu.o vtbuddhrd8m6va02p46.02kix4b.rcgu.o 8pkvumk58pe9c8hwtee.02kix4b.rcgu.o g80mj11wx3bfh1eooqu.02kix4b.rcgu.o e0ytjjtazvzu5cs45xc.02kix4b.rcgu.o kevrheq42ink68rvzk8.02kix4b.rcgu.o(dns block)/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e /home/REDACTED/worremote /home/REDACTED/worget-url r remo�� get-url 6jes4gw7h3gzqbgdkg7.18w7a6b.rcgu.o arj8ka2qsly2cqjwhvg.18w7a6b.rcgu.o 90pf4snbcbvvsueb7kt.18w7a6b.rcgu.o 8sfzh4ujgg74v61mz8h.18w7a6b.rcgu.o nmtg3ywpuvtczjwenx5.18w7a6b.rcgu.o vfrkqzwt975boh4pj0j.18w7a6b.rcgu.o 9ainxqcxmqdcdiipj9a.18w7a6b.rcgu.o xw1rzkmg0sdpjbg7v0n.18w7a6b.rcgu.o ucmora8yxpzuarwgkds.18w7a6b.rcgu.o nnhxvdomvhhzp9o7urp.18w7a6b.rcgu.o 2dtufw8wpcfhycj90aq.18w7a6b.rcgu.o l0spsydjqblw4p9ksga.18w7a6b.rcgu.o wuzygqicdn6giuopyvy.18w7a6b.rcgu.o loptvlchxj7iq4gspy5.18w7a6b.rcgu.o(dns block)If you need me to access, download, or install something from one of these locations, you can either: