Skip to content

Commit 63dc674

Browse files
authored
Merge branch 'main' into sunbrye/change-model-to-auto
2 parents 3c194a1 + 2fd2f99 commit 63dc674

571 files changed

Lines changed: 56888 additions & 5898 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/badges/jacoco-generated.svg

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/badges/jacoco-handwritten.svg

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/instructions/docs-style.instructions.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,67 @@ Body text here.
160160

161161
* [Link text](./relative-path.md): short description
162162
```
163+
164+
## Multi-language code examples
165+
166+
When showing the same concept in multiple programming languages, use consecutive `<details>` blocks. The docs-internal normalization pipeline converts these into tabbed language switchers on docs.github.com.
167+
168+
### Rules
169+
170+
* **Only code inside `<details>` blocks.** Shared prose, headings, and explanations must go outside the blocks. Each block should contain only a code fence (and optionally a `<!-- docs-validate: skip -->` comment).
171+
* **Blocks must be consecutive.** No content (headings, paragraphs) between `<details>` blocks in the same group. Blank lines between blocks are fine.
172+
* **Use the exact `<summary>` format:** `<summary><strong>LANGUAGE</strong></summary>`. Supported labels: `.NET`, `Python`, `TypeScript`, `Go`, `Java`, `Rust`, `Node.js`, `Shell`.
173+
* **Need 2+ blocks to form a group.** A single `<details>` block won't be converted and renders as raw HTML on docs.github.com.
174+
* **Equal content across tabs.** Each tab should show the same concept in a different language. Language-specific extras should be a separate section outside the tabs.
175+
176+
### Correct
177+
178+
Shared prose goes above the group, then each `<details>` block contains only code:
179+
180+
```markdown
181+
Install the SDK:
182+
183+
<details open>
184+
<summary><strong>.NET</strong></summary>
185+
186+
<!-- docs-validate: skip -->
187+
188+
```bash
189+
dotnet add package GitHub.Copilot.SDK
190+
```
191+
192+
</details>
193+
<details>
194+
<summary><strong>Python</strong></summary>
195+
196+
<!-- docs-validate: skip -->
197+
198+
```bash
199+
pip install github-copilot-sdk
200+
```
201+
202+
</details>
203+
```
204+
205+
### Incorrect
206+
207+
Do not put headings, prose, or multiple sections inside a `<details>` block:
208+
209+
```markdown
210+
<details>
211+
<summary><strong>Python</strong></summary>
212+
213+
### Prerequisites ← breaks TOC/anchors
214+
Install the packages: ← prose belongs outside
215+
216+
```bash
217+
pip install github-copilot-sdk
218+
```
219+
220+
### Basic usage ← multiple sections in one tab
221+
```python
222+
[code]
223+
```
224+
225+
</details>
226+
```

.github/scripts/generate-java-coverage-badge.sh

Lines changed: 0 additions & 104 deletions
This file was deleted.

.github/workflows/block-remove-before-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
jobs:
1212
check-paths:
1313
name: "No remove-before-merge directories"
14-
if: github.event_name == 'pull_request'
14+
if: github.event_name == 'pull_request' && github.base_ref == 'main'
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Check for remove-before-merge paths in PR

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,19 @@ permissions:
2828

2929
jobs:
3030
test:
31-
name: ".NET SDK Tests"
31+
name: ".NET SDK Tests (${{ matrix.os }}, ${{ matrix.transport }})"
3232
if: github.event.repository.fork == false
3333
env:
3434
POWERSHELL_UPDATECHECK: Off
3535
strategy:
3636
fail-fast: false
3737
matrix:
3838
os: [ubuntu-latest, macos-latest, windows-latest]
39+
transport: ["default", "inprocess"]
40+
# TODO: Re-enable after fixing in-process sqlite file locking on shutdown on Windows
41+
exclude:
42+
- os: windows-latest
43+
transport: "inprocess"
3944
runs-on: ${{ matrix.os }}
4045
defaults:
4146
run:
@@ -80,6 +85,10 @@ jobs:
8085
if: runner.os == 'Windows'
8186
run: pwsh.exe -Command "Write-Host 'PowerShell ready'"
8287

88+
- name: Select inprocess transport
89+
if: matrix.transport == 'inprocess'
90+
run: echo "COPILOT_SDK_DEFAULT_CONNECTION=inprocess" >> "$GITHUB_ENV"
91+
8392
- name: Run .NET SDK tests
8493
env:
8594
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}

.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/java-sdk-tests.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ on:
3131
merge_group:
3232

3333
permissions:
34-
contents: write
35-
checks: write
36-
pull-requests: write
34+
contents: read
3735

3836
jobs:
3937
java-sdk:
@@ -77,12 +75,19 @@ jobs:
7775
- name: Run spotless check
7876
if: matrix.test-jdk == '25'
7977
run: |
80-
mvn spotless:check
81-
if [ $? -ne 0 ]; then
82-
echo "❌ spotless:check failed. Please run 'mvn spotless:apply' in java"
83-
exit 1
84-
fi
85-
echo "✅ spotless:check passed"
78+
max_attempts=3
79+
for ((attempt=1; attempt<=max_attempts; attempt++)); do
80+
if mvn spotless:check; then
81+
echo "✅ spotless:check passed"
82+
exit 0
83+
fi
84+
if [ "$attempt" -lt "$max_attempts" ]; then
85+
echo "⚠️ spotless:check failed (attempt $attempt/$max_attempts), retrying in 10s..."
86+
sleep 10
87+
fi
88+
done
89+
echo "❌ spotless:check failed after $max_attempts attempts. Please run 'mvn spotless:apply' in java/"
90+
exit 1
8691
8792
- name: Run Java SDK tests (JDK 25)
8893
if: matrix.test-jdk == '25'
@@ -117,22 +122,6 @@ jobs:
117122
java/target/surefire-reports-isolated/
118123
retention-days: 1
119124

120-
- name: Generate JaCoCo badge
121-
if: success() && github.ref == 'refs/heads/main' && matrix.test-jdk == '25'
122-
working-directory: .
123-
run: bash .github/scripts/generate-java-coverage-badge.sh java/target/site/jacoco-coverage/jacoco.csv .github/badges
124-
125-
- name: Create PR for JaCoCo badge update
126-
if: success() && github.ref == 'refs/heads/main' && matrix.test-jdk == '25'
127-
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v7
128-
with:
129-
commit-message: "Update Java JaCoCo coverage badge"
130-
title: "Update Java JaCoCo coverage badge"
131-
body: "Automated Java JaCoCo coverage badge update from CI."
132-
branch: auto/update-java-jacoco-badge
133-
add-paths: .github/badges/
134-
delete-branch: true
135-
136125
- name: Generate Test Report Summary
137126
if: always()
138127
uses: ./.github/actions/java-test-report

.github/workflows/publish.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,28 @@ jobs:
229229
with:
230230
packages-dir: python/dist/
231231

232+
publish-java:
233+
name: Publish Java SDK
234+
if: github.event.inputs.dist-tag != 'unstable' && github.ref == 'refs/heads/main'
235+
needs: version
236+
uses: ./.github/workflows/java-publish-maven.yml
237+
with:
238+
releaseVersion: ${{ needs.version.outputs.version }}
239+
prerelease: ${{ github.event.inputs.dist-tag == 'prerelease' }}
240+
secrets: inherit
241+
232242
github-release:
233243
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'
244+
needs: [version, publish-nodejs, publish-dotnet, publish-python, publish-rust, publish-java]
245+
if: |
246+
always() &&
247+
github.ref == 'refs/heads/main' &&
248+
github.event.inputs.dist-tag != 'unstable' &&
249+
needs.version.result == 'success' &&
250+
needs.publish-nodejs.result == 'success' &&
251+
needs.publish-dotnet.result == 'success' &&
252+
needs.publish-python.result == 'success' &&
253+
needs.publish-rust.result == 'success'
236254
runs-on: ubuntu-latest
237255
steps:
238256
- uses: actions/checkout@v6.0.2

0 commit comments

Comments
 (0)