Skip to content

Commit 2ee58d5

Browse files
authored
Merge branch 'main' into frg/more-e2e-tests
2 parents 5f9c460 + 35534c4 commit 2ee58d5

File tree

528 files changed

+32384
-2906
lines changed

Some content is hidden

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

528 files changed

+32384
-2906
lines changed

.github/dependabot.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
version: 2
2+
multi-ecosystem-groups:
3+
all:
4+
schedule:
5+
interval: 'weekly'
26
updates:
37
- package-ecosystem: 'github-actions'
48
directory: '/'
5-
schedule:
6-
interval: 'weekly'
9+
multi-ecosystem-group: 'all'
710
- package-ecosystem: 'devcontainers'
811
directory: '/'
9-
schedule:
10-
interval: 'weekly'
12+
multi-ecosystem-group: 'all'
1113
# Node.js dependencies
1214
- package-ecosystem: 'npm'
1315
directory: '/nodejs'
14-
schedule:
15-
interval: 'weekly'
16+
multi-ecosystem-group: 'all'
1617
- package-ecosystem: 'npm'
1718
directory: '/test/harness'
18-
schedule:
19-
interval: 'weekly'
19+
multi-ecosystem-group: 'all'
2020
# Python dependencies
2121
- package-ecosystem: 'pip'
2222
directory: '/python'
23-
schedule:
24-
interval: 'weekly'
23+
multi-ecosystem-group: 'all'
2524
# Go dependencies
2625
- package-ecosystem: 'gomod'
2726
directory: '/go'
28-
schedule:
29-
interval: 'weekly'
27+
multi-ecosystem-group: 'all'
3028
# .NET dependencies
3129
- package-ecosystem: 'nuget'
3230
directory: '/dotnet'
33-
schedule:
34-
interval: 'weekly'
31+
multi-ecosystem-group: 'all'
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "Codegen Check"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
paths:
9+
- 'scripts/codegen/**'
10+
- 'nodejs/src/generated/**'
11+
- 'dotnet/src/Generated/**'
12+
- 'python/copilot/generated/**'
13+
- 'go/generated_*.go'
14+
- 'go/rpc/**'
15+
- '.github/workflows/codegen-check.yml'
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
check:
23+
name: "Verify generated files are up-to-date"
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: 22
31+
32+
- uses: actions/setup-go@v5
33+
with:
34+
go-version: '1.22'
35+
36+
- name: Install nodejs SDK dependencies
37+
working-directory: ./nodejs
38+
run: npm ci
39+
40+
- name: Install codegen dependencies
41+
working-directory: ./scripts/codegen
42+
run: npm ci
43+
44+
- name: Run codegen
45+
working-directory: ./scripts/codegen
46+
run: npm run generate
47+
48+
- name: Check for uncommitted changes
49+
run: |
50+
if [ -n "$(git status --porcelain)" ]; then
51+
echo "::error::Generated files are out of date. Run 'cd scripts/codegen && npm run generate' and commit the changes."
52+
git diff --stat
53+
git diff
54+
exit 1
55+
fi
56+
echo "✅ Generated files are up-to-date"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
dotnet-version: "8.0.x"
4747
- uses: actions/setup-node@v6
4848
with:
49-
node-version: "24"
49+
node-version: "22"
5050
cache: "npm"
5151
cache-dependency-path: "./nodejs/package-lock.json"
5252

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
cache: "npm"
4949
cache-dependency-path: "./nodejs/package-lock.json"
50-
node-version: 24
50+
node-version: 22
5151
- name: Install dependencies
5252
run: npm ci --ignore-scripts
5353

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
fail-fast: false
3838
matrix:
3939
os: [ubuntu-latest, macos-latest, windows-latest]
40+
# Test the oldest supported Python version to make sure compatibility is maintained.
41+
python-version: ["3.11"]
4042
runs-on: ${{ matrix.os }}
4143
defaults:
4244
run:
@@ -46,10 +48,10 @@ jobs:
4648
- uses: actions/checkout@v6.0.2
4749
- uses: actions/setup-python@v6
4850
with:
49-
python-version: "3.12"
51+
python-version: ${{ matrix.python-version }}
5052
- uses: actions/setup-node@v6
5153
with:
52-
node-version: "24"
54+
node-version: "22"
5355
cache: "npm"
5456
cache-dependency-path: "./nodejs/package-lock.json"
5557

@@ -59,7 +61,7 @@ jobs:
5961
enable-cache: true
6062

6163
- name: Install Python dev dependencies
62-
run: uv sync --locked --all-extras --dev
64+
run: uv sync --all-extras --dev
6365

