Skip to content

Commit dd1bd9a

Browse files
aksOpsclaude
andcommitted
ci: pin Go to 1.25.7 + restore Java↔Go parity workflow
Goal: lock the toolchain to a version available on developer machines. 1.26+ is too new (not on Homebrew, not in most Linux distros yet), so declare go 1.25.7 in go.mod and pin the same version in both CI workflows. Also restores go-parity.yml — earlier iteration deleted it as part of "remove Java build from pipeline", but the new goal is to keep the parity check active until Phase 6 cutover. The restored workflow has all the fixes from the prior pass: - Builds Java jar with -Dfrontend.skip=true (npm wasn't on CI image). - Runs `enrich -Dspring.profiles.active=serving` before `graph -f json` so the JSON export reads from the populated Neo4j store rather than bailing with "No graph data found." - Runs the graph export from inside the fixture directory so Neo4j resolves the embedded DB path correctly. - Uploads /tmp/java-raw.json + /tmp/java-normalized.json on failure so the parity diff is recoverable for offline triage. - Triggers on PR changes to go/**, src/**, pom.xml, or this workflow, plus workflow_dispatch for manual runs. Local: 828 tests pass with the downgraded go.mod (1.25.7 doesn't lose anything we use — no 1.26-specific features in the tree). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8efbc32 commit dd1bd9a

3 files changed

Lines changed: 100 additions & 2 deletions

File tree

.github/workflows/go-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
- uses: actions/checkout@v4
2525
- uses: actions/setup-go@v5
2626
with:
27-
go-version: '1.22'
27+
# Pin to 1.25.x — 1.26+ isn't on enough developer machines yet.
28+
# go.mod declares `go 1.25.7` to match.
29+
go-version: '1.25.7'
2830
cache: true
2931
cache-dependency-path: go/go.sum
3032
- name: Install C toolchain

.github/workflows/go-parity.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: go-parity
2+
3+
# Java vs Go parity test for fixture-minimal. Validates that the Go port
4+
# produces the same canonical graph shape as the Java reference until
5+
# Phase 6 cutover deletes the Java tree. Runs on PRs that touch the Go
6+
# tree, the Java tree, the parity harness, or this workflow.
7+
#
8+
# The Java side ships a JSON graph via `codeiq graph -f json` from the
9+
# `serving` profile (Neo4j-backed). A small jq filter
10+
# (go/parity/java-normalize.jq) rewrites that into the same per-file
11+
# canonical shape that the Go-side parity.Normalize emits. The two
12+
# normalized JSON blobs are then diff'd by the `parity` build tag in
13+
# go/parity/parity_test.go, with expected-divergence.json holding the
14+
# allow-list of intentional drift.
15+
16+
on:
17+
pull_request:
18+
branches: [main]
19+
paths:
20+
- 'go/**'
21+
- 'src/**'
22+
- 'pom.xml'
23+
- '.github/workflows/go-parity.yml'
24+
workflow_dispatch:
25+
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
parity:
31+
name: Java vs Go parity (fixture-minimal)
32+
runs-on: ubuntu-latest
33+
env:
34+
CGO_ENABLED: "1"
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-java@v4
38+
with:
39+
distribution: temurin
40+
java-version: '25'
41+
cache: maven
42+
- uses: actions/setup-go@v5
43+
with:
44+
# Pin to 1.25.x — 1.26+ isn't on enough developer machines yet.
45+
go-version: '1.25.7'
46+
cache: true
47+
cache-dependency-path: go/go.sum
48+
- name: Install C toolchain
49+
run: sudo apt-get update -y && sudo apt-get install -y build-essential jq
50+
51+
# ---- Java side ----------------------------------------------------
52+
- name: Build Java jar (skip frontend)
53+
run: mvn -B -q -DskipTests -Dfrontend.skip=true package
54+
- name: Stage Java fixture (separate copy so caches don't collide)
55+
run: cp -r go/testdata/fixture-minimal /tmp/fm-java
56+
- name: Java index → H2 cache
57+
run: java -jar target/code-iq-*-cli.jar index /tmp/fm-java
58+
- name: Java enrich → Neo4j (serving profile)
59+
# `graph -f json` reads from Neo4j under the serving profile, not
60+
# H2. Need to enrich first or the export prints "No graph data
61+
# found. Run 'codeiq analyze' first."
62+
run: |
63+
java -Dspring.profiles.active=serving \
64+
-jar target/code-iq-*-cli.jar enrich /tmp/fm-java
65+
- name: Java graph → normalized JSON
66+
# Run from inside the fixture so Neo4j path resolution finds the
67+
# store enrich wrote. java-normalize.jq pivots the Java
68+
# {nodes:[...], edges:[...]} shape into the per-file array shape
69+
# parity.Normalize uses on the Go side.
70+
run: |
71+
cd /tmp/fm-java
72+
java -Dspring.profiles.active=serving \
73+
-jar "$GITHUB_WORKSPACE"/target/code-iq-*-cli.jar graph . -f json \
74+
> /tmp/java-raw.json
75+
jq -f "$GITHUB_WORKSPACE"/go/parity/java-normalize.jq /tmp/java-raw.json \
76+
> /tmp/java-normalized.json
77+
78+
# ---- Go side ------------------------------------------------------
79+
- name: Build Go binary
80+
working-directory: go
81+
run: go build -o codeiq ./cmd/codeiq
82+
- name: Go parity test (diff vs normalized Java output)
83+
working-directory: go
84+
env:
85+
TEST_JAVA_NORMALIZED: /tmp/java-normalized.json
86+
run: go test -tags=parity ./parity/... -v
87+
88+
# ---- Failure artifact --------------------------------------------
89+
- name: Upload normalized JSON on failure
90+
if: failure()
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: parity-diff
94+
path: |
95+
/tmp/java-normalized.json
96+
/tmp/java-raw.json

go/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/randomcodespace/codeiq/go
22

3-
go 1.26.2
3+
go 1.25.7
44

55
require github.com/mattn/go-sqlite3 v1.14.22
66

0 commit comments

Comments
 (0)