Skip to content

Commit addebe1

Browse files
committed
Merge remote-tracking branch 'origin/main' into belaltaher8/tool-meta-passthrough
# Conflicts: # python/test_client.py
2 parents 71c6fb4 + ee7db7b commit addebe1

191 files changed

Lines changed: 11852 additions & 2310 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/lsp.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,6 @@
2121
".go": "go"
2222
},
2323
"rootUri": "go"
24-
},
25-
"rust-analyzer": {
26-
"command": "rust-analyzer",
27-
"fileExtensions": {
28-
".rs": "rust"
29-
},
30-
"initializationOptions": {
31-
"cargo": {
32-
"buildScripts": {
33-
"enable": true
34-
},
35-
"allFeatures": true
36-
},
37-
"checkOnSave": true,
38-
"check": {
39-
"command": "clippy"
40-
}
41-
}
4224
}
4325
}
4426
}

.github/workflows/java-publish-maven.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,34 @@ on:
2222
type: boolean
2323
required: false
2424
default: false
25+
workflow_call:
26+
inputs:
27+
releaseVersion:
28+
description: "Release version (e.g., 1.0.0). If empty, derives from pom.xml by removing -SNAPSHOT"
29+
required: false
30+
type: string
31+
developmentVersion:
32+
description: "Next development version (e.g., 1.0.1-SNAPSHOT). If empty, increments patch version"
33+
required: false
34+
type: string
35+
prerelease:
36+
description: "Is this a prerelease?"
37+
type: boolean
38+
required: false
39+
default: false
40+
secrets:
41+
JAVA_RELEASE_TOKEN:
42+
required: true
43+
JAVA_RELEASE_GITHUB_TOKEN:
44+
required: true
45+
JAVA_MAVEN_CENTRAL_USERNAME:
46+
required: true
47+
JAVA_MAVEN_CENTRAL_PASSWORD:
48+
required: true
49+
JAVA_GPG_SECRET_KEY:
50+
required: true
51+
JAVA_GPG_PASSPHRASE:
52+
required: true
2553

2654
permissions:
2755
contents: write
@@ -144,10 +172,10 @@ jobs:
144172
exit 1
145173
fi
146174
else
147-
# Split version: supports "0.1.32", "0.1.32-java.0", and "0.1.32-java-preview.0" formats
175+
# Split version: supports "0.1.32", "0.1.32-preview.0", "0.1.32-java.0", and "0.1.32-java-preview.0" formats
148176
# Validate RELEASE_VERSION format explicitly to provide clear errors
149-
if ! echo "$RELEASE_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-(beta-)?java(-preview)?\.[0-9]+)?$'; then
150-
echo "Error: RELEASE_VERSION '$RELEASE_VERSION' is invalid. Expected format: M.M.P, M.M.P-java.N, M.M.P-java-preview.N, M.M.P-beta-java.N, or M.M.P-beta-java-preview.N (e.g., 1.2.3, 1.2.3-java.0, 1.2.3-java-preview.0, 1.2.3-beta-java.0, or 1.2.3-beta-java-preview.0)." >&2
177+
if ! echo "$RELEASE_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-(preview|(beta-)?java(-preview)?)\.[0-9]+)?$'; then
178+
echo "Error: RELEASE_VERSION '$RELEASE_VERSION' is invalid. Expected format: M.M.P, M.M.P-preview.N, M.M.P-java.N, M.M.P-java-preview.N, M.M.P-beta-java.N, or M.M.P-beta-java-preview.N (e.g., 1.2.3, 1.2.3-preview.0, 1.2.3-java.0, 1.2.3-java-preview.0, 1.2.3-beta-java.0, or 1.2.3-beta-java-preview.0)." >&2
151179
exit 1
152180
fi
153181
# Extract the base M.M.P portion (before any qualifier)

.github/workflows/nodejs-sdk-tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ permissions:
3131

3232
jobs:
3333
test:
34-
name: "Node.js SDK Tests"
34+
name: "Node.js SDK Tests (${{ matrix.os }}, ${{ matrix.transport }})"
3535
if: github.event.repository.fork == false
3636
env:
3737
POWERSHELL_UPDATECHECK: Off
3838
strategy:
3939
fail-fast: false
4040
matrix:
4141
os: [ubuntu-latest, macos-latest, windows-latest]
42+
transport: ["default", "inprocess"]
4243
runs-on: ${{ matrix.os }}
4344
defaults:
4445
run:
@@ -75,6 +76,11 @@ jobs:
7576
if: runner.os == 'Windows'
7677
run: pwsh.exe -Command "Write-Host 'PowerShell ready'"
7778

79+
- name: Select inprocess transport
80+
if: matrix.transport == 'inprocess'
81+
run: |
82+
echo "COPILOT_SDK_DEFAULT_CONNECTION=inprocess" >> "$GITHUB_ENV"
83+
7884
- name: Run Node.js SDK tests
7985
env:
8086
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}

