Commit 477398e
committed
Pin Copilot CLI version across all CI paths via pom.xml
Previously, three different code paths determined the Copilot CLI version
inconsistently:
- Path A (build-test.yml) installed the CLI from the cloned reference impl
pinned by .lastmerge — reproducible.
- Path B (run-smoke-test.yml, update-copilot-dependency.yml via the
setup-copilot action) ran `npm install -g @github/copilot` with no
version pin — floated to whatever was latest on npm.
- Path C (local dev) fell through to whatever `copilot` was on PATH
(often whatever VS Code Insiders had installed).
When the CLI protocol vocabulary changed between 1.0.35 and 1.0.39, this
inconsistency made it hard to land reference-impl merges that required a
specific CLI version.
This change makes pom.xml the single source of truth for the
@github/copilot version that all paths must use, while keeping .lastmerge
as the source of truth for the reference implementation commit.
Changes:
- pom.xml: replace the PRIMER_TO_REPLACE placeholder in the property
<readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-weekly-reference-impl-sync>
with the current value (^1.0.36-0) extracted from the cloned
reference impl's nodejs/package.json. Add a doc-comment explaining
that the property is auto-managed and is the canonical CLI version
for all CI paths.
- .github/scripts/reference-impl-sync/sync-cli-version-from-reference-impl.sh
(new): reads dependencies."@github/copilot" from the reference impl's
nodejs/package.json (via node) and rewrites the pom.xml property in
place. Locates the repo root by walking up from the script's own
location until it finds a pom.xml, so it is resilient to relocation
and works from any CWD. Uses portable sed for the rewrite.
- .github/scripts/reference-impl-sync/merge-reference-impl-finish.sh:
call the new sync script right after writing .lastmerge, and stage
pom.xml alongside .lastmerge in the same commit. .lastmerge and the
CLI version property now always move together.
- .github/actions/setup-copilot/action.yml: read the pinned version from
pom.xml using sed and run `npm install -g "@github/copilot@VERSION"`
instead of installing the latest. Fail fast if the property is unset
or still the primer. Expose the resolved version as an action output.
- CONTRIBUTING.md: document the local-dev workflow that mirrors what
build-test.yml does in CI. The cloned reference impl contains two
separate package.json files that both pin @github/copilot:
* target/copilot-sdk/nodejs/package.json (^1.0.36-0) — the SDK-test
pin; this is the CLI the tests must run against.
* target/copilot-sdk/test/harness/package.json (^1.0.32) — the
replay-harness pin; incidental, NOT the CLI under test.
`mvn generate-test-resources` runs `npm install` only in the harness
subtree, so a generic `find target -path '*/@github/copilot/index.js'`
picks the wrong (older) copy. The instructions now:
1. Run `npm ci` in target/copilot-sdk/nodejs/ explicitly.
2. Scope the COPILOT_CLI_PATH lookup to '*/nodejs/node_modules/...'
so the harness copy can never be selected, even if both are
present. Both POSIX (find) and PowerShell (Get-ChildItem) forms
are tightened.
- .gitignore: minor housekeeping.
Verified mvn clean package -Pskip-test-harness -DskipTests succeeds with
the new POM, the sync script correctly rewrites the property when invoked
from any CWD, and the tightened CONTRIBUTING.md sequence resolves
COPILOT_CLI_PATH to the 1.0.36-0 CLI under target/copilot-sdk/nodejs.1 parent 68beab9 commit 477398e
6 files changed
Lines changed: 183 additions & 6 deletions
File tree
- .github
- actions/setup-copilot
- scripts/reference-impl-sync
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | | - | |
14 | | - | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
16 | 37 | | |
17 | 38 | | |
18 | 39 | | |
| |||
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
| |||
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
44 | 76 | | |
45 | 77 | | |
46 | 78 | | |
| |||
54 | 86 | | |
55 | 87 | | |
56 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
57 | 103 | | |
58 | 104 | | |
59 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
56 | 77 | | |
57 | 78 | | |
58 | 79 | | |
| |||
0 commit comments