Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bb8bbe3
On branch edburns/80-java-monorepo-add-01 Commence work on https://gi…
edburns May 13, 2026
f88c345
refine to get ready for plan review
edburns May 13, 2026
6787399
On branch edburns/80-java-monorepo-add-01 Put the plan first.
edburns May 13, 2026
baae90b
On branch edburns/80-java-monorepo-add-01 https://github.com/github/c…
edburns May 13, 2026
a057b12
test: verify gpg signing
edburns May 13, 2026
745699a
On branch edburns/80-java-monorepo-add-01
edburns May 13, 2026
49dd28e
Per https://github.com/github/copilot-sdk-partners/issues/89 no per-l…
edburns May 14, 2026
3293445
Update progress
edburns May 14, 2026
9212a54
Define gh-pages as WONTFIX
edburns May 15, 2026
5d854c0
Branch protection
edburns May 15, 2026
e4116e0
new prompts
edburns May 15, 2026
3b51fb9
Sync regexp changes
edburns May 15, 2026
8b51fc6
ghcp-sp-95-branch-protection
edburns May 15, 2026
5081b6f
ghcp-sp-95-branch-protection
edburns May 15, 2026
542769e
Complete phase 0
edburns May 15, 2026
a3bc7c4
Start on dd-2998002
edburns May 15, 2026
c7bfea6
Phase 1: .githooks and instructions
edburns May 18, 2026
4556704
test: verify gpg signing
edburns May 13, 2026
4de2e56
Fixes https://github.com/github/copilot-sdk-partners/issues/95
edburns May 18, 2026
9c220c8
Branch protuction.
edburns May 18, 2026
63d9430
Mark more completed
edburns May 18, 2026
56d5cdb
Phase 1 plan
edburns May 18, 2026
417075f
Copy Java SDK source files into java/ directory
edburns May 18, 2026
8fbfa01
Update pom.xml to use local test harness instead of git clone
edburns May 18, 2026
aa013cc
Document need to restore the POM property updating
edburns May 19, 2026
908829c
Document copilot --yolo progress
edburns May 19, 2026
e353c87
Ignore log files
edburns May 19, 2026
57c85b3
Copy over https://github.com/github/copilot-sdk-java/pull/216
edburns May 19, 2026
db1892e
Restore antrun git-clone mechanism and add missing codegen files
edburns May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
29 changes: 29 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
#
# Pre-commit hook that runs Spotless check on the Java SDK when Java source
# files are staged. Only triggers if changes exist under java/src/.
#
# To install this hook, run from the repository root:
# git config core.hooksPath .githooks
#

# Only run Spotless if staged changes include Java source files under java/src/
if ! git diff --cached --name-only | grep -q '^java/src/'; then
exit 0
fi

echo "Running Spotless check on java/ ..."

# Run spotless check from the java directory
(cd java && mvn spotless:check -q)

if [ $? -ne 0 ]; then
echo ""
echo "❌ Spotless check failed!"
echo " Run 'cd java && mvn spotless:apply' to fix formatting issues."
echo ""
exit 1
fi

echo "✓ Spotless check passed"
exit 0
19 changes: 12 additions & 7 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

## Big picture 🔧

- The repo implements language SDKs (Node/TS, Python, Go, .NET) that speak to the **Copilot CLI** via **JSON‑RPC** (see `README.md` and `nodejs/src/client.ts`).
- Typical flow: your App → SDK client → JSON-RPC → Copilot CLI (server mode). The CLI must be installed or you can connect to an external CLI server via the `CLI URL option (language-specific casing)` (Node: `cliUrl`, Go: `CLIUrl`, .NET: `CliUrl`, Python: `cli_url`).
- The repo implements language SDKs (Node/TS, Python, Go, .NET, Java) that speak to the **Copilot CLI** via **JSON‑RPC** (see `README.md` and `nodejs/src/client.ts`).
- Typical flow: your App → SDK client → JSON-RPC → Copilot CLI (server mode). The CLI must be installed or you can connect to an external CLI server via the `CLI URL option (language-specific casing)` (Node: `cliUrl`, Go: `CLIUrl`, .NET: `CliUrl`, Python: `cli_url`, Java: `cliUrl`).

