Java SDK: sync reference implementation to ^1.0.52-1, add preMcpToolCall hook, fix PingResponse timestamp type#1388
Closed
edburns wants to merge 4 commits into
Closed
Conversation
Implement Phase 03 of the Java-to-monorepo migration plan, adapting the Java SDK's publishing and testing automation for the monorepo structure. Changes: - java-publish-maven.yml: add working-directory, use java/v tag prefix, scope secrets to Java - java-publish-snapshot.yml: add working-directory for monorepo - java-smoke-test.yml: new workflow running smoke tests on JDK 17 and JDK 25 with globally installed Copilot CLI (version pinned from pom.xml) - java.notes.template: release notes template for GitHub Releases - update-changelog.sh: script to update CHANGELOG.md during release, generating compare links with java/v tag prefix - test-update-changelog.sh: tests for the changelog update script - TestUtil.java: align findCliPath() Javadoc with actual resolution order (COPILOT_CLI_PATH first, then PATH search) - pom.xml: update copilot-sdk-ref-impl version property
…t for java/v* and rust/v* scoped tags. Address [comments](github#1369 (comment)) from @stephentoub . .github/scripts/release/update-changelog.sh (deleted): Custom awk-based script that maintained java/CHANGELOG.md is no longer needed. .github/scripts/release/test-update-changelog.sh (deleted): Tests for the above script. .github/workflows/java-publish-maven.yml: Remove update-changelog.sh call and CHANGELOG.md from git-add; add "Trigger changelog generation" step that invokes release-changelog.lock.yml with the java/v* tag. .github/workflows/release-changelog.md: Surgical additions to handle language-prefixed tags (java/v*, rust/v*) — scoped previous-tag lookup, scoped file filtering, scoped code snippets, and scoped heading format in CHANGELOG.md. .github/workflows/release-changelog.lock.yml: Recompiled from release-changelog.md via `gh aw compile`. java/CHANGELOG.md (deleted): No longer maintaining a Java-specific changelog; releases flow through the root CHANGELOG.md via the release-changelog agent.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Java SDK to match a newer reference implementation/schema, adds a new preMcpToolCall hook, and adjusts Java release/test automation to support scoped Java tags and changelog generation.
Changes:
- Update Java test utilities to prefer
COPILOT_CLI_PATHover PATH lookup for locating the Copilot CLI. - Refine release-changelog workflow guidance to support language-scoped tags (e.g.,
java/v*) and scoped release note generation. - Update Java release workflows to use
java/v*tag naming and introduce a Java smoke-test workflow plus a Java-specific release notes template.
Show a summary per file
| File | Description |
|---|---|
java/src/test/java/com/github/copilot/sdk/TestUtil.java |
Changes CLI path resolution order to prefer COPILOT_CLI_PATH. |
java/CHANGELOG.md |
Removes the Java-specific changelog file (workflow/docs appear to move toward centralized/scoped changelog automation). |
.github/workflows/release-changelog.md |
Updates changelog generator instructions for scoped tags and scoped-language snippets. |
.github/workflows/release-changelog.lock.yml |
Regenerates the locked workflow to reflect the updated prompt/config. |
.github/workflows/java.notes.template |
Adds a Java-specific GitHub Release notes template for Maven publishing. |
.github/workflows/java-smoke-test.yml |
Adds a Java smoke test workflow for JDK 17 and JDK 25 using the Copilot CLI. |
.github/workflows/java-publish-snapshot.yml |
Sets default working directory to ./java and updates naming. |
.github/workflows/java-publish-maven.yml |
Switches Java release tags to java/v*, uses Java notes template, and triggers changelog generation workflow. |
Copilot's findings
- Files reviewed: 8/8 changed files
- Comments generated: 2
Comment on lines
+230
to
233
| - name: Trigger changelog generation | ||
| run: gh workflow run release-changelog.lock.yml -f tag="java/v${{ needs.publish-maven.outputs.version }}" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Comment on lines
+40
to
+46
| VERSION=$(sed -n "s|.*<${PROP}>\(.*\)</${PROP}>.*|\1|p" pom.xml | head -n 1 | tr -d '[:space:]') | ||
| if [[ -z "$VERSION" || "$VERSION" == "PRIMER_TO_REPLACE" ]]; then | ||
| echo "::error::Could not read pinned @github/copilot version from pom.xml property <${PROP}>" >&2 | ||
| exit 1 | ||
| fi | ||
| echo "Pinned @github/copilot version: $VERSION" | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" |
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.
XL — Regenerated RPC types from
@github/copilot schemaupdate (288 files)Upgrading the reference implementation version from
^1.0.49-1to^1.0.52-1required updating the
@github/copilotnpm package inscripts/codegen/, whichbrought in schema changes. The Java code generator (
java.ts) was updated tohandle these schema changes, and all generated types were regenerated.
src/generated/java/(new API surfaces:SessionEventLogApi,SessionMetadataApi,SessionQueueApi,SessionTasksApi,SessionUiApi,SessionOptionsApi,SessionLspApi,SessionMcpApi,SessionScheduleApi, permissionlocation/path/URLconfig types, and more)scripts/codegen/java.tsto handle new schema patternsscripts/codegen/package.jsonandpackage-lock.jsonThese are all machine-generated. Human review should focus on the
java.tscodegen script changes; the generated output can be spot-checked.
M — Port
preMcpToolCallhook (6 files)New hook that fires before an MCP tool call is dispatched to an MCP server,
giving SDK consumers the ability to inspect or modify the call.
PreMcpToolCallHandler.java(functional interface)PreMcpToolCallHookInput.java(input DTO with server name, tool name, arguments)PreMcpToolCallHookOutput.java(output DTO with allow/deny/modify)SessionHooks.java(added onPreMcpToolCall field, getter, setter, hasHooks check)CopilotSession.java(dispatch "preMcpToolCall" hook name to handler)PreMcpToolCallHookTest.java(unit tests for the new hook)S — Fix
PingResponsetimestamp type (2 files)The CLI server changed the ping response timestamp from a numeric epoch
(long) to an ISO 8601 string. Updated
PingResponserecord field fromlong timestamptoString timestamp, and updatedCopilotClientTestaccordingly.
S —
SessionLogParamsconstructor change (1 file)SessionLogParamsgained new nullable fields in the schema. Updated thecall site in
CopilotSession.log()to pass the additional null parameters.S — Test maintenance (4 files)
McpAndAgentsTest: new E2E test for MCP and agents scenarioPermissionsTest: minor test adjustmentSessionEventDeserializationTest: updated assertions to match new generated typesGeneratedRpcRecordsCoverageTest: updated coverage list for new generated typesS — Infra / metadata (3 files)
.lastmerge: updated tof4d22d70016c377881d86e4c77f8a3f93746ffaepom.xml: ref-impl version property updated to^1.0.52-1.github/workflows/copilot-setup-steps.yml: bump gh-aw setup-cli tov0.74.8