From 6b53971d56c9a57453f196222188a89824325d95 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Fri, 20 Nov 2026 00:05:06 +1100 Subject: [PATCH] Import golib from github.com/IUCLabs --- .woodpecker/pre-commit.yaml | 2 -- .woodpecker/test.yaml | 2 -- Dockerfile | 4 ---- Makefile | 5 ----- README.md | 18 +----------------- go.mod | 2 +- go.sum | 4 ++-- internal/database/migrations_test.go | 2 +- internal/database/postgres.go | 2 +- 9 files changed, 6 insertions(+), 35 deletions(-) diff --git a/.woodpecker/pre-commit.yaml b/.woodpecker/pre-commit.yaml index 939e92c..6c4da6f 100644 --- a/.woodpecker/pre-commit.yaml +++ b/.woodpecker/pre-commit.yaml @@ -9,8 +9,6 @@ steps: commands: - uvx pre-commit run --all-files environment: - # golib lives on Gitea; skip the public proxy/sum db. - GOPRIVATE: git.unkin.net GOCACHEPROG: "go-cache-plugin --cache-dir=/tmp/gocache" GOCACHE_S3_BUCKET: gocache # Explicit region skips a GetBucketLocation probe RGW handles poorly. diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index e7964ba..4349e3b 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -9,8 +9,6 @@ steps: commands: - go test -race -count=1 ./pkg/... ./internal/... environment: - # golib lives on Gitea; skip the public proxy/sum db. - GOPRIVATE: git.unkin.net GOCACHEPROG: "go-cache-plugin --cache-dir=/tmp/gocache" GOCACHE_S3_BUCKET: gocache # Explicit region skips a GetBucketLocation probe RGW handles poorly. diff --git a/Dockerfile b/Dockerfile index aca988a..c6d9db9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,6 @@ RUN apk add --no-cache git WORKDIR /build -# golib is fetched straight from Gitea; the public proxy and sum db have no -# view of git.unkin.net modules. -ENV GOPRIVATE=git.unkin.net - COPY go.mod go.sum ./ RUN go mod download diff --git a/Makefile b/Makefile index 24b6a74..62b99aa 100644 --- a/Makefile +++ b/Makefile @@ -6,11 +6,6 @@ VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "0.0 GO_VERSION_REQUIRED := 1.23 GO_VERSION_ACTUAL := $(shell go version | sed 's/go version go\([0-9]*\.[0-9]*\).*/\1/') -# git.unkin.net modules (golib) are fetched straight from Gitea, never via the -# public proxy or sum db, which have no view of them. Exported here rather than -# written with `go env -w`, so a fresh checkout needs no machine-local setup. -export GOPRIVATE := git.unkin.net - check-go: @if [ "$$(printf '%s\n%s' "$(GO_VERSION_REQUIRED)" "$(GO_VERSION_ACTUAL)" | sort -V | head -1)" != "$(GO_VERSION_REQUIRED)" ]; then \ echo "ERROR: Go >= $(GO_VERSION_REQUIRED) required, found $(GO_VERSION_ACTUAL)"; exit 1; \ diff --git a/README.md b/README.md index 144d779..0a38f42 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ The SQL schema lives in `migrations/` as numbered `.sql` files, embedded into the binary and applied at startup before the server listens, so there is no mirrored copy of the schema in the deployment to drift out of sync. -The runner is [`golib/pg`](https://git.unkin.net/unkin/golib)'s `pg.NewMigrated` +The runner is [`golib/pg`](https://github.com/IUCLabs/golib)'s `pg.NewMigrated` — artifactapi owns the SQL, the shared library owns the mechanics. Each start takes `pg_advisory_lock` on a fixed key (FNV-1a/64 of the lock name @@ -223,22 +223,6 @@ make lint # golangci-lint + go vet make fmt # gofmt + goimports ``` -### `GOPRIVATE` - -artifactapi depends on `git.unkin.net/unkin/golib`, which is served by Gitea and -is unknown to `proxy.golang.org` / `sum.golang.org`. Module resolution therefore -needs: - -``` -export GOPRIVATE=git.unkin.net -``` - -The `Makefile` exports it for every target, and the `Dockerfile` and the -woodpecker Go steps set it themselves, so `make build|test|lint` and CI work on -a clean checkout. Only bare `go` commands run outside `make` need it in your -shell — set it there (or in your shell profile) rather than with `go env -w`, -which is machine state this repo cannot carry. - ### TUI ```bash diff --git a/go.mod b/go.mod index 35f761e..5534ab1 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.unkin.net/unkin/artifactapi go 1.25.9 require ( - git.unkin.net/unkin/golib v0.1.0 + github.com/IUCLabs/golib v0.3.0 github.com/cavaliergopher/rpm v1.3.0 github.com/charmbracelet/bubbletea v1.3.10 github.com/charmbracelet/lipgloss v1.1.0 diff --git a/go.sum b/go.sum index c525286..c7aef91 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,11 @@ dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= -git.unkin.net/unkin/golib v0.1.0 h1:OjKT5TO7PuXiYQ/1A+I4S2VZ/IsAxXY1reGWwasDMqE= -git.unkin.net/unkin/golib v0.1.0/go.mod h1:1e3PpMLEfa03Re/6tlk+I2XPWzBQMSpw2MB+Aw2lkX4= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/IUCLabs/golib v0.3.0 h1:zFtuQ/q/ls10zBs9SMTJZwmY2qeCQesTkFCdSAcjrWw= +github.com/IUCLabs/golib v0.3.0/go.mod h1:dUHf+bBtDUFAF9CP9zZHGAk+9oPDe9wOXX6GzSNqe2w= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= diff --git a/internal/database/migrations_test.go b/internal/database/migrations_test.go index 5e75c01..639981e 100644 --- a/internal/database/migrations_test.go +++ b/internal/database/migrations_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - "git.unkin.net/unkin/golib/pg" + "github.com/IUCLabs/golib/pg" "git.unkin.net/unkin/artifactapi/migrations" ) diff --git a/internal/database/postgres.go b/internal/database/postgres.go index fca5e5f..8c26b95 100644 --- a/internal/database/postgres.go +++ b/internal/database/postgres.go @@ -5,7 +5,7 @@ import ( "github.com/jackc/pgx/v5/pgxpool" - "git.unkin.net/unkin/golib/pg" + "github.com/IUCLabs/golib/pg" "git.unkin.net/unkin/artifactapi/migrations" )