Skip to content

Commit 4492a60

Browse files
Copilotedburns
andcommitted
[Java] Task 4.1: Convert single-module java/ into multi-module Maven reactor (#2170)
* Initial plan * Restructure java/ into multi-module Maven reactor (task 4.1) Co-authored-by: edburns <75821+edburns@users.noreply.github.com> * Add java/sdk/target to .gitignore and remove accidentally committed build artifacts Co-authored-by: edburns <75821+edburns@users.noreply.github.com> * Regenerate agentic workflow lock files with gh aw compile Co-authored-by: edburns <75821+edburns@users.noreply.github.com> * Regenerate agentic workflow lock files with gh aw v0.83.1 Co-authored-by: edburns <75821+edburns@users.noreply.github.com> * Regenerate lock files with gh aw v0.83.1 with proper SHA pinning Co-authored-by: edburns <75821+edburns@users.noreply.github.com> * fix: add setup-cli@v0.83.1 SHA to actions-lock.json and recompile lock files Co-authored-by: edburns <75821+edburns@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
1 parent 3afb526 commit 4492a60

1,568 files changed

Lines changed: 903 additions & 794 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/actions/java-test-report/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ inputs:
44
report-path:
55
description: "Path to the test report XML files (glob pattern)"
66
required: false
7-
default: "java/target/{surefire-reports*,failsafe-reports}/TEST-*.xml"
7+
default: "java/sdk/target/{surefire-reports*,failsafe-reports}/TEST-*.xml"
88
jacoco-path:
99
description: "Path to the JaCoCo XML report"
1010
required: false
11-
default: "java/target/site/jacoco-coverage/jacoco.xml"
11+
default: "java/sdk/target/site/jacoco-coverage/jacoco.xml"
1212
jacoco-csv-path:
1313
description: "Path to the JaCoCo CSV report"
1414
required: false
15-
default: "java/target/site/jacoco-coverage/jacoco.csv"
15+
default: "java/sdk/target/site/jacoco-coverage/jacoco.csv"
1616
check-name:
1717
description: "Name for the check run"
1818
required: false

.github/aw/actions-lock.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"version": "v7.0.1",
2121
"sha": "043fb46d1a93c77aae656e7c1c64a875d1fc6a0a"
2222
},
23-
"github/gh-aw-actions/setup-cli@v0.83.1": {
24-
"repo": "github/gh-aw-actions/setup-cli",
23+
"github/gh-aw-actions/setup@v0.83.1": {
24+
"repo": "github/gh-aw-actions/setup",
2525
"version": "v0.83.1",
2626
"sha": "8bdba8075360648fe6802302a5b4e016361dc6ac"
2727
},
28-
"github/gh-aw-actions/setup@v0.83.1": {
29-
"repo": "github/gh-aw-actions/setup",
28+
"github/gh-aw-actions/setup-cli@v0.83.1": {
29+
"repo": "github/gh-aw-actions/setup-cli",
3030
"version": "v0.83.1",
3131
"sha": "8bdba8075360648fe6802302a5b4e016361dc6ac"
3232
}

.github/copilot-instructions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
- Top-level: `README.md` (architecture + quick start)
1313
- Language entry points: `nodejs/src/client.ts`, `python/README.md`, `go/README.md`, `dotnet/README.md`
14-
- Java: `java/README.md`, `java/pom.xml`
14+
- Java: `java/sdk/README.md`, `java/pom.xml`, `java/sdk/pom.xml`
1515
- Test harness & E2E: `test/harness/*`, Python harness wrapper `python/e2e/testharness/proxy.py`
1616
- Schemas & type generation: `nodejs/scripts/generate-session-types.ts`
1717
- Session snapshots used by E2E: `test/snapshots/` (used by the replay proxy)
@@ -61,13 +61,13 @@
6161

6262
## Where to add new code or tests 🧭
6363

64-
- SDK code: `nodejs/src`, `python/copilot`, `go`, `dotnet/src`, `rust/src`, `java/src/main/java`
65-
- Unit tests: `nodejs/test`, `python/*`, `go/*`, `dotnet/test`, `rust/tests`, `java/src/test/java`
66-
- E2E tests: `*/e2e/` folders that use the shared replay proxy and `test/snapshots/`, `java/src/test/java/**/e2e/`
67-
- Generated types: update schema in `@github/copilot` then run `cd nodejs && npm run generate:session-types` and commit generated files in `src/generated` or language generated location. Java generated types: `java/src/generated/java`
64+
- SDK code: `nodejs/src`, `python/copilot`, `go`, `dotnet/src`, `rust/src`, `java/sdk/src/main/java`
65+
- Unit tests: `nodejs/test`, `python/*`, `go/*`, `dotnet/test`, `rust/tests`, `java/sdk/src/test/java`
66+
- E2E tests: `*/e2e/` folders that use the shared replay proxy and `test/snapshots/`, `java/sdk/src/test/java/**/e2e/`
67+
- Generated types: update schema in `@github/copilot` then run `cd nodejs && npm run generate:session-types` and commit generated files in `src/generated` or language generated location. Java generated types: `java/sdk/src/generated/java`
6868

6969
## Boundaries — files you must NOT hand-edit ⛔
7070

71-
- `java/src/generated/java/` — auto-generated by `scripts/codegen/java.ts`; regenerate with `cd java && mvn generate-sources -Pcodegen`.
71+
- `java/sdk/src/generated/java/` — auto-generated by `scripts/codegen/java.ts`; regenerate with `cd java/sdk && mvn generate-sources -Pcodegen`.
7272
- `nodejs/src/generated/` — auto-generated by `npm run generate:session-types`.
7373
- `test/snapshots/` — authoritative test fixtures; add/edit YAML here to change E2E behavior, but don't delete without understanding downstream impact.

.github/skills/new-java-e2e-test-yaml-and-test/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ conversations:
5454

5555
### Step 3: Create the Java IT test class
5656

57-
Place it in `java/src/test/java/com/github/copilot/` with an `IT` suffix
57+
Place it in `java/sdk/src/test/java/com/github/copilot/` with an `IT` suffix
5858
(e.g., `MyFeatureIT.java`). The failsafe plugin picks up `*IT.java` files.
5959

6060
**Template:**
@@ -141,12 +141,12 @@ mvn clean verify
141141

142142
| What | Where |
143143
|------|-------|
144-
| Test context (manages proxy, workDir, CLI) | `java/src/test/java/com/github/copilot/E2ETestContext.java` |
145-
| Java proxy wrapper | `java/src/test/java/com/github/copilot/CapiProxy.java` |
144+
| Test context (manages proxy, workDir, CLI) | `java/sdk/src/test/java/com/github/copilot/E2ETestContext.java` |
145+
| Java proxy wrapper | `java/sdk/src/test/java/com/github/copilot/CapiProxy.java` |
146146
| Replay proxy (TypeScript) | `test/harness/replayingCapiProxy.ts` |
147147
| Proxy server entry point | `test/harness/server.ts` |
148148
| Snapshot files | `test/snapshots/<category>/<name>.yaml` |
149-
| Existing IT tests for reference | `java/src/test/java/com/github/copilot/*IT.java` |
149+
| Existing IT tests for reference | `java/sdk/src/test/java/com/github/copilot/*IT.java` |
150150

151151
## How the Proxy Matches Requests
152152

.github/workflows/codegen-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
- 'go/rpc/**'
1616
- 'rust/src/generated/**'
1717
- 'sdk-protocol-version.json'
18-
- 'java/src/main/java/com/github/copilot/SdkProtocolVersion.java'
18+
- 'java/sdk/src/main/java/com/github/copilot/SdkProtocolVersion.java'
1919
- '.github/workflows/codegen-check.yml'
2020
workflow_dispatch:
2121

@@ -84,7 +84,7 @@ jobs:
8484
- name: Verify Java protocol version matches
8585
run: |
8686
EXPECTED=$(jq -r '.version' sdk-protocol-version.json)
87-
ACTUAL=$(grep -oP 'LATEST\(\K[0-9]+' java/src/main/java/com/github/copilot/SdkProtocolVersion.java)
87+
ACTUAL=$(grep -oP 'LATEST\(\K[0-9]+' java/sdk/src/main/java/com/github/copilot/SdkProtocolVersion.java)
8888
if [ "$EXPECTED" != "$ACTUAL" ]; then
8989
echo "::error::Java SDK protocol version ($ACTUAL) does not match sdk-protocol-version.json ($EXPECTED). Java manages its own SdkProtocolVersion.java via java/scripts/codegen/. Update it to match."
9090
exit 1

.github/workflows/docs-validation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ on:
99
- 'python/copilot/**'
1010
- 'go/**/*.go'
1111
- 'dotnet/src/**'
12-
- 'java/src/**'
12+
- 'java/sdk/src/**'
1313
- 'java/pom.xml'
14+
- 'java/sdk/pom.xml'
1415
- 'scripts/docs-validation/**'
1516
- '.github/workflows/docs-validation.yml'
1617
workflow_dispatch:

.github/workflows/java-adapt-handwritten-code-to-accept-upgrade-changes.lock.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/java-adapt-handwritten-code-to-accept-upgrade-changes.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ You are an automation agent that fixes handwritten Java SDK source and test code
5151

5252
- The branch `${{ inputs.branch }}` already has:
5353
- Updated `java/scripts/codegen/package.json` with the new version
54-
- Regenerated `java/src/generated/java/` code that compiles successfully
54+
- Regenerated `java/sdk/src/generated/java/` code that compiles successfully
5555
- Updated the Java POM CLI/version pin property
5656
- Your job is ONLY to fix **handwritten** code, NOT generated code.
5757

5858
## Boundaries
5959

60-
- ❌ Do NOT edit anything under `java/src/generated/java/`
60+
- ❌ Do NOT edit anything under `java/sdk/src/generated/java/`
6161
- ❌ Do NOT edit `java/scripts/codegen/java.ts`
62-
- ❌ Do NOT create or modify tests in the `com.github.copilot.generated` test package (`java/src/test/java/com/github/copilot/sdk/generated/`)
63-
- ✅ DO edit `java/src/main/java/com/github/copilot/sdk/**`
64-
- ✅ DO edit `java/src/test/java/com/github/copilot/sdk/**` (excluding the `generated` subpackage)
62+
- ❌ Do NOT create or modify tests in the `com.github.copilot.generated` test package (`java/sdk/src/test/java/com/github/copilot/sdk/generated/`)
63+
- ✅ DO edit `java/sdk/src/main/java/com/github/copilot/sdk/**`
64+
- ✅ DO edit `java/sdk/src/test/java/com/github/copilot/sdk/**` (excluding the `generated` subpackage)
6565
- ✅ DO add new test methods or test classes if new user-facing API surface is introduced
6666

6767
## Instructions
@@ -146,7 +146,7 @@ mvn verify -Dskip.test.harness=true
146146
If this passes, commit and push:
147147

148148
```bash
149-
git add java/src/main/java java/src/test/java
149+
git add java/sdk/src/main/java java/sdk/src/test/java
150150
git commit -m "Fix handwritten Java code for @github/copilot schema changes
151151
152152
Adapt constructor calls, enum references, and test assertions to match

.github/workflows/java-codegen-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
- main
77
paths:
88
- 'java/scripts/codegen/**'
9-
- 'java/src/generated/**'
9+
- 'java/sdk/src/generated/**'
1010
- '.github/workflows/java-codegen-check.yml'
1111
pull_request:
1212
paths:
1313
- 'java/scripts/codegen/**'
14-
- 'java/src/generated/**'
14+
- 'java/sdk/src/generated/**'
1515
- '.github/workflows/java-codegen-check.yml'
1616
workflow_dispatch:
1717

.github/workflows/java-codegen-fix.lock.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)