## Most important files to read first 📚

- Top-level: `README.md` (architecture + quick start)
- Language entry points: `nodejs/src/client.ts`, `python/README.md`, `go/README.md`, `dotnet/README.md`
- Java: `java/README.md`, `java/pom.xml`
- Test harness & E2E: `test/harness/*`, Python harness wrapper `python/e2e/testharness/proxy.py`
- Schemas & type generation: `nodejs/scripts/generate-session-types.ts`
- Session snapshots used by E2E: `test/snapshots/` (used by the replay proxy)
Expand All @@ -26,12 +27,15 @@
- Go: `cd go && go test ./...`
- .NET: `cd dotnet && dotnet test test/GitHub.Copilot.SDK.Test.csproj`
- **.NET testing note:** Never add `InternalsVisibleTo` to any project file when writing tests. Tests must only access public APIs.
- Java: `cd java && mvn clean verify` (full build + tests), `mvn spotless:apply` (format code before commit)
- **Java testing note:** Always use `mvn verify` without `-q` and without piping through `grep`. Never add `InternalsVisibleTo` equivalent — tests must only access public APIs.

## Testing & E2E tips ⚙️

- E2E runs against a local **replaying CAPI proxy** (see `test/harness/server.ts`). Most language E2E harnesses spawn that server automatically (see `python/e2e/testharness/proxy.py`).
- Tests rely on YAML snapshot exchanges under `test/snapshots/` — to add test scenarios, add or edit the appropriate YAML files and update tests.
- The harness prints `Listening: http://...` — tests parse this URL to configure CLI or proxy.
- Java E2E tests use `E2ETestContext` which manages a `CapiProxy` (Node.js replaying proxy). The harness is cloned during Maven's `generate-test-resources` phase to `java/target/copilot-sdk/`.

## Project-specific conventions & patterns ✅

Expand All @@ -42,13 +46,14 @@

## Integration & environment notes ⚠️

- The SDK requires a Copilot CLI installation or an external server reachable via the `CLI URL option (language-specific casing)` (Node: `cliUrl`, Go: `CLIUrl`, .NET: `CliUrl`, Python: `cli_url`) or `COPILOT_CLI_PATH`.
- The SDK requires a Copilot CLI installation or an external server reachable via the `CLI URL option (language-specific casing)` (Node: `cliUrl`, Go: `CLIUrl`, .NET: `CliUrl`, Python: `cli_url`, Java: `cliUrl`) or `COPILOT_CLI_PATH`.
- Some scripts (typegen, formatting) call external tools: `gofmt`, `dotnet format`, `tsx` (available via npm), `quicktype`/`quicktype-core` (used by the Node typegen script), and `prettier` (provided as an npm devDependency). Most of these are available through the repo's package scripts or devDependencies—run `just install` (and `cd nodejs && npm ci`) to install them. Ensure the required tools are available in CI / developer machines.
- Tests may assume `node >= 18`, `python >= 3.9`, platform differences handled (Windows uses `shell=True` for npx in harness).
- Java requires JDK 17+ and Maven 3.9+. Java E2E tests also require Node.js (for the replay proxy).

## Where to add new code or tests 🧭

- SDK code: `nodejs/src`, `python/copilot`, `go`, `dotnet/src`, `rust/src`
- Unit tests: `nodejs/test`, `python/*`, `go/*`, `dotnet/test`, `rust/tests`
- E2E tests: `*/e2e/` folders that use the shared replay proxy and `test/snapshots/`
- 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.
- SDK code: `nodejs/src`, `python/copilot`, `go`, `dotnet/src`, `rust/src`, `java/src/main/java`
- Unit tests: `nodejs/test`, `python/*`, `go/*`, `dotnet/test`, `rust/tests`, `java/src/test/java`
- E2E tests: `*/e2e/` folders that use the shared replay proxy and `test/snapshots/`, `java/src/test/java/**/e2e/`
- 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`
Loading
Loading