feat(runtimes): add dotnet runtime extension#435
Conversation
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/efab2e0c-8fcd-44b0-8af3-226fa6e8e2cc Co-authored-by: jamesadevine <[email protected]>
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/efab2e0c-8fcd-44b0-8af3-226fa6e8e2cc Co-authored-by: jamesadevine <[email protected]>
|
@copilot Repos can have a |
…n conflict Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/2deb298d-0df3-45e4-92c4-e58d71e2990d Co-authored-by: jamesadevine <[email protected]>
Confirmed your assertions against the Microsoft Learn docs for
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:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
/rust-review |
That'll do for now - we need to iron out config files in the future, but TODO! |
|
✅ Rust PR Reviewer completed successfully! |
🔍 Rust PR ReviewSummary: Looks good overall — well-structured extension following the established pattern, thorough test coverage, correct validation. Two minor issues worth addressing. Findings🔒 Security Concerns
|
|
@copilot implement suggestions and fixes for bug |
…ment Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/f0dd19ef-4d6c-4f0d-83f0-97947d886b69 Co-authored-by: jamesadevine <[email protected]>
Addressed both rust-review findings in 91cbe6c:
All 18 dotnet tests still pass; clippy reports no new warnings. |
Summary
Adds a
dotnetruntime alongside the existingpythonandnoderuntimes, following the sameCompilerExtensionpattern but adapted to NuGet'snuget.config-centric conventions and to .NET'sglobal.jsonSDK pinning.Runtime (
src/runtimes/dotnet/)version→UseDotNet@2withpackageType: 'sdk'(default8.0.x)version: "global.json"(case-insensitive) → emitsuseGlobalJson: true(no explicitversion:input), so the install task discovers and installs every SDK referenced byglobal.jsonfiles in the workspacefeed-url→ ensure-nuget.configshim (writes a minimal config only if none exists, probing the three case variants NuGet recognises) +NuGetAuthenticate@1config→NuGetAuthenticate@1only; trusts the checked-in filefeed-url/configare mutually exclusive; both run throughvalidate_feed_url/reject_pipeline_injectiondotnetto the bash allow-list, thedotnetecosystem domains to the AWF allowlist, and a prompt supplementnuget.configshim's confirmationechouses single quotes (matching the node runtime convention) so any characters that slip pastvalidate_feed_urlcannot be shell-expanded at agent runtimeglobal.jsonprecedence (single source of truth)global.jsonexists at the agent's compile directory and the front matter sets a concreteversion, compilation errors out with a message pointing the user at either removing the version or using the"global.json"sentinel.version: "global.json"+ on-diskglobal.jsonis the intended happy path.global.jsonis allowed (default8.0.xis used) — users opt intouseGlobalJsonexplicitly with the sentinel rather than auto-promoting.compile_dir: Option<&Path>is now plumbed throughCompileContext(with a matchingfor_test_with_compile_dirtest helper).Wiring
RuntimesConfig.dotnetfield,Extension::Dotnetenum variant,collect_extensionsbranchRuntimesConfig { … }literal sites to include the new fieldTests & docs
compile/extensions/tests.rs(12 mirroring python/node coverage — enable/disable/with-version, hosts, bash commands, prepare_steps with/without feed-url, config-only, env-vars contract, mutual exclusivity, injection rejection, all-runtimes-enabled — plus 6 new global.json tests: sentinel emitsuseGlobalJson, case-insensitive, sentinel skips injection check, version+on-disk-global.json conflict-errors, sentinel+on-disk-global.json OK, no-version+on-disk-global.json OK)### .NETsection indocs/runtimes.md(with aglobal.jsonprecedence subsection) and a commented example indocs/front-matter.mdRequired differences from python/node (called out in
docs/runtimes.md)feed-url. NuGet has no first-class equivalent ofPIP_INDEX_URL/NPM_CONFIG_REGISTRY; the convention isnuget.config.agent_env_vars()returns empty (pinned by a test).config:is functional, not a deferred warning. AWF only overlays files in$HOME(e.g.,~/.npmrc→/dev/null); workspace files such asnuget.configare preserved inside the agent sandbox, so a checked-innuget.configworks today — nogh-aw-firewall#2547-style warning needed. Theruntimes.dotnet.configvalue still runs throughreject_pipeline_injectionas defence-in-depth, even though it is not currently embedded in any generated YAML.NuGetAuthenticate@1needs noworkingFile:— it auto-discoversnuget.configanywhere in the workspace, unlikenpmAuthenticate@0.dotnet, not.NET. The existingwrap_prompt_appendruntime guard rejects.in extension names. (The same guard would currently reject the existingNode.jsextension if exercised end-to-end — pre-existing, not addressed here.)global.jsonsentinel + on-disk conflict detection. No analogue exists in python/node sinceglobal.jsonis .NET-specific.Test plan
cargo build,cargo test(1203 lib tests pass, 18 dotnet-specific),cargo clippy --all-targets --all-features— no new warningsruntimes.dotnet+feed-urland verified the generated YAML emitsUseDotNet@2, the ensure-nuget.configheredoc,NuGetAuthenticate@1, thedotnetecosystem domains in the AWF--allow-domainslist, anddotneton the bash allow-list