Skip to content

Commit c1aced8

Browse files
fix(chatarchive): correct CI Go version, gate ordering, and EOF comparison
- CI workflow: replace hardcoded go-version '1.25' with go-version-file to stay in sync with go.mod (was 1.24.6/1.24.7) - CI script: move coverage threshold checks before summary JSON write so artifacts are not written with "passed" status when thresholds fail - discover.go: use errors.Is(err, io.EOF) instead of bare == comparison per Go best practice for wrapped error chains Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0ecc32c commit c1aced8

6 files changed

Lines changed: 16 additions & 15 deletions

File tree

.github/workflows/chatarchive-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Set up Go
4848
uses: actions/setup-go@v5
4949
with:
50-
go-version: '1.25'
50+
go-version-file: 'go.mod'
5151

5252
- name: Set up Node
5353
uses: actions/setup-node@v4

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "prompts"]
2-
path = prompts
2+
path = third_party/prompts
33
url = ssh://git@vhost7:9001/cybermonkey/prompts.git

pkg/chatarchive/discover.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package chatarchive
44

55
import (
6+
"errors"
67
"fmt"
78
"io"
89
"os"
@@ -274,7 +275,7 @@ func isJSONTranscript(path string) bool {
274275

275276
buf := make([]byte, jsonValidationBufSize)
276277
n, err := f.Read(buf)
277-
if err != nil && err != io.EOF {
278+
if err != nil && !errors.Is(err, io.EOF) {
278279
return false
279280
}
280281
h := strings.ToLower(string(buf[:n]))

prompts

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/chatarchive-ci.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ go test ./internal/chatarchivecmd/... ./cmd/create ./cmd/backup
3939
echo "==> E2E smoke tests"
4040
go test -tags=e2e_smoke ./test/e2e/smoke -run 'TestSmoke_(ChatArchive|BackupChats)' -count=1
4141

42+
check_threshold() {
43+
local actual="$1" threshold="$2" label="$3"
44+
if awk "BEGIN {exit !($actual < $threshold)}"; then
45+
echo "FAIL: $label coverage ${actual}% is below the ${threshold}% floor." >&2
46+
exit 1
47+
fi
48+
}
49+
50+
check_threshold "$UNIT_COVERAGE" 70.0 "Unit"
51+
check_threshold "$COMBINED_COVERAGE" 90.0 "Combined"
52+
4253
SUMMARY="Chat archive verification summary
4354
Unit coverage: ${UNIT_COVERAGE}%
4455
Combined unit+integration coverage: ${COMBINED_COVERAGE}%
@@ -63,14 +74,3 @@ cat > "$SUMMARY_JSON_FILE" <<EOF
6374
}
6475
}
6576
EOF
66-
67-
check_threshold() {
68-
local actual="$1" threshold="$2" label="$3"
69-
if awk "BEGIN {exit !($actual < $threshold)}"; then
70-
echo "FAIL: $label coverage ${actual}% is below the ${threshold}% floor." >&2
71-
exit 1
72-
fi
73-
}
74-
75-
check_threshold "$UNIT_COVERAGE" 70.0 "Unit"
76-
check_threshold "$COMBINED_COVERAGE" 90.0 "Combined"

third_party/prompts

Submodule prompts added at 4907977

0 commit comments

Comments
 (0)