Skip to content

Use GitHub Releases for SDK runtime artifacts - #2505

Merged
roji merged 6 commits into
mainfrom
roji-unify-runtime-artifacts
Sep 4, 2026
Merged

Use GitHub Releases for SDK runtime artifacts#2505
roji merged 6 commits into
mainfrom
roji-unify-runtime-artifacts

Conversation

@roji

@roji roji commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Continues #2463, completing the transition away from consuming the @github/copilot npm package from the SDKs, instead getting the github-copilot-*.tgz asset from GitHub Releases, which already packages the needed SDK-facing runtime assets. This paves the way to removing the duplicated runtime.node from the npm package, which is getting dangerously big and close to the npmjs limit.

#2463 did this for the Node.js SDK, Rust and Java (partially); this completes the work for the other SDKs.

The language SDKs should obtain Copilot CLI runtime components from one canonical source instead of extracting them from @github/copilot npm packages. This keeps runtime acquisition consistent and avoids carrying SDK-facing runtime payloads in the CLI npm package.

This change moves Python, .NET, and Go to the checksum-verified github-copilot-<version>-<platform>.tgz assets published by github/copilot-cli. Java and Rust runtime packaging were already Release-backed after #2463; Java's remaining schema-codegen and smoke-test dependency on @github/copilot is also removed. Java codegen now extracts schemas from the same verified Release artifact, while smoke tests use the shared Release-backed CLI setup.

Runtime compatibility entrypoints continue to use copilot-runtime[.exe] beside runtime.node, preserving existing SDK behavior. Downloads are verified against the Release's SHA256SUMS.txt, and incomplete caches are not treated as valid.

Validation

  • Compared normalized runtime paths, modes, sizes, and SHA-256 hashes between npm and Release packages across all eight supported platforms; every runtime payload matched byte-for-byte.
  • Python downloader/client tests, Ruff, and ty passed.
  • Focused .NET MSBuild target tests and Go bundler/runtime tests passed.
  • Full Java Maven verification passed, and Release-sourced schemas regenerate identical Java output.

@roji
roji requested a review from a team as a code owner September 3, 2026 15:58
Copilot AI balanced review requested due to automatic review settings September 3, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Runtime asset staging has unresolved cache-integrity, Go installation, and cross-platform test issues.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 High severity · 3 Medium severity

New issues introduced by this change (4)
Severity Finding
High severity dotnet/​src/​build/​GitHub.Copilot.SDK.targets — An incomplete cache is reacquired by overlaying the verified archive onto the existing directory:…
Medium severity go/​internal/​embeddedcli/​embeddedcli.go — When RuntimeExecutable/RuntimeAssets are configured without the optional in-process…
Medium severity go/​internal/​embeddedcli/​embeddedcli_test.go — This test is named for Path, but it calls RuntimePath, which goes through the pre-existing…
Medium severity python/​test_cli_download.py — This assertion hard-codes POSIX separators, but the Python test matrix includes Windows, where…
What changed in this PR

Moves Python, Go, and .NET runtime acquisition to checksum-verified Copilot CLI Release artifacts while removing Java’s remaining npm dependency.

Changes:

  • Adds unified Release-backed runtime staging and caching.
  • Fetches Java schemas from verified Release archives.
  • Updates tests, documentation, and CI workflows.
