diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f60625ec1..5135e596d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,63 +33,26 @@ We are generally **not** looking for: - Additional documentation - **SDKs for other languages** — if you want to create a Copilot SDK for another language, we'd love to hear from you and may offer to link to your SDK from our repo. However we do not plan to add further language-specific SDKs to this repo in the short term, since we need to retain our maintenance capacity for moving forwards quickly with the existing language set. For other languages, please consider running your own external project. -## Prerequisites for Running and Testing Code +## Developing an SDK -This is a multi-language SDK repository. Install the tools for the SDK(s) you plan to work on: +Setup, build, and test instructions are maintained with each SDK: -### All SDKs - -1. The end-to-end tests across all languages use a shared test harness written in Node.js. Before running tests in any language, `cd test/harness && npm ci`. - -### Node.js/TypeScript SDK - -1. Install [Node.js](https://nodejs.org/) (v18+) -1. Install dependencies: `cd nodejs && npm ci` - -### Python SDK - -1. Install [Python 3.8+](https://www.python.org/downloads/) -1. Install [uv](https://github.com/astral-sh/uv) -1. Install dependencies: `cd python && uv pip install -e . --group dev` - -### Go SDK - -1. Install [Go 1.24+](https://go.dev/doc/install) -1. Install [golangci-lint](https://golangci-lint.run/welcome/install/#local-installation) -1. Install dependencies: `cd go && go mod download` - -### .NET SDK - -1. Install [.NET SDK 10+](https://dotnet.microsoft.com/download) -1. Install .NET dependencies: `cd dotnet && dotnet restore` +- [Node.js/TypeScript](nodejs/README.md#development) +- [Python](python/README.md#development) +- [Go](go/README.md#development) +- [.NET](dotnet/README.md#development) +- [Rust](rust/README.md#development) +- [Java](java/README.md#development-setup) ## Submitting a Pull Request 1. Fork and clone the repository -1. Install dependencies for the SDK(s) you're modifying (see above) -1. Make sure the tests pass on your machine (see commands below) -1. Make sure linter passes on your machine (see commands below) +1. Follow the development instructions for the SDK(s) you're modifying 1. Create a new branch: `git checkout -b my-branch-name` -1. Make your change, add tests, and make sure the tests and linter still pass +1. Make your change, add tests, and run the documented checks 1. Push to your fork and [submit a pull request][pr] 1. Pat yourself on the back and wait for your pull request to be reviewed and merged. -### Running Tests and Linters - -```bash -# Node.js -cd nodejs && npm test && npm run lint - -# Python -cd python && uv run pytest && uv run ruff check . - -# Go -cd go && go test ./... && golangci-lint run ./... - -# .NET -cd dotnet && dotnet test test/GitHub.Copilot.SDK.Test.csproj -``` - Here are a few things you can do that will increase the likelihood of your pull request being accepted: - Write tests. diff --git a/dotnet/README.md b/dotnet/README.md index 8f987893f..6efd6e094 100644 --- a/dotnet/README.md +++ b/dotnet/README.md @@ -1038,6 +1038,25 @@ catch (Exception ex) } ``` +## Development + +Development requires [.NET SDK 10+](https://dotnet.microsoft.com/download) and a supported [Node.js version](../nodejs/README.md#prerequisites). From the repository root: + +```bash +cd nodejs +npm ci +``` + +```bash +cd test/harness +npm ci +``` + +```bash +cd dotnet +dotnet test +``` + ## License MIT diff --git a/go/README.md b/go/README.md index 16053c1ab..d8588699c 100644 --- a/go/README.md +++ b/go/README.md @@ -978,6 +978,25 @@ Communicates with CLI via TCP socket. Useful for distributed scenarios. - `COPILOT_CLI_PATH` - Path to the Copilot CLI executable +## Development + +Tests require a supported [Node.js version](../nodejs/README.md#prerequisites). From the repository root: + +```bash +cd nodejs +npm ci +``` + +```bash +cd test/harness +npm ci +``` + +```bash +cd go +./test.sh +``` + ## License MIT diff --git a/java/README.md b/java/README.md index b772a2ce8..87a0ef7c5 100644 --- a/java/README.md +++ b/java/README.md @@ -422,7 +422,7 @@ The gate also applies to individual methods annotated with `@CopilotExperimental ### Development Setup -Requires JDK 25 or later for development. The following steps validate the artifact built with JDK 25 runs on both 25 and 17, preserving the MR-JAR behavior. +Requires JDK 25 or later and a supported [Node.js version](../nodejs/README.md#prerequisites) for development. The following steps validate the artifact built with JDK 25 runs on both 25 and 17, preserving the MR-JAR behavior. ```bash # Clone the repository diff --git a/nodejs/README.md b/nodejs/README.md index 20886e79a..eec674ce4 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -1109,6 +1109,21 @@ try { } ``` +## Development + +From the repository root: + +```bash +cd test/harness +npm ci +``` + +```bash +cd nodejs +npm ci +npm test +``` + ## License MIT diff --git a/python/README.md b/python/README.md index e540f9689..10630fb84 100644 --- a/python/README.md +++ b/python/README.md @@ -1142,3 +1142,23 @@ When `on_elicitation_request` is provided, the SDK automatically: - Reports the `elicitation` capability on the session - Dispatches `elicitation.requested` events to your handler - Auto-cancels if your handler throws an error (so the server doesn't hang) + +## Development + +Install [uv](https://docs.astral.sh/uv/) and a supported [Node.js version](../nodejs/README.md#prerequisites), then from the repository root: + +```bash +cd nodejs +npm ci +``` + +```bash +cd test/harness +npm ci +``` + +```bash +cd python +uv sync +uv run pytest +``` diff --git a/rust/README.md b/rust/README.md index 705166cdd..0bdaa400c 100644 --- a/rust/README.md +++ b/rust/README.md @@ -965,3 +965,22 @@ github-copilot-sdk = { version = "0.1", default-features = false } # Derive JSON Schema for tool parameters (adds to default bundled-cli). github-copilot-sdk = { version = "0.1", features = ["derive"] } ``` + +## Development + +Tests require a supported [Node.js version](../nodejs/README.md#prerequisites). From the repository root: + +```bash +cd nodejs +npm ci +``` + +```bash +cd test/harness +npm ci +``` + +```bash +cd rust +cargo test --features test-support +```