Add classical code generation workflow for Java SDK#70
Draft
Conversation
1 task
- Add scripts/codegen/java.ts - Java code generator from session-events and api schemas - Add scripts/codegen/package.json with @github/copilot dependency - Add scripts/codegen/package-lock.json - Generate src/generated/java/com/github/copilot/sdk/generated/ - 76 session event files - Generate src/generated/java/com/github/copilot/sdk/generated/rpc/ - 111 RPC type files - Update pom.xml: add build-helper-maven-plugin, exclude generated from Spotless - Update config/checkstyle/checkstyle.xml: exclude generated packages - Update .gitattributes: mark src/generated/java/** as generated - Add .github/workflows/codegen-check.yml - CI check workflow - Add .github/workflows/update-copilot-dependency.yml - update workflow - Update docs/WORKFLOWS.md with new workflow documentation - Update .gitignore to exclude scripts/codegen/node_modules/" Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/aee4deda-40d4-4ecd-a831-2af9cb9461e7 Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add classical code generation to workflow
Add classical code generation workflow for Java SDK
Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the classical code-gen pipeline for the Java SDK, analogous to the dotnet/nodejs/python generators in
copilot-sdk/scripts/codegen/. Consumessession-events.schema.jsonandapi.schema.jsonfrom the@github/copilotnpm package to generate typed Java source files.Before the change?
After the change?
Codegen script (
scripts/codegen/java.ts)session-events.schema.json→ generatescom.github.copilot.sdk.generated(76 files):SessionEventbase with full@JsonTypeInfo/@JsonSubTypespolymorphism, one typed event class per variant,UnknownSessionEventfallbackapi.schema.json→ generatescom.github.copilot.sdk.generated.rpc(111 files): params/result DTOs for all 61 RPC methods// AUTO-GENERATED FILE - DO NOT EDIT, schema-source comment, and@javax.annotation.processing.Generated("copilot-sdk-codegen")Maven (
pom.xml)build-helper-maven-pluginaddssrc/generated/javaas a source rootsrc/generated/java/**Infrastructure
config/checkstyle/checkstyle.xml— excludesgeneratedandrpcpackages from Javadoc enforcement.gitattributes—src/generated/java/** eol=lf linguist-generated=true.github/workflows/codegen-check.yml— installs deps, re-runsnpm run generate, fails on any diff (runs onpush/pull_requestpaths that touch codegen or generated files).github/workflows/update-copilot-dependency.yml—workflow_dispatchwithversioninput; updates@github/copilotinscripts/codegen, regenerates, opens a PR automaticallyPull request checklist
mvn spotless:applyhas been run to format the codemvn clean verifypasses locallyDoes this introduce a breaking change?