File Description
python/​test_cli_download.py Expands runtime provisioning tests.
python/​README.md Documents Release-based staging.
python/​copilot/​_ffi_runtime_host.py Updates layout terminology.
python/​copilot/​_cli_version.py Defines Release asset naming.
python/​copilot/​_cli_download.py Implements verified bundle staging.
java/​sdk/​src/​main/​java/​com/​github/​copilot/​ffi/​NativeRuntimeLoader.java Updates layout documentation.
java/​sdk/​pom.xml Removes npm schema-update profile.
java/​scripts/​codegen/​package.json Adds schema fetching and tests.
java/​scripts/​codegen/​package-lock.json Removes Copilot npm dependencies.
java/​scripts/​codegen/​java.ts Reads staged Release schemas.
java/​scripts/​codegen/​fetch-schemas.test.mjs Tests schema extraction.
java/​scripts/​codegen/​fetch-schemas.mjs Downloads and verifies schemas.
java/​pom.xml Removes the Java npm version pin.
java/​copilot-native/​scripts/​fetch-native.mjs Uses Release artifact terminology.
java/​copilot-native/​pom.xml Updates packaging documentation.
go/​README.md Documents Release-backed bundling.
go/​internal/​embeddedcli/​embeddedcli.go Installs the adjacent runtime pair.
go/​internal/​embeddedcli/​embeddedcli_test.go Adds runtime-pair coverage.
go/​cmd/​bundler/​main.go Downloads verified Release bundles.
go/​cmd/​bundler/​main_test.go Tests checksums and Release downloads.
dotnet/​test/​Unit/​MSBuildTargetsTests.cs Adds Release server integration tests.
dotnet/​src/​build/​GitHub.Copilot.SDK.targets Implements verified Release acquisition.
dotnet/​README.md Documents runtime acquisition options.
.github/​workflows/​update-copilot-dependency.yml Simplifies shared CLI updates.
.github/​workflows/​java-smoke-test.yml Uses shared Copilot setup.
.github/​workflows/​java-codegen-fix.md Updates agent codegen guidance.
.github/​workflows/​java-codegen-fix.lock.yml Regenerates workflow metadata.
.github/​workflows/​java-codegen-check.yml Tests and runs schema fetching.
.github/​workflows/​java-adapt-handwritten-code-to-accept-upgrade-changes.md Updates CLI-upgrade instructions.
.github/​workflows/​java-adapt-handwritten-code-to-accept-upgrade-changes.lock.yml Regenerates workflow metadata.
.github/​actions/​setup-copilot/​action.yml Exposes the JavaScript CLI path.
Files not reviewed (1)
  • java/scripts/codegen/package-lock.json: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread dotnet/src/build/GitHub.Copilot.SDK.targets Outdated
Comment thread go/internal/embeddedcli/embeddedcli.go
Comment thread go/internal/embeddedcli/embeddedcli_test.go Outdated
Comment thread python/test_cli_download.py
Comment thread dotnet/test/Unit/MSBuildTargetsTests.cs Dismissed
Comment thread dotnet/test/Unit/MSBuildTargetsTests.cs Dismissed
Comment thread dotnet/test/Unit/MSBuildTargetsTests.cs Dismissed
Comment thread dotnet/test/Unit/MSBuildTargetsTests.cs Dismissed
Comment thread dotnet/test/Unit/MSBuildTargetsTests.cs Dismissed
Comment thread dotnet/test/Unit/MSBuildTargetsTests.cs Dismissed
Comment thread dotnet/test/Unit/MSBuildTargetsTests.cs Dismissed
Comment thread dotnet/test/Unit/MSBuildTargetsTests.cs Dismissed
@SteveSandersonMS

Copy link
Copy Markdown
Contributor

Thanks for the migration work here — I manually validated two concrete behaviors:

  1. I ran Python's new release-backed runtime acquisition end-to-end against the real v1.0.83-3 GitHub Release asset, and it staged the expected runtime bundle layout successfully.

  2. I reproduced the stale-cache overlay risk in practice: when a verified tarball is extracted into an already-populated cache directory, unrelated pre-existing files remain on disk. For this PR, that means cache reacquisition should use fresh staging (or full clear-and-replace) rather than overlay extraction into an existing cache directory.

@roji

roji commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

@SteveSandersonMS Addressed in 2cf1b9c: incomplete .NET runtime caches are now removed entirely before reacquisition, and the regression test verifies that a stale retained asset survives neither in the refreshed cache nor in build output.

roji added 2 commits September 4, 2026 10:56
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: daec7b3b-799c-4396-b372-6eb638d0faf8
Remove Java and Rust changes because those SDKs were already release-backed, simplify Python's direct runtime staging, and drop the misleading .NET npm URL alias.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: daec7b3b-799c-4396-b372-6eb638d0faf8
roji added 2 commits September 4, 2026 11:00
Fetch Java codegen schemas from the checksum-verified CLI release artifact and use the shared release-backed CLI setup for smoke tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: daec7b3b-799c-4396-b372-6eb638d0faf8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: daec7b3b-799c-4396-b372-6eb638d0faf8
@roji
roji force-pushed the roji-unify-runtime-artifacts branch from 2cf1b9c to 29128c6 Compare September 4, 2026 09:11
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review tier: Lite
Findings: 3 Medium severity

