Skip to content

ci: add go test -race and shellcheck - #144

Merged
BaaRai merged 2 commits into
mainfrom
fix/ci-race-shellcheck
Nov 3, 2026
Merged

BaaRai merged 2 commits into
mainfrom
fix/ci-race-shellcheck

Conversation

@BaaRai

@BaaRai BaaRai commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Gap

CI (.github/workflows/ci.yml) runs neither the race detector nor any shell linting. The install and maintenance scripts (install.sh, update.sh, start.sh, scripts/backup.sh) are only exercised by hand.

Change

  • go job: new step go test -race -p 1 over ./agent ./cmd/artex ./config ./db ./evidence ./guard ./intercept ./llmpool ./llmrec ./mcphttp ./notify ./sidequestion ./traffic. That is every package with tests except ./server. It keeps -p 1 for the same shared-postgres reason as the existing test step.
  • New shell job: shellcheck -S warning install.sh update.sh start.sh scripts/backup.sh. shellcheck is preinstalled on ubuntu-latest. The severity is warning because the first run, at the default severity, failed only on info-level notes in code that is intentional as written:
    • SC2015 A && B || C in update.sh lines 17 and 35.
    • SC2012/SC2086 on the deliberate unquoted glob in backup.sh's prune.
  • Not added: govulncheck and a docker build job. The CI workflow has no infrastructure for either yet (no Go tool install step, no buildx setup or binary artifact in ci.yml), so they are left for a separate change.

Verification

  • Package selection: locally (go1.26.7, no Postgres) go test -race -count=1 was run per package. Every package above passed with no DATA RACE report. ./server fails locally only because its 34 database tests have no Postgres, and it showed no race report either. It is excluded until someone checks it with -race against Postgres.
  • This PR's CI with the Postgres service:
    • Run 41731383592: go test and go test -race both succeeded. shell failed on the info-level notes listed above.
    • Run 41732218961 (with -S warning): go, shell and web all succeeded.
  • yaml.safe_load parses the workflow.

Not verified:

  • shellcheck locally (not installed). The CI job is the only run.
  • Shell changes in other open PRs (for example install.sh and backup.sh fixes) are not covered until they are rebased onto this.

go test -race runs on every package that passes under the race detector
locally (all but ./server, which needs a -race check against postgres
first). A new shell job runs shellcheck on install.sh, update.sh, start.sh and
scripts/backup.sh.
The first run reported only info-level notes (SC2015 in update.sh, SC2012 and
SC2086 on the intentional glob in backup.sh), which made the job fail.
@BaaRai
BaaRai merged commit b100848 into main Nov 3, 2026
3 checks passed
BaaRai added a commit that referenced this pull request Nov 3, 2026
The -race step reused the job's ARTEX_PG_DSN, so it ran against the database the plain test step had just populated. The db tests are not idempotent across runs and failed on duplicate llm_profiles names, turning main red right after #144 merged.
@BaaRai BaaRai mentioned this pull request Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant