Skip to content

Commit f0aebe7

Browse files
edburnsCopilot
andcommitted
Update pom.xml to use local test harness instead of git clone
Since the Java SDK now lives inside the copilot-sdk monorepo, point copilot.sdk.clone.dir at the monorepo root (../) instead of cloning into target/. Remove the antrun git clone execution entirely. Update SCM URLs to github/copilot-sdk. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 446547c commit f0aebe7

1 file changed

Lines changed: 21 additions & 115 deletions

File tree

java/pom.xml

Lines changed: 21 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<name>GitHub Copilot SDK :: Java</name>
1414
<description>SDK for programmatic control of GitHub Copilot CLI</description>
15-
<url>https://github.com/github/copilot-sdk-java</url>
15+
<url>https://github.com/github/copilot-sdk</url>
1616

1717
<licenses>
1818
<license>
@@ -30,9 +30,9 @@
3030
</developers>
3131

3232
<scm>
33-
<connection>scm:git:https://github.com/github/copilot-sdk-java.git</connection>
34-
<developerConnection>scm:git:https://github.com/github/copilot-sdk-java.git</developerConnection>
35-
<url>https://github.com/github/copilot-sdk-java</url>
33+
<connection>scm:git:https://github.com/github/copilot-sdk.git</connection>
34+
<developerConnection>scm:git:https://github.com/github/copilot-sdk.git</developerConnection>
35+
<url>https://github.com/github/copilot-sdk</url>
3636
<tag>HEAD</tag>
3737
</scm>
3838