New issues introduced by this change (3)
Severity Finding
Medium severity go/​cmd/​bundler/​main.go — The bundler uses http.Get without a client timeout. If the remote endpoint stalls (or a proxy…
Medium severity java/​scripts/​codegen/​fetch-schemas.mjs — This schema fetcher hard-depends on a tar executable being available and functional on the host.…
Medium severity python/​copilot/​_cli_download.py — The hostless extraction path sanitizer does not explicitly reject backslashes (\\\\) in…
Issues resolved since last review (4)
Severity Finding
Medium severity python/​test_cli_download.py — This assertion hard-codes POSIX separators, but the Python test matrix includes Windows, where… View resolved comment
Medium severity go/​internal/​embeddedcli/​embeddedcli_test.go — This test is named for Path, but it calls RuntimePath, which goes through the pre-existing… View resolved comment
Medium severity go/​internal/​embeddedcli/​embeddedcli.go — When RuntimeExecutable/RuntimeAssets are configured without the optional in-process… View resolved comment
High severity dotnet/​src/​build/​GitHub.Copilot.SDK.targets — An incomplete cache is reacquired by overlaying the verified archive onto the existing directory:… View resolved comment
Files not reviewed (1)
  • java/scripts/codegen/package-lock.json: Generated file

Comment thread go/cmd/bundler/main.go Outdated
Comment thread java/scripts/codegen/fetch-schemas.mjs
Comment thread python/copilot/_cli_download.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: daec7b3b-799c-4396-b372-6eb638d0faf8
Copilot stopped reviewing on behalf of roji due to an error September 4, 2026 11:48
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: daec7b3b-799c-4396-b372-6eb638d0faf8
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

SDK Consistency Review

Reviewed the full PR diff (via get_files/get_diff for PR #2505) against all six SDK implementations.

Summary of changes: This PR is a documentation/naming cleanup (npm-registry terminology → GitHub-release terminology) plus completing an in-progress migration of the CLI/runtime download mechanism from npm-based distribution to GitHub Releases-based distribution (github-copilot-<version>-<platform>.tgz assets + SHA256SUMS.txt), consistently across Go (cmd/bundler), Python (_cli_download.py, _cli_version.py), Java (fetch-native.mjs, new fetch-schemas.mjs), and .NET (GitHub.Copilot.SDK.targets, now honoring COPILOT_CLI_DOWNLOAD_BASE_URL alongside the new CopilotCliReleaseBaseUrl MSBuild property).

Cross-SDK check:

  • Node.js/TypeScript (nodejs/scripts/releaseArtifacts.ts, set-cli-version.js) and Rust (build.rs/embeddedcli.rs) already use the same GitHub-release asset naming and COPILOT_CLI_DOWNLOAD_BASE_URL override convention — confirming this PR brings Go/Python/Java/.NET into alignment with the existing pattern rather than introducing a one-off feature.
  • The .github/actions/setup-copilot action gains a javascript-cli-path output used by the Java smoke-test workflow to invoke the CLI via Node directly instead of a global npm install — this is CI infra, not SDK public API, so no other-language action needed.
  • No new public client API methods/parameters were added in this PR, so there's nothing to check for method-naming parity (camelCase/snake_case/PascalCase) across languages.
  • CopilotCliReleaseBaseUrl (.NET MSBuild property) and COPILOT_CLI_DOWNLOAD_BASE_URL (env var, honored by Go/Python/Java/Node/Rust) are already documented as equivalent overrides in dotnet/README.md/python/README.md, so the naming difference is an accepted, documented language-idiom difference (MSBuild property vs. env var), not an inconsistency.

Conclusion: No cross-SDK consistency issues found. The change maintains parity — it's precisely the kind of change that removes prior inconsistency (Go/Python/Java/.NET previously depended on npm registry access; now all six SDKs consistently use GitHub Releases).

Generated by SDK Consistency Review Agent for #2505 · copilot · sonnet50 · 36.7 AIC · ⌖ 12.9 AIC · ⊞ 9.7K ·

@roji
roji added this pull request to the merge queue Sep 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 4, 2026
@roji
roji added this pull request to the merge queue Sep 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 4, 2026
@roji
roji added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit 570ae11 Sep 4, 2026
90 checks passed
@roji
roji deleted the roji-unify-runtime-artifacts branch September 4, 2026 15:04
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.

5 participants