ci: Qlty quality job, go 1.27.3 !592

merged merged by cmc on 2026-10-22 18:28 UTC · krz/gitbay:qlty into main

7 files changed, +100 −11

Layout: unified · split

.gitbay/ci.yml +19 −3
@@ -2,7 +2,7 @@ jobs:
22 # Fast feedback: this finishes in seconds, so it is not held behind the
33 # suite.
44 build:
5 image: localhost/gitbay-ci:2
5 image: localhost/gitbay-ci:3
66 steps:
77 - go build ./...
88 - go vet ./...
@@ -13,12 +13,24 @@ jobs:
1313 # The 20m is under the runner's own 30m limit, so go times out first and
1414 # says which test hung instead of the runner killing it blind.
1515 test:
16 image: localhost/gitbay-ci:2
16 image: localhost/gitbay-ci:3
1717 steps:
1818 - missing=""; for t in git git-lfs gpg; do command -v "$t" >/dev/null || missing="$missing $t"; done; test -x /usr/sbin/sshd || missing="$missing sshd"; test -z "$missing" || { echo "runner is missing:$missing"; exit 1; }
1919 - go test ./... -count=1 -timeout 20m
2020 paths-ignore:
2121 - .gitbay/wiki/**
22 # Static analysis through Qlty (.qlty/qlty.toml). Secrets and gofmt fail
23 # the build. The full report, including radarlint-go's Sonar rules, is
24 # printed without failing it. The CLI is pinned, and unpacked with Python
25 # because this image has no xz.
26 quality:
27 image: localhost/gitbay-ci:3
28 steps:
29 - curl -fsSL -o /tmp/qlty.tar.xz https://qlty-releases.s3.amazonaws.com/qlty/v0.661.0/qlty-x86_64-unknown-linux-gnu.tar.xz && python3 -c "import tarfile; tarfile.open('/tmp/qlty.tar.xz').extractall('/tmp', filter='data')"
30 - QLTY_TELEMETRY=off /tmp/qlty-x86_64-unknown-linux-gnu/qlty check --all --no-progress --filter trufflehog,gofmt
31 - QLTY_TELEMETRY=off /tmp/qlty-x86_64-unknown-linux-gnu/qlty check --all --no-progress --no-fail
32 paths-ignore:
33 - .gitbay/wiki/**
2234 # Vulnerability scanning, separate from test so a newly published advisory
2335 # against unchanged code does not mask a real test failure. It fails the
2436 # build on purpose: an advisory that only lands in a report nobody reads is
@@ -33,7 +45,11 @@ jobs:
3345 # `build trigger krz/gitbay vuln` runs it on demand before a release
3446 # (#177).
3547 vuln:
36 image: localhost/gitbay-ci:2
48 image: localhost/gitbay-ci:3
3749 schedule: "0 3 * * *"
3850 steps:
3951 - go run golang.org/x/vuln/cmd/govulncheck@latest ./...
52 # osv-scanner also reports advisories in dependencies the code does not
53 # call, which govulncheck skips.
54 - curl -fsSL -o /tmp/qlty.tar.xz https://qlty-releases.s3.amazonaws.com/qlty/v0.661.0/qlty-x86_64-unknown-linux-gnu.tar.xz && python3 -c "import tarfile; tarfile.open('/tmp/qlty.tar.xz').extractall('/tmp', filter='data')"
55 - QLTY_TELEMETRY=off /tmp/qlty-x86_64-unknown-linux-gnu/qlty check --all --no-progress --filter osv-scanner
.gitbay/wiki/Admin.org +2 −2
@@ -1090,7 +1090,7 @@ where every repository is trusted. There is no automatic fallback: a
10901090runner started with =-isolation podman= that cannot find a working
10911091podman exits rather than running a build unsandboxed.
10921092
1093gitbay's own jobs name =localhost/gitbay-ci:2=, built from
1093gitbay's own jobs name =localhost/gitbay-ci:3=, built from
10941094=deploy/Containerfile.ci= on the runner host. A job's image must carry
10951095what its steps need: the suite drives real git, git-lfs, gpg and sshd and
10961096asserts they exist before running, so the stock runner default would fail
@@ -1099,7 +1099,7 @@ it immediately. Build or rebuild it with:
10991099#+begin_src sh
11001100ssh -p 2222 root@<host> 'cat > /tmp/Containerfile.ci' < deploy/Containerfile.ci
11011101ssh -p 2222 root@<host> 'su - ci-runner -s /bin/sh -c \
1102 "podman build -t localhost/gitbay-ci:2 -f /tmp/Containerfile.ci /tmp"'
1102 "podman build -t localhost/gitbay-ci:3 -f /tmp/Containerfile.ci /tmp"'
11031103#+end_src
11041104
11051105The tag is deliberate rather than =:latest=: changing the file means
.qlty/.gitignore added +7
@@ -0,0 +1,7 @@
1*
2!configs
3!configs/**
4!hooks
5!hooks/**
6!qlty.toml
7!.gitignore
.qlty/qlty.toml added +66
@@ -0,0 +1,66 @@
1config_version = "0"
2
3# Qlty's generated defaults exclude **/config/** and **/templates/**, which
4# would skip internal/config.
5exclude_patterns = [
6 "**/testdata/**",
7 "**/vendor/**",
8 ".gitbay/wiki/**",
9]
10
11test_patterns = [
12 "**/*_test.go",
13 "e2e/**",
14]
15
16[smells]
17mode = "comment"
18
19[[source]]
20name = "default"
21default = true
22
23[[plugin]]
24name = "golangci-lint"
25version = "2.15.0"
26drivers = ["lint"]
27
28[[plugin]]
29name = "gofmt"
30
31[[plugin]]
32name = "radarlint-go"
33
34[[plugin]]
35name = "osv-scanner"
36
37[[plugin]]
38name = "trufflehog"
39
40[[plugin]]
41name = "shellcheck"
42
43[[plugin]]
44name = "ruff"
45drivers = ["lint"]
46
47# Repeated literals are expected in table-driven and end-to-end tests.
48[[triage]]
49match.plugins = ["radarlint-go"]
50match.rules = ["radarlint-go:go:S1192"]
51match.file_patterns = ["**/*_test.go", "e2e/**"]
52set.ignored = true
53
54# Unchecked errors in tests are setup and teardown calls.
55[[triage]]
56match.plugins = ["golangci-lint"]
57match.rules = ["golangci-lint:errcheck"]
58match.file_patterns = ["**/*_test.go", "e2e/**"]
59set.ignored = true
60
61# x/crypto/openpgp is deprecated with no fixed version. gitbay imports
62# github.com/ProtonMail/go-crypto/openpgp, not that package.
63[[triage]]
64match.plugins = ["osv-scanner"]
65match.rules = ["osv-scanner:GO-2026-5932"]
66set.ignored = true
deploy/Containerfile.ci +2 −2
@@ -8,12 +8,12 @@
88#
99# scp -P 2222 deploy/Containerfile.ci root@gitbay.org:/var/lib/gitbay-runner/gitbay-ci.Containerfile
1010# ssh -p 2222 root@gitbay.org 'chown ci-runner /var/lib/gitbay-runner/gitbay-ci.Containerfile \
11# && su - ci-runner -s /bin/sh -c "podman build -t localhost/gitbay-ci:2 -f gitbay-ci.Containerfile ." \
11# && su - ci-runner -s /bin/sh -c "podman build -t localhost/gitbay-ci:3 -f gitbay-ci.Containerfile ." \
1212# && rm /var/lib/gitbay-runner/gitbay-ci.Containerfile'
1313#
1414# Tagged, not :latest, so a change to this file is a deliberate bump in
1515# .gitbay/ci.yml rather than a silent change under a running branch.
16FROM docker.io/library/golang:1.27-trixie
16FROM docker.io/library/golang:1.27.3-trixie
1717
1818# gitbay-runner-prune.service skips images carrying this label. A localhost/
1919# image cannot be pulled back, so pruning it fails every job that names it.
go.mod +1 −1
@@ -1,6 +1,6 @@
11module gitbay.org/gitbay
22
3go 1.27.2
3go 1.27.3
44
55require (
66 filippo.io/age v1.3.2
internal/httpd/rendered_test.go +3 −3
@@ -17,10 +17,10 @@ func TestFocusableBlocks(t *testing.T) {
1717func TestImageAlt(t *testing.T) {
1818 cases := map[string]string{
1919 `<a href="/b"><img src="https://forge.test/krz/gitbay/badge/build.svg"/></a>`: `<a href="/b"><img alt="build" src="https://forge.test/krz/gitbay/badge/build.svg"/></a>`,
20 `<img src="pic.png?v=2">`: `<img alt="pic" src="pic.png?v=2">`,
21 `<img alt="" src="pic.png">`: `<img alt="" src="pic.png">`,
20 `<img src="pic.png?v=2">`: `<img alt="pic" src="pic.png?v=2">`,
21 `<img alt="" src="pic.png">`: `<img alt="" src="pic.png">`,
2222 `<img alt="a chart" src="c.png">`: `<img alt="a chart" src="c.png">`,
23 `<img>`: `<img alt="">`,
23 `<img>`: `<img alt="">`,
2424 }
2525 for in, want := range cases {
2626 if got := string(imageAlt(template.HTML(in))); got != want {