@@ -46,21 +46,21 @@
4646
<properties>
4747
<maven.compiler.release>17</maven.compiler.release>
4848
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
49-
<!-- Directory where the copilot-sdk repo will be cloned for tests -->
50-
<copilot.sdk.clone.dir>${project.build.directory}/copilot-sdk</copilot.sdk.clone.dir>
49+
<!-- Directory of the monorepo root (one level up from java/) -->
50+
<copilot.sdk.clone.dir>${project.basedir}/..</copilot.sdk.clone.dir>
5151
<copilot.tests.dir>${copilot.sdk.clone.dir}/test</copilot.tests.dir>
5252
<!--
5353
Path to the Copilot CLI entry point used by the SDK tests. Defaults
54-
to the CLI installed under target/copilot-sdk/nodejs by the
55-
install-nodejs-cli-dependencies execution. Surefire injects this
54+
to the CLI installed under ../nodejs (the monorepo's nodejs dir) by
55+
the install-nodejs-cli-dependencies execution. Surefire injects this
5656
into the test JVM as the COPILOT_CLI_PATH environment variable, so
5757
`mvn verify` is self-contained and the developer never has to set
5858
it manually. Override on the command line to point at a different
5959
CLI build, e.g.:
6060
mvn verify -Dcopilot.cli.path=/some/other/copilot/index.js
6161
-->
6262
<copilot.cli.path>${copilot.sdk.clone.dir}/nodejs/node_modules/@github/copilot/index.js</copilot.cli.path>
63-
<!-- Set to true (via -Pskip-test-harness) to skip git-clone + npm install of test harness -->
63+
<!-- Set to true (via -Pskip-test-harness) to skip npm install of test harness -->
6464
<skip.test.harness>false</skip.test.harness>
6565
<!--
6666
Whether to skip the install-nodejs-cli-dependencies execution
@@ -76,23 +76,17 @@
7676
<!-- Extra JVM args for Surefire; overridden by the jdk21+ profile -->
7777
<surefire.jvm.args />
7878
<!--
79-
The version of the @github/copilot npm package that the reference implementation
80-
commit pinned in .lastmerge depends on. Mirrors the value of dependencies."@github/copilot"
81-
in target/copilot-sdk/nodejs/package.json after the reference impl is cloned/reset to the
82-
commit in .lastmerge.
79+
The version of the @github/copilot npm package used by the monorepo.
80+
Mirrors the value of dependencies."@github/copilot"
81+
in ../nodejs/package.json.
8382
8483
The previously mentioned package.json contains the SINGLE
8584
SOURCE OF TRUTH for the Copilot CLI version that all paths
8685
(build-test.yml, run-smoke-test.yml,
8786
update-copilot-dependency.yml, setup-copilot action) must
88-
pin to. It is updated automatically by
89-
.github/scripts/reference-impl-sync/sync-cli-version-from-reference-impl.sh,
90-
which is called from merge-reference-impl-finish.sh
91-
whenever .lastmerge is updated.
87+
pin to.
9288
93-
DO NOT EDIT MANUALLY. To update, run the
94-
reference-impl-sync workflow and deal with the subsequent
95-
PR.
89+
DO NOT EDIT MANUALLY.
9690
-->
9791
<readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync>^1.0.49-1</readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync>
9892

@@ -173,88 +167,6 @@
173167
<artifactId>maven-jar-plugin</artifactId>
174168
<version>3.5.0</version>
175169
</plugin>
176-
<!-- Clone or update the official copilot-sdk repository for test resources, and copy image to site -->
177-
<plugin>
178-
<groupId>org.apache.maven.plugins</groupId>
179-
<artifactId>maven-antrun-plugin</artifactId>
180-
<version>3.2.0</version>
181-
<executions>
182-
<execution>
183-
<id>clone-or-update-copilot-sdk</id>
184-
<phase>generate-test-resources</phase>
185-
<goals>
186-
<goal>run</goal>
187-
</goals>
188-
<configuration>
189-
<skip>${skip.test.harness}</skip>
190-
<target xmlns:if="ant:if" xmlns:unless="ant:unless">
191-
<!-- Load the target commit from .lastmerge file -->
192-
<loadfile property="copilot.sdk.commit" srcFile="${project.basedir}/.lastmerge">
193-
<filterchain>
194-
<striplinebreaks />
195-
<trim />
196-
</filterchain>
197-
</loadfile>
198-
199-
<!-- Check if .git directory exists -->
200-
<condition property="repo.exists">
201-
<available file="${copilot.sdk.clone.dir}/.git" type="dir" />
202-
</condition>
203-
204-
<!-- If repo exists, fetch and reset to the target commit -->
205-
<sequential if:set="repo.exists">
206-
<echo message="Updating existing copilot-sdk repository to commit ${copilot.sdk.commit}..." />
207-
<exec executable="git" dir="${copilot.sdk.clone.dir}" failonerror="true">
208-
<arg value="fetch" />
209-
<arg value="--depth" />
210-
<arg value="1" />
211-
<arg value="origin" />
212-
<arg value="${copilot.sdk.commit}" />
213-
</exec>
214-
<exec executable="git" dir="${copilot.sdk.clone.dir}" failonerror="true">
215-
<arg value="reset" />
216-
<arg value="--hard" />
217-
<arg value="FETCH_HEAD" />
218-
</exec>
219-
</sequential>
220-
221-
<!-- If repo doesn't exist, clone it at the specific commit -->
222-
<sequential unless:set="repo.exists">
223-
<echo message="Cloning copilot-sdk repository at commit ${copilot.sdk.commit}..." />
224-
<delete dir="${copilot.sdk.clone.dir}" quiet="true" />
225-
<exec executable="git" failonerror="true">
226-
<arg value="clone" />
227-
<arg value="--depth" />
228-
<arg value="1" />
229-
<arg value="https://github.com/github/copilot-sdk.git" />
230-
<arg value="${copilot.sdk.clone.dir}" />
231-
</exec>
232-
<exec executable="git" dir="${copilot.sdk.clone.dir}" failonerror="true">
233-
<arg value="fetch" />
234-
<arg value="--depth" />
235-
<arg value="1" />
236-
<arg value="origin" />
237-
<arg value="${copilot.sdk.commit}" />
238-
</exec>
239-
<exec executable="git" dir="${copilot.sdk.clone.dir}" failonerror="true">
240-
<arg value="reset" />
241-
<arg value="--hard" />
242-
<arg value="FETCH_HEAD" />
243-
</exec>
244-
</sequential>
245-
</target>
246-
</configuration>
247-
</execution>
248-
</executions>
249-
<dependencies>
250-
<!-- Required for if:set and unless:set -->
251-
<dependency>
252-
<groupId>org.apache.ant</groupId>
253-
<artifactId>ant</artifactId>
254-
<version>1.10.17</version>
255-
</dependency>
256-
</dependencies>
257-
</plugin>
258170
<!-- Install harness dependencies -->
259171
<plugin>
260172
<groupId>org.codehaus.mojo</groupId>
@@ -278,16 +190,10 @@
278190
</execution>
279191
<!--
280192
Install the @github/copilot CLI declared by
281-
target/copilot-sdk/nodejs/package.json. This is the CLI
282-
version the SDK tests must run against (independent of
283-
the older pin in test/harness/package.json which is
284-
incidental to harness internals). Mirrors what
285-
.github/workflows/build-test.yml does manually so that
286-
`mvn clean verify` is self-contained: the prior
287-
target/copilot-sdk/nodejs/node_modules is wiped by
288-
clean, but this re-creates it before tests run.
289-
Uses npm ci with the ignore-scripts flag, matching
290-
build-test.yml.
193+
../nodejs/package.json. This is the CLI version the SDK
194+
tests must run against (independent of the older pin in
195+
test/harness/package.json which is incidental to harness
196+
internals). Uses npm ci with the ignore-scripts flag.
291197
-->
292198
<execution>
293199
<id>install-nodejs-cli-dependencies</id>
@@ -331,8 +237,8 @@
331237
<!--
332238
Set COPILOT_CLI_PATH for the forked test JVM so the SDK
333239
tests transparently use the pinned CLI under
334-
target/copilot-sdk/nodejs/. See the copilot.cli.path
335-
property above for the override mechanism.
240+
../nodejs/. See the copilot.cli.path property above for
241+
the override mechanism.
336242
-->
337243
<environmentVariables>
338244
<COPILOT_CLI_PATH>${copilot.cli.path}</COPILOT_CLI_PATH>
@@ -693,7 +599,7 @@
693599
<surefire.jvm.args>-XX:+EnableDynamicAgentLoading</surefire.jvm.args>
694600
</properties>
695601
</profile>
696-
<!-- Skip git-clone + npm install of the copilot-sdk test harness -->
602+
<!-- Skip npm install of the copilot-sdk test harness -->
697603
<profile>
698604
<id>skip-test-harness</id>
699605
<properties>

0 commit comments

Comments
 (0)