6466
- name: Install Node.js dependencies (for CLI in tests)
6567
working-directory: ./nodejs
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
name: "Scenario Build Verification"
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "test/scenarios/**"
7+
- "nodejs/src/**"
8+
- "python/copilot/**"
9+
- "go/**/*.go"
10+
- "dotnet/src/**"
11+
- ".github/workflows/scenario-builds.yml"
12+
push:
13+
branches:
14+
- main
15+
paths:
16+
- "test/scenarios/**"
17+
- ".github/workflows/scenario-builds.yml"
18+
workflow_dispatch:
19+
merge_group:
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
# ── TypeScript ──────────────────────────────────────────────────────
26+
build-typescript:
27+
name: "TypeScript scenarios"
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v6
31+
32+
- uses: actions/setup-node@v6
33+
with:
34+
node-version: 22
35+
36+
- uses: actions/cache@v4
37+
with:
38+
path: ~/.npm
39+
key: ${{ runner.os }}-npm-scenarios-${{ hashFiles('test/scenarios/**/package.json') }}
40+
restore-keys: |
41+
${{ runner.os }}-npm-scenarios-
42+
43+
# Build the SDK so local file: references resolve
44+
- name: Build SDK
45+
working-directory: nodejs
46+
run: npm ci --ignore-scripts
47+
48+
- name: Build all TypeScript scenarios
49+
run: |
50+
PASS=0; FAIL=0; FAILURES=""
51+
for dir in $(find test/scenarios -path '*/typescript/package.json' -exec dirname {} \; | sort); do
52+
scenario="${dir#test/scenarios/}"
53+
echo "::group::$scenario"
54+
if (cd "$dir" && npm install --ignore-scripts 2>&1); then
55+
echo "✅ $scenario"
56+
PASS=$((PASS + 1))
57+
else
58+
echo "❌ $scenario"
59+
FAIL=$((FAIL + 1))
60+
FAILURES="$FAILURES\n $scenario"
61+
fi
62+
echo "::endgroup::"
63+
done
64+
echo ""
65+
echo "TypeScript builds: $PASS passed, $FAIL failed"
66+
if [ "$FAIL" -gt 0 ]; then
67+
echo -e "Failures:$FAILURES"
68+
exit 1
69+
fi
70+
71+
# ── Python ──────────────────────────────────────────────────────────
72+
build-python:
73+
name: "Python scenarios"
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@v6
77+
78+
- uses: actions/setup-python@v6
79+
with:
80+
python-version: "3.12"
81+
82+
- name: Install Python SDK
83+
run: pip install -e python/
84+
85+
- name: Compile and import-check all Python scenarios
86+
run: |
87+
PASS=0; FAIL=0; FAILURES=""
88+
for main in $(find test/scenarios -path '*/python/main.py' | sort); do
89+
dir=$(dirname "$main")
90+
scenario="${dir#test/scenarios/}"
91+
echo "::group::$scenario"
92+
if python3 -m py_compile "$main" 2>&1 && python3 -c "import copilot" 2>&1; then
93+
echo "✅ $scenario"
94+
PASS=$((PASS + 1))
95+
else
96+
echo "❌ $scenario"
97+
FAIL=$((FAIL + 1))
98+
FAILURES="$FAILURES\n $scenario"
99+
fi
100+
echo "::endgroup::"
101+
done
102+
echo ""
103+
echo "Python builds: $PASS passed, $FAIL failed"
104+
if [ "$FAIL" -gt 0 ]; then
105+
echo -e "Failures:$FAILURES"
106+
exit 1
107+
fi
108+
109+
# ── Go ──────────────────────────────────────────────────────────────
110+
build-go:
111+
name: "Go scenarios"
112+
runs-on: ubuntu-latest
113+
steps:
114+
- uses: actions/checkout@v6
115+
116+
- uses: actions/setup-go@v6
117+
with:
118+
go-version: "1.24"
119+
cache: true
120+
cache-dependency-path: test/scenarios/**/go.sum
121+
122+
- name: Build all Go scenarios
123+
run: |
124+
PASS=0; FAIL=0; FAILURES=""
125+
for mod in $(find test/scenarios -path '*/go/go.mod' | sort); do
126+
dir=$(dirname "$mod")
127+
scenario="${dir#test/scenarios/}"
128+
echo "::group::$scenario"
129+
if (cd "$dir" && go build ./... 2>&1); then
130+
echo "✅ $scenario"
131+
PASS=$((PASS + 1))
132+
else
133+
echo "❌ $scenario"
134+
FAIL=$((FAIL + 1))
135+
FAILURES="$FAILURES\n $scenario"
136+
fi
137+
echo "::endgroup::"
138+
done
139+
echo ""
140+
echo "Go builds: $PASS passed, $FAIL failed"
141+
if [ "$FAIL" -gt 0 ]; then
142+
echo -e "Failures:$FAILURES"
143+
exit 1
144+
fi
145+
146+
# ── C# ─────────────────────────────────────────────────────────────
147+
build-csharp:
148+
name: "C# scenarios"
149+
runs-on: ubuntu-latest
150+
steps:
151+
- uses: actions/checkout@v6
152+
153+
- uses: actions/setup-dotnet@v5
154+
with:
155+
dotnet-version: "8.0.x"
156+
157+
- uses: actions/cache@v4
158+
with:
159+
path: ~/.nuget/packages
160+
key: ${{ runner.os }}-nuget-scenarios-${{ hashFiles('test/scenarios/**/*.csproj') }}
161+
restore-keys: |
162+
${{ runner.os }}-nuget-scenarios-
163+
164+
- name: Build all C# scenarios
165+
run: |
166+
PASS=0; FAIL=0; FAILURES=""
167+
for proj in $(find test/scenarios -name '*.csproj' | sort); do
168+
dir=$(dirname "$proj")
169+
scenario="${dir#test/scenarios/}"
170+
echo "::group::$scenario"
171+
if (cd "$dir" && dotnet build --nologo 2>&1); then
172+
echo "✅ $scenario"
173+
PASS=$((PASS + 1))
174+
else
175+
echo "❌ $scenario"
176+
FAIL=$((FAIL + 1))
177+
FAILURES="$FAILURES\n $scenario"
178+
fi
179+
echo "::endgroup::"
180+
done
181+
echo ""
182+
echo "C# builds: $PASS passed, $FAIL failed"
183+
if [ "$FAIL" -gt 0 ]; then
184+
echo -e "Failures:$FAILURES"
185+
exit 1
186+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11