.github/workflows/publish.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,17 @@ jobs:
171171
- name: Set version
172172
run: sed -i -E 's/^version = ".*"$/version = "${{ needs.version.outputs.version }}"/' Cargo.toml
173173
- name: Snapshot CLI version + hashes for build.rs
174-
run: bash scripts/snapshot-bundled-cli-version.sh
175-
- name: Verify cli-version.txt exists
176174
run: |
177-
if [[ ! -f cli-version.txt ]]; then
178-
echo "::error::cli-version.txt was not generated. The Snapshot step must run before packaging."
179-
exit 1
180-
fi
175+
bash scripts/snapshot-bundled-cli-version.sh
176+
bash scripts/snapshot-bundled-in-process-version.sh
177+
- name: Verify CLI version snapshots exist
178+
run: |
179+
for snapshot in cli-version.txt cli-version-in-process.txt; do
180+
if [[ ! -f "${snapshot}" ]]; then
181+
echo "::error::${snapshot} was not generated. The Snapshot step must run before packaging."
182+
exit 1
183+
fi
184+
done
181185
- name: Package (dry run)
182186
run: cargo publish --dry-run --allow-dirty
183187
- name: Upload artifact
@@ -229,10 +233,28 @@ jobs:
229233
with:
230234
packages-dir: python/dist/
231235

236+
publish-java:
237+
name: Publish Java SDK
238+
if: github.event.inputs.dist-tag != 'unstable' && github.ref == 'refs/heads/main'
239+
needs: version
240+
uses: ./.github/workflows/java-publish-maven.yml
241+
with:
242+
releaseVersion: ${{ needs.version.outputs.version }}
243+
prerelease: ${{ github.event.inputs.dist-tag == 'prerelease' }}
244+
secrets: inherit
245+
232246
github-release:
233247
name: Create GitHub Release
234-
needs: [version, publish-nodejs, publish-dotnet, publish-python, publish-rust]
235-
if: github.ref == 'refs/heads/main' && github.event.inputs.dist-tag != 'unstable'
248+
needs: [version, publish-nodejs, publish-dotnet, publish-python, publish-rust, publish-java]
249+
if: |
250+
always() &&
251+
github.ref == 'refs/heads/main' &&
252+
github.event.inputs.dist-tag != 'unstable' &&
253+
needs.version.result == 'success' &&
254+
needs.publish-nodejs.result == 'success' &&
255+
needs.publish-dotnet.result == 'success' &&
256+
needs.publish-python.result == 'success' &&
257+
needs.publish-rust.result == 'success'
236258
runs-on: ubuntu-latest
237259
steps:
238260
- uses: actions/checkout@v6.0.2

.github/workflows/rust-sdk-tests.yml

Lines changed: 87 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ permissions:
2929

3030
jobs:
3131
test:
32-
name: "Rust SDK Tests"
32+
name: "Rust SDK Tests (${{ matrix.os }}, default)"
3333
if: github.event.repository.fork == false
3434
env:
3535
POWERSHELL_UPDATECHECK: Off
@@ -84,7 +84,7 @@ jobs:
8484
# Share the bundled-CLI archive cache with the `bundle` job: build.rs
8585
# now downloads in both modes (embed for `bundle`, extract-to-cache
8686
# for this `test` job's `--no-default-features` build).
87-
- name: Cache bundled CLI tarball
87+
- name: Cache bundled CLI archives
8888
uses: actions/cache@v4
8989
with:
9090
path: ./rust/.bundled-cli-cache
@@ -98,7 +98,7 @@ jobs:
9898
if: runner.os == 'Linux'
9999
env:
100100
BUNDLED_CLI_CACHE_DIR: ${{ github.workspace }}/rust/.bundled-cli-cache
101-
run: cargo clippy --all-targets --features test-support -- --no-deps -D warnings -D clippy::unwrap_used -D clippy::disallowed_macros -D clippy::await_holding_invalid_type
101+
run: cargo clippy --all-targets --features test-support,bundled-in-process -- --no-deps -D warnings -D clippy::unwrap_used -D clippy::disallowed_macros -D clippy::await_holding_invalid_type
102102

103103
- name: cargo doc
104104
if: runner.os == 'Linux'
@@ -129,14 +129,92 @@ jobs:
129129
# The dedicated `bundle` job below exercises the embed pipeline.
130130
run: cargo test --no-default-features --features test-support -- --test-threads=4 --nocapture
131131

