WeKnora/.github/workflows
lyingbug aaad96ef86
ci: add golangci-lint workflow gating new PR code (#2696)
* ci: add golangci-lint workflow gating new PR code

The repo already ships a .golangci.yml and a `make lint` target, but linting
never ran in CI. A full-tree run currently reports ~5.4k pre-existing findings,
so blocking on it is not viable; instead the workflow enables `only-new-issues`
so a PR is judged solely on the code it introduces.

Runs on pull_request only: `only-new-issues` relies on the PR diff and would
degrade into a full-tree run (and fail) on push. The matrix covers all three Go
modules, since a single run cannot span separate go.mod trees; each resolves the
shared root .golangci.yml via upward config discovery.

* fix: migrate .golangci.yml to the v2 schema

The file declared `version: 2` while still using v1 keys. `golangci-lint run`
tolerates this, but `config verify` (which golangci-lint-action runs before
linting) rejects it: `version` must be a string, and `linters-settings` is not a
valid top-level key in v2.

Quoting the version and moving the block under `linters.settings` also restores
the lll settings, which were silently ignored until now -- applying tab-width 4
raises the lll count in client/ from 32 to 42.

* ci: warm the lint cache on main so pull requests stay fast

Caches written by a pull request run are scoped to that pull request, and the
gating job only runs on `pull_request`, so no shared cache was ever produced.
Every pull request therefore recompiled the whole package graph: the first run
on this branch spent 5m39s of its 6m09s with both the Go build cache and the
golangci-lint analysis cache reporting a miss.

Add a job on main that lints purely for the cache side effect, with
`--issues-exit-code=0` so the existing backlog cannot turn the default branch
red. Manual runs route here as well, giving a full backlog report without the
misleading red status a gating run would produce.

* ci: split the lint cache warmer into its own workflow

A job excluded by a job-level `if` is still reported as a check on every pull
request, and because the matrix is never expanded for a skipped job, GitHub
renders the name literally as "warm lint cache (${{ matrix.module }})".

Separating the triggers into two files removes the stray check instead of
papering over the name. Cache keys are derived from the working directory and
go.sum rather than the workflow, so the caches written on main are still the
ones pull requests restore.
2026-08-13 19:26:30 +08:00
..
app.yml fix(ci): scope gofmt check to PR commits and format kb_access_test 2026-07-30 14:13:15 +08:00
cli-e2e.yml refactor(cli): --limit/--all-pages, Go 1.26, internal/agent → aiclient 2026-05-15 12:03:56 +08:00
cli.yml feat(cli): agent-first WeKnora CLI 2026-07-06 22:53:01 +08:00
docker-image.yml feat(sandbox): unify remote sandbox on E2B protocol with self-hosted support (#2655) 2026-08-11 20:14:19 +08:00
docreader.yml perf(ci): speed up App workflow Go dependency caching 2026-07-30 14:13:15 +08:00
frontend.yml ci(frontend): remove docs terminology coupling 2026-07-30 17:32:44 +08:00
go-lint-cache.yml ci: add golangci-lint workflow gating new PR code (#2696) 2026-08-13 19:26:30 +08:00
go-lint.yml ci: add golangci-lint workflow gating new PR code (#2696) 2026-08-13 19:26:30 +08:00
mcp-server.yml fix(mcp-server): adopt official PyPI package tencent-weknora-mcp [v1.1.1] 2026-07-30 15:52:28 +08:00
release-lite.yml chore(deps): bump actions/checkout from 3 to 6 2026-05-09 12:58:31 +08:00