Compare commits

..
Author SHA1 Message Date
Sebi df8b715ca7 fix(deps): update module github.com/twmb/franz-go/pkg/kmsg to v1.15.2
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
renovate/stability-days Updates have met minimum release age requirement
ci / lint (pull_request) Successful in 11m10s
ci / test (pull_request) Successful in 12m41s
ci / build (pull_request) Successful in 18m36s
ci / image (pull_request) Successful in 5m30s
2026-11-30 01:13:14 +00:00
5 changed files with 47 additions and 141 deletions

No files matched your search

+43 -117
View File
@@ -13,10 +13,7 @@ concurrency:
env:
GOLANGCI_LINT_VERSION: v2.15.0
SQLC_VERSION: v1.31.1
# sha256 of golangci-lint-<version>-linux-amd64.tar.gz from the release's checksums.txt
GOLANGCI_LINT_SHA256: 9b7fe6a6bf6334b98decf8d86b11415ea7889afdabdd1959fdce23af2a9ebcea
HELM_VERSION: v3.19.0
SHELLCHECK_VERSION: v0.12.0
jobs:
lint:
@@ -32,24 +29,8 @@ jobs:
curl -fsSL "https://go.dev/dl/go${v}.linux-amd64.tar.gz" | tar -C /usr/local -xz
echo /usr/local/go/bin >> "$GITHUB_PATH"
echo "$HOME/go/bin" >> "$GITHUB_PATH"
echo "GO_VERSION=$v" >> "$GITHUB_ENV"
# Module, build and npm caches live in the runners' S3 cache. Only main
# saves them (one entry per commit, expired by the bucket after 7 days);
# pull requests and tags restore the newest one from main.
- name: Restore caches
uses: actions/cache/restore@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.cache/golangci-lint
~/.npm
key: lint-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-${{ github.sha }}
restore-keys: |
lint-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-
lint-go${{ env.GO_VERSION }}-
- name: Build frontend
run: npm ci --no-audit --no-fund --prefer-offline && npm run build
run: npm ci --no-audit --no-fund && npm run build
- name: Generated code is up to date
run: |
go tool templ generate
@@ -61,15 +42,10 @@ jobs:
run: test -z "$(gofmt -l internal cmd tools deploy)" || { gofmt -l internal cmd tools deploy; exit 1; }
- name: go vet
run: go vet ./...
# The release binary instead of `go install`, which compiled the linter
# from source on every run.
- name: golangci-lint
run: |
v="${GOLANGCI_LINT_VERSION#v}"
curl -fsSLo /tmp/golangci-lint.tar.gz "https://github.com/golangci/golangci-lint/releases/download/${GOLANGCI_LINT_VERSION}/golangci-lint-${v}-linux-amd64.tar.gz"
echo "${GOLANGCI_LINT_SHA256} /tmp/golangci-lint.tar.gz" | sha256sum -c -
tar -xzf /tmp/golangci-lint.tar.gz -C /usr/local/bin --strip-components=1 "golangci-lint-${v}-linux-amd64/golangci-lint"
golangci-lint run ./...
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
"$(go env GOPATH)/bin/golangci-lint" run ./...
- name: Helm chart
run: |
curl -fsSL "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz" | tar -xz -C /usr/local/bin --strip-components=1 linux-amd64/helm
@@ -89,20 +65,8 @@ jobs:
# Debian and Raspberry Pi OS; the test renders and checks it.
- name: shellcheck
run: |
# Static release binary instead of apt-get update + install on every run.
curl -fsSL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" \
| tar -xJ -C /usr/local/bin --strip-components=1 "shellcheck-${SHELLCHECK_VERSION}/shellcheck"
command -v shellcheck >/dev/null || { apt-get update -qq && apt-get install -y -qq shellcheck; }
go test -count=1 -run 'TestScript|TestInstall' -v ./deploy/agent/ | grep -v '^=== RUN'
- name: Save caches
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.cache/golangci-lint
~/.npm
key: lint-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-${{ github.sha }}
test:
runs-on: ubuntu-latest
@@ -162,20 +126,8 @@ jobs:
curl -fsSL "https://go.dev/dl/go${v}.linux-amd64.tar.gz" | tar -C /usr/local -xz
echo /usr/local/go/bin >> "$GITHUB_PATH"
echo "$HOME/go/bin" >> "$GITHUB_PATH"
echo "GO_VERSION=$v" >> "$GITHUB_ENV"
- name: Restore caches
uses: actions/cache/restore@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.npm
key: test-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-${{ github.sha }}
restore-keys: |
test-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-
test-go${{ env.GO_VERSION }}-
- name: Build frontend
run: npm ci --no-audit --no-fund --prefer-offline && npm run build
run: npm ci --no-audit --no-fund && npm run build
- name: Prepare database
# The same roles and databases as the local environment: the
# application role must not be a superuser, or row-level security
@@ -184,15 +136,6 @@ jobs:
- name: Test
# Integration tests share one database, so packages run one at a time.
run: go test -p 1 -count=1 ./...
- name: Save caches
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.npm
key: test-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-${{ github.sha }}
build:
# Nothing is built or pushed from code that fails lint or tests; the
@@ -212,20 +155,8 @@ jobs:
curl -fsSL "https://go.dev/dl/go${v}.linux-amd64.tar.gz" | tar -C /usr/local -xz
echo /usr/local/go/bin >> "$GITHUB_PATH"
echo "$HOME/go/bin" >> "$GITHUB_PATH"
echo "GO_VERSION=$v" >> "$GITHUB_ENV"
- name: Restore caches
uses: actions/cache/restore@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.npm
key: build-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-${{ github.sha }}
restore-keys: |
build-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-
build-go${{ env.GO_VERSION }}-
- name: Build frontend
run: npm ci --no-audit --no-fund --prefer-offline && npm run build
run: npm ci --no-audit --no-fund && npm run build
- name: Build binaries
id: binaries
run: |
@@ -268,59 +199,38 @@ jobs:
./image -name statuspage -repo "$host/$owner/uptimesebi-statuspage" -port 8082/tcp \
-env UPTIME_STATUSPAGE_CACHE_DIR=/var/lib/uptimesebi $variant $flags
done
- name: Save caches
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.npm
key: build-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-${{ github.sha }}
# The image job packs the amd64 binaries instead of compiling everything again.
- name: Hand the binaries to the image job
uses: actions/upload-artifact@v4
with:
name: image-context
path: |
Dockerfile.ci
dist/linux_amd64/
retention-days: 1
image:
# Builds Dockerfile.ci (the build job's amd64 binaries on distroless)
# with the runner's Docker daemon instead of Kaniko rebuilding frontend
# and Go from the git context. Images are pushed only from main and tags,
# and only once the PACKAGE_TOKEN secret (write:package) exists.
# Kaniko runs rootless from docker:cli, the same way as the other
# repositories on this instance: the default job image has no docker
# CLI, and Kaniko's own image lacks what the runner needs to keep a job
# container alive. Images are pushed only from main and tags, and only
# once the PACKAGE_TOKEN secret (write:package) exists.
# The build job's version, so the API reports the release its agent
# images are tagged with.
needs: build
runs-on: ubuntu-latest
# Node for the artifact action; the Docker CLI is added below.
container:
image: node:24-alpine
image: docker:cli@sha256:34507eb5069d8be82c95dd3b6987d4250fd5fee49b82e2509b7d7a7030740d6d
defaults:
run:
shell: sh
steps:
- uses: actions/download-artifact@v4
with:
name: image-context
path: ctx
- name: Build (and push from main and tags)
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
VERSION: ${{ needs.build.outputs.version }}
run: |
set -eu
apk add --no-cache docker-cli docker-cli-buildx >/dev/null
REGISTRY="${GITHUB_SERVER_URL#*://}"
IMAGE="$(printf '%s/%s' "$REGISTRY" "$GITHUB_REPOSITORY" | tr 'A-Z' 'a-z')"
SHORT="$(printf '%s' "$GITHUB_SHA" | cut -c1-12)"
TAG="$VERSION"
TAGS="${IMAGE}:${TAG#v}"
PUSH="--no-push"
DEST="--destination ${IMAGE}:${TAG#v}"
# Channels: edge follows main, beta the newest prerelease, latest
# and stable the newest release, X.Y its newest patch.
CHANNELS=""
case "$GITHUB_REF" in
refs/heads/main) CHANNELS="edge" ;;
refs/tags/v*-beta.*) CHANNELS="beta" ;;
@@ -328,17 +238,33 @@ jobs:
MINOR="$(printf '%s' "${TAG#v}" | cut -d. -f1-2)"
CHANNELS="latest stable $MINOR" ;;
esac
for c in $CHANNELS; do TAGS="$TAGS ${IMAGE}:$c"; done
set --
for t in $TAGS; do set -- "$@" -t "$t"; done
docker build --platform linux/amd64 -f ctx/Dockerfile.ci "$@" ctx
case "$GITHUB_REF" in
refs/heads/main|refs/tags/v*)
if [ -z "${PACKAGE_TOKEN:-}" ]; then
echo "PACKAGE_TOKEN is not set; built without pushing."
exit 0
fi
printf '%s' "$PACKAGE_TOKEN" | docker login "$REGISTRY" -u "$GITHUB_ACTOR" --password-stdin
for t in $TAGS; do docker push "$t"; done ;;
*) echo "Pull request: built without pushing." ;;
if [ -n "${PACKAGE_TOKEN:-}" ]; then
PUSH=""
for c in $CHANNELS; do DEST="$DEST --destination ${IMAGE}:$c"; done
else
echo "PACKAGE_TOKEN is not set; building without pushing."
fi ;;
esac
case "$GITHUB_SERVER_URL" in https://*) PULL=https ;; *) PULL=http ;; esac
# Pull requests are built from their head, which Gitea exposes as
# refs/pull/<n>/head.
REF="$GITHUB_REF"
case "$REF" in refs/pull/*/merge) REF="${REF%/merge}/head" ;; esac
AUTH="$(printf '%s:%s' "$GITHUB_ACTOR" "${PACKAGE_TOKEN:-none}" | base64 | tr -d '\n')"
CFG="$(printf '{"auths":{"%s":{"auth":"%s"}}}' "$REGISTRY" "$AUTH")"
docker run --rm \
-e GIT_PULL_METHOD="$PULL" \
-e GIT_USERNAME="x-access-token" \
-e GIT_PASSWORD="$GITEA_TOKEN" \
-e CFG="$CFG" \
--entrypoint /busybox/sh \
gcr.io/kaniko-project/executor:v1.23.2-debug \
-c 'mkdir -p /kaniko/.docker && printf %s "$CFG" > /kaniko/.docker/config.json && exec /kaniko/executor "$@"' _ \
--context "git://${REGISTRY}/${GITHUB_REPOSITORY}.git#${REF}" \
--dockerfile Dockerfile \
--build-arg VERSION="$TAG" \
--build-arg COMMIT="$SHORT" \
$DEST $PUSH \
--compressed-caching=false
+1 -14
View File
@@ -20,19 +20,6 @@ jobs:
v="$(awk '/^go /{print $2}' go.mod)"
curl -fsSL "https://go.dev/dl/go${v}.linux-amd64.tar.gz" | tar -C /usr/local -xz
echo /usr/local/go/bin >> "$GITHUB_PATH"
echo "GO_VERSION=$v" >> "$GITHUB_ENV"
# Read-only: the ci workflow's build job saves these caches on main.
- name: Restore caches
uses: actions/cache/restore@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.npm
key: build-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-${{ github.sha }}
restore-keys: |
build-go${{ env.GO_VERSION }}-${{ hashFiles('go.sum', 'package-lock.json') }}-
build-go${{ env.GO_VERSION }}-
- name: Check tag
run: |
go run ./tools/release check "$GITHUB_REF_NAME"
@@ -45,7 +32,7 @@ jobs:
exit 1
fi
- name: Build frontend
run: npm ci --no-audit --no-fund --prefer-offline && npm run build
run: npm ci --no-audit --no-fund && npm run build
- name: Package Helm chart
run: |
curl -fsSL "https://get.helm.sh/helm-v3.19.0-linux-amd64.tar.gz" | tar -xz -C /usr/local/bin --strip-components=1 linux-amd64/helm
-7
View File
@@ -1,7 +0,0 @@
# CI image: packs the binaries the build job already compiled (dist/linux_amd64)
# instead of building frontend and Go a second time. `make image` and local
# builds keep using Dockerfile, which builds everything from source.
FROM gcr.io/distroless/static-debian12:nonroot@sha256:afa5c872c891853ca7fcf1f12c3edb23f7eeef36189728842dd51042ff57f7ab
COPY dist/linux_amd64/ /usr/local/bin/
USER nonroot
ENTRYPOINT ["/usr/local/bin/api"]
+1 -1
View File
@@ -27,7 +27,7 @@ require (
github.com/rabbitmq/amqp091-go v1.17.0
github.com/redis/go-redis/v9 v9.23.0
github.com/twmb/franz-go v1.22.3
github.com/twmb/franz-go/pkg/kmsg v1.15.1
github.com/twmb/franz-go/pkg/kmsg v1.15.2
github.com/yuin/goldmark v1.8.7
go.mongodb.org/mongo-driver/v2 v2.5.0
go.uber.org/zap v1.28.0
+2 -2
View File
@@ -307,8 +307,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/twmb/franz-go v1.22.3 h1:RHe35s34pKefMLyL+ZYJ6mQVtfFZz4zHDHVkTyACur0=
github.com/twmb/franz-go v1.22.3/go.mod h1:OhbFLkvp6GLcN5daC7I4Q2z0W/rFP16HG+gTbe9CDC4=
github.com/twmb/franz-go/pkg/kmsg v1.15.1 h1:3sj7ekbH33t73nsBcHS0wtp/PyMIViHLNItZrE8V9zM=
github.com/twmb/franz-go/pkg/kmsg v1.15.1/go.mod h1:sGkGxKexpRLBThFHJLjjywcyfkK09qB/g+X+wFWZQ/A=
github.com/twmb/franz-go/pkg/kmsg v1.15.2 h1:uqpiNaTc2xbXNPXu1xFrOuUkQKwkwRmy43lOQINpqk0=
github.com/twmb/franz-go/pkg/kmsg v1.15.2/go.mod h1:sGkGxKexpRLBThFHJLjjywcyfkK09qB/g+X+wFWZQ/A=
github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY=
github.com/ugorji/go/codec v1.3.1/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=