132+
# Exercises the in-process FFI transport (`Transport::InProcess`, the Rust
133+
# analogue of the .NET `RuntimeConnection.ForInProcess()`), mirroring the
134+
# `inprocess` transport cell in dotnet-sdk-tests.yml. Sets
135+
# COPILOT_SDK_DEFAULT_CONNECTION=inprocess so the client hosts the runtime
136+
# cdylib in-process instead of spawning a stdio child, then runs the whole
137+
# E2E suite over the in-process transport. The suite runs serially in-process
138+
# (the harness forces concurrency to 1) because it mirrors each test's
139+
# environment onto the shared process environment the in-process worker inherits.
140+
# Runs the whole E2E suite over the in-process transport on supported hosts.
141+
test-inprocess:
142+
name: "Rust SDK Tests (${{ matrix.os }}, inprocess)"
143+
if: github.event.repository.fork == false
144+
env:
145+
CARGO_TERM_COLOR: always
146+
RUST_BACKTRACE: 1
147+
strategy:
148+
fail-fast: false
149+
matrix:
150+
# TODO: Re-enable Windows after fixing the napi-oop peer shutdown crash.
151+
os: [ubuntu-latest, macos-latest]
152+
runs-on: ${{ matrix.os }}
153+
defaults:
154+
run:
155+
shell: bash
156+
working-directory: ./rust
157+
steps:
158+
- uses: actions/checkout@v6.0.2
159+
160+
- uses: ./.github/actions/setup-copilot
161+
id: setup-copilot
162+
163+
- name: Install Rust toolchain
164+
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
165+
with:
166+
toolchain: "1.94.0"
167+
168+
- uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2
169+
with:
170+
workspaces: "rust"
171+
prefix-key: v1-rust-no-bin
172+
cache-bin: false
173+
174+
- name: Read pinned @github/copilot CLI version
175+
id: cli-version
176+
working-directory: ./nodejs
177+
run: |
178+
version=$(node -p "require('./package-lock.json').packages['node_modules/@github/copilot'].version")
179+
echo "version=$version" >> "$GITHUB_OUTPUT"
180+
echo "Pinned CLI version: $version"
181+
182+
- name: Cache bundled CLI archives
183+
uses: actions/cache@v4
184+
with:
185+
path: ./rust/.bundled-cli-cache
186+
key: bundled-cli-${{ matrix.os }}-${{ steps.cli-version.outputs.version }}
187+
188+
- name: Install test harness dependencies
189+
working-directory: ./test/harness
190+
run: npm ci --ignore-scripts
191+
192+
- name: Warm up PowerShell
193+
if: runner.os == 'Windows'
194+
run: pwsh.exe -Command "Write-Host 'PowerShell ready'"
195+
196+
- name: Select in-process transport
197+
run: echo "COPILOT_SDK_DEFAULT_CONNECTION=inprocess" >> "$GITHUB_ENV"
198+
199+
- name: cargo test (in-process transport, full E2E suite)
200+
timeout-minutes: 60
201+
env:
202+
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
203+
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.cli-path }}
204+
BUNDLED_CLI_CACHE_DIR: ${{ github.workspace }}/rust/.bundled-cli-cache
205+
# The harness forces serial execution in-process (both the async semaphore and
206+
# libtest via --test-threads=1) because it mirrors each test's environment onto
207+
# the shared process environment, so RUST_E2E_CONCURRENCY is not set here.
208+
run: cargo test --no-default-features --features test-support,bundled-in-process --test e2e -- --test-threads=1 --nocapture
209+
132210
# Validates the bundled-CLI build path on all three supported
133211
# platforms. While the regular `cargo test` job above also exercises
134212
# build.rs (bundling is on by default now), this matrix job is the
135213
# dedicated cross-platform smoke test for the download / verify /
136214
# extract / embed pipeline. Catches regressions before they ship to
137215
# crates.io and before bundling consumers hit them downstream.
138216
bundle:
139-
name: "Rust SDK Bundled CLI Build"
217+
name: "Rust SDK Bundled CLI Build (${{ matrix.os }})"
140218
if: github.event.repository.fork == false
141219
env:
142220
CARGO_TERM_COLOR: always
@@ -180,13 +258,15 @@ jobs:
180258
# ~130 MB on every CI invocation. Keyed by OS + CLI version so old
181259
# archives drop out when the pinned version bumps, keeping the
182260
# cache bounded.
183-
- name: Cache bundled CLI tarball
261+
- name: Cache bundled CLI archives
184262
uses: actions/cache@v4
185263
with:
186264
path: ./rust/.bundled-cli-cache
187265
key: bundled-cli-${{ matrix.os }}-${{ steps.cli-version.outputs.version }}
188266

189-
- name: cargo build (bundled-cli is the default feature)
267+
- name: Test bundled CLI build paths
190268
env:
191269
BUNDLED_CLI_CACHE_DIR: ${{ github.workspace }}/rust/.bundled-cli-cache
192-
run: cargo build
270+
run: |
271+
cargo build
272+
cargo test --features bundled-in-process --lib embedded_archive_contains_only_expected_files

0 commit comments

Comments
 (0)