Skip to content

Commit 6c62e8b

Browse files
authored
fix: ecosystem health — compat matrix, lint, submodule sync (#10)
* fix: resolve compat matrix collision and sync ecosystem submodules Rename root compatibility-matrix.json to platform-capabilities.json so compat-test reads testdata/compatibility-matrix.json. Fix noctx across codegraph, tools, and bench; use go work sync for tidy; bump external/* submodules to latest main. * style: gofumpt codegraph cgo files for CI format gate
1 parent 1950a2e commit 6c62e8b

18 files changed

Lines changed: 123 additions & 115 deletions

COMPATIBILITY.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ This eco uses **independent SemVer per repo** (see [VERSIONING.md](./VERSIONING.
44
That gives each component its own release cadence, but raises an obvious
55
question: *which combinations of versions are actually tested together?*
66

7-
The answer lives in [`compatibility-matrix.json`](./compatibility-matrix.json).
7+
The answer lives in [`testdata/compatibility-matrix.json`](./testdata/compatibility-matrix.json).
8+
9+
Platform/provider capability metadata is separate: [`platform-capabilities.json`](./platform-capabilities.json).
810

911
## What it records
1012

@@ -46,7 +48,7 @@ existing consumers.
4648
`.shared-templates/workflows/compatibility-test.yml.tmpl` is a reusable
4749
workflow that:
4850

49-
1. Reads `compatibility-matrix.json` from the eco repo.
51+
1. Reads `testdata/compatibility-matrix.json` from the hawk repo.
5052
2. Checks out each component at the version listed in the named matrix.
5153
3. Builds + tests the cross-repo integration scenarios.
5254

@@ -68,21 +70,14 @@ It runs on:
6870

6971
## Validating the file
7072

71-
The file is validated against [`compatibility-matrix.schema.json`](./compatibility-matrix.schema.json)
73+
The file is validated against [`testdata/compatibility-matrix.schema.json`](./testdata/compatibility-matrix.schema.json)
7274
in CI. To validate locally:
7375

7476
```bash
75-
# Quick check using ajv (Node)
77+
make compat-check # structural validation + version pins
78+
79+
# Or with ajv (Node)
7680
npx ajv-cli validate \
77-
-s compatibility-matrix.schema.json \
78-
-d compatibility-matrix.json
79-
80-
# Or with Python
81-
python3 -c "
82-
import json, jsonschema
83-
schema = json.load(open('compatibility-matrix.schema.json'))
84-
data = json.load(open('compatibility-matrix.json'))
85-
jsonschema.validate(data, schema)
86-
print('ok')
87-
"
81+
-s testdata/compatibility-matrix.schema.json \
82+
-d testdata/compatibility-matrix.json
8883
```

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ security: ## Run govulncheck.
106106
@command -v $(GOVULNCHECK) >/dev/null 2>&1 || (echo "install: go install golang.org/x/vuln/cmd/govulncheck@latest" && exit 1)
107107
$(GOVULNCHECK) ./...
108108

109-
tidy: ## Tidy go.mod / go.sum.
110-
go mod tidy
109+
tidy: ## Sync workspace modules and verify checksums.
110+
go work sync
111111
go mod verify
112112

113113
# ---------------------------------------------------------------------------
@@ -190,11 +190,11 @@ help: ## Show this help.
190190
# ---------------------------------------------------------------------------
191191
.PHONY: compat-test compat-check
192192

193-
compat-test: ## Validate compatibility-matrix.json and report the 'next' matrix.
194-
@go run ./cmd/compat-test -matrix=next
193+
compat-test: ## Validate testdata/compatibility-matrix.json and report the 'next' matrix.
194+
@go run ./cmd/compat-test -matrix=next -file=testdata/compatibility-matrix.json
195195

196196
compat-check: ## Strict validation — non-zero exit if any component lacks a version.
197-
@go run ./cmd/compat-test -matrix=next -strict
197+
@go run ./cmd/compat-test -matrix=next -strict -file=testdata/compatibility-matrix.json
198198

199199
.PHONY: hooks
200200
hooks:

cmd/compat-test/main.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,23 @@ func report(mf matrixFile, m matrix, strict bool) error {
160160
return nil
161161
}
162162

163-
// findMatrixFile looks for compatibility-matrix.json in the current dir, then
164-
// walks up looking for one. Returns "" if not found within 6 levels.
163+
// findMatrixFile locates the cross-repo compatibility matrix (testdata/compatibility-matrix.json).
164+
// It must not pick hawk/platform-capabilities.json, which is a different document.
165165
func findMatrixFile() string {
166166
dir, err := os.Getwd()
167167
if err != nil {
168168
return ""
169169
}
170+
candidates := []string{
171+
"testdata/compatibility-matrix.json",
172+
"hawk/testdata/compatibility-matrix.json",
173+
}
170174
for i := 0; i < 6; i++ {
171-
p := filepath.Join(dir, "compatibility-matrix.json")
172-
if _, err := os.Stat(p); err == nil {
173-
return p
175+
for _, rel := range candidates {
176+
p := filepath.Join(dir, rel)
177+
if _, err := os.Stat(p); err == nil {
178+
return p
179+
}
174180
}
175181
parent := filepath.Dir(dir)
176182
if parent == dir {

cmd/testfirst_workflow.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cmd
22

33
import (
4+
"context"
45
"fmt"
56
"os"
67
"os/exec"
@@ -84,7 +85,7 @@ func RunTestFirstWorkflow(cfg TestFirstConfig, chatFn ReviewChatFn) TestFirstRes
8485

8586
// runTests executes the test command and returns output + pass status.
8687
func runTests(testCmd string) (string, bool) {
87-
cmd := exec.Command("sh", "-c", testCmd)
88+
cmd := exec.CommandContext(context.Background(), "sh", "-c", testCmd)
8889
cmd.Dir, _ = os.Getwd()
8990
out, err := cmd.CombinedOutput()
9091
output := strings.TrimSpace(string(out))

external/tok

Submodule tok updated 55 files

0 commit comments

Comments
 (0)