22
# Documentation validation output
33
docs/.validation/
4+
.DS_Store

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ The GitHub Copilot SDK exposes the same engine behind Copilot CLI: a production-
1414

1515
## Available SDKs
1616

17-
| SDK | Location | Installation |
18-
| ------------------------ | ------------------------------------------------- | ----------------------------------------- |
19-
| **Node.js / TypeScript** | [`cookbook/nodejs/`](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/nodejs/README.md) | `npm install @github/copilot-sdk` |
20-
| **Python** | [`cookbook/python/`](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/python/README.md) | `pip install github-copilot-sdk` |
21-
| **Go** | [`cookbook/go/`](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/go/README.md) | `go get github.com/github/copilot-sdk/go` |
22-
| **.NET** | [`cookbook/dotnet/`](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/dotnet/README.md) | `dotnet add package GitHub.Copilot.SDK` |
17+
| SDK | Location | Cookbook | Installation |
18+
| ------------------------ | -------------- | ------------------------------------------------- | ----------------------------------------- |
19+
| **Node.js / TypeScript** | [`nodejs/`](./nodejs/) | [Cookbook](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/nodejs/README.md) | `npm install @github/copilot-sdk` |
20+
| **Python** | [`python/`](./python/) | [Cookbook](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/python/README.md) | `pip install github-copilot-sdk` |
21+
| **Go** | [`go/`](./go/) | [Cookbook](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/go/README.md) | `go get github.com/github/copilot-sdk/go` |
22+
| **.NET** | [`dotnet/`](./dotnet/) | [Cookbook](https://github.com/github/awesome-copilot/blob/main/cookbook/copilot-sdk/dotnet/README.md) | `dotnet add package GitHub.Copilot.SDK` |
2323

2424
See the individual SDK READMEs for installation, usage examples, and API reference.
2525

@@ -116,17 +116,17 @@ Please use the [GitHub Issues](https://github.com/github/copilot-sdk/issues) pag
116116

117117
⚠️ Disclaimer: These are unofficial, community-driven SDKs and they are not supported by GitHub. Use at your own risk.
118118

119-
| SDK | Location |
120-
| --------------| -------------------------------------------------- |
121-
| **Java** | [copilot-community-sdk/copilot-sdk-java][sdk-java] |
122-
| **Rust** | [copilot-community-sdk/copilot-sdk-rust][sdk-rust] |
123-
| **C++** | [0xeb/copilot-sdk-cpp][sdk-cpp] |
124-
| **Clojure** | [krukow/copilot-sdk-clojure][sdk-clojure] |
119+
| SDK | Location |
120+
| --------------| ----------------------------------------------------------------- |
121+
| **Java** | [copilot-community-sdk/copilot-sdk-java][sdk-java] |
122+
| **Rust** | [copilot-community-sdk/copilot-sdk-rust][sdk-rust] |
123+
| **Clojure** | [copilot-community-sdk/copilot-sdk-clojure][sdk-clojure] |
124+
| **C++** | [0xeb/copilot-sdk-cpp][sdk-cpp] |
125125

126126
[sdk-java]: https://github.com/copilot-community-sdk/copilot-sdk-java
127127
[sdk-rust]: https://github.com/copilot-community-sdk/copilot-sdk-rust
128128
[sdk-cpp]: https://github.com/0xeb/copilot-sdk-cpp
129-
[sdk-clojure]: https://github.com/krukow/copilot-sdk-clojure
129+
[sdk-clojure]: https://github.com/copilot-community-sdk/copilot-sdk-clojure
130130

131131
## Contributing
132132

0 commit comments

Comments
 (0)