30 Commits

Author SHA1 Message Date
argoyle c2c488b81d Merge pull request 'chore: migrate module path from gitlab.com to git.unbound.se' (#59) from migrate-to-gitea into main
dbsetup / test (push) Successful in 2m35s
dbsetup / vulnerabilities (push) Successful in 3m57s
Reviewed-on: #59
2026-01-09 07:08:05 +00:00
argoyle e201b66f3d chore: migrate module path from gitlab.com to git.unbound.se
dbsetup / test (pull_request) Successful in 2m0s
dbsetup / vulnerabilities (pull_request) Successful in 2m47s
- Update go.mod module path to git.unbound.se/unboundsoftware/dbsetup
- Remove gitlab-ci-linter pre-commit hook (not applicable for Gitea)
- Update go-imports local path for new domain
- Update CLAUDE.md documentation with new paths
- Remove GitLab-specific badges from README.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 08:01:34 +01:00
argoyle a353e018de Merge pull request 'chore(deps): update pre-commit hook golangci/golangci-lint to v2.8.0' (#58) from renovate/golangci-golangci-lint-2.x into main
dbsetup / vulnerabilities (push) Successful in 1m9s
dbsetup / test (push) Successful in 3m29s
Reviewed-on: #58
2026-01-09 04:11:53 +00:00
renovate 2af03bdf86 chore(deps): update pre-commit hook golangci/golangci-lint to v2.8.0
dbsetup / vulnerabilities (pull_request) Successful in 2m30s
dbsetup / test (pull_request) Successful in 2m34s
2026-01-08 21:12:04 +00:00
argoyle 064b0ada58 Merge pull request 'chore(deps): update actions/setup-go action to v6' (#57) from renovate/actions-setup-go-6.x into main
dbsetup / test (push) Successful in 3m52s
dbsetup / vulnerabilities (push) Successful in 4m49s
Reviewed-on: #57
2026-01-08 15:10:09 +00:00
renovate b62be83146 chore(deps): update actions/setup-go action to v6
dbsetup / test (pull_request) Successful in 4m20s
dbsetup / vulnerabilities (pull_request) Successful in 5m50s
2026-01-08 15:03:18 +00:00
argoyle fc25920790 Merge pull request 'chore(deps): update actions/checkout action to v6' (#56) from renovate/actions-checkout-6.x into main
dbsetup / vulnerabilities (push) Successful in 6m28s
dbsetup / test (push) Successful in 6m31s
Reviewed-on: #56
2026-01-08 14:10:06 +00:00
renovate ef8cba1131 chore(deps): update actions/checkout action to v6
dbsetup / test (pull_request) Successful in 3m25s
dbsetup / vulnerabilities (pull_request) Successful in 5m29s
2026-01-08 14:02:33 +00:00
argoyle 55da707280 Merge pull request 'feat: add Gitea Actions workflow' (#55) from feat/gitea-migration into main
dbsetup / test (push) Successful in 1m21s
dbsetup / vulnerabilities (push) Successful in 1m10s
Reviewed-on: #55
2026-01-08 13:26:28 +00:00
argoyle 2f41c9ef48 feat: add Gitea Actions workflow
dbsetup / vulnerabilities (pull_request) Successful in 1m32s
dbsetup / test (pull_request) Successful in 1m34s
2026-01-08 14:21:23 +01:00
argoyle d33029cb09 Merge branch 'renovate/golang-1.25.5' into 'main'
chore(deps): update golang:1.25.5 docker digest to ad03ba9

See merge request unboundsoftware/dbsetup!53
2025-12-30 15:55:34 +01:00
Renovate 2b7fa71993 chore(deps): update golang:1.25.5 docker digest to ad03ba9 2025-12-30 03:55:28 +00:00
argoyle 0f93e0723f Merge branch 'renovate/golang-1.25.5' into 'main'
chore(deps): update golang:1.25.5 docker digest to 0c27bcf

See merge request unboundsoftware/dbsetup!52
2025-12-09 09:53:14 +01:00
Renovate 710eb84f8a chore(deps): update golang:1.25.5 docker digest to 0c27bcf 2025-12-09 02:08:28 +00:00
argoyle c90ecd1247 Merge branch 'renovate/golangci-golangci-lint-2.x' into 'main'
chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.2

See merge request unboundsoftware/dbsetup!51
2025-12-08 09:40:13 +01:00
Renovate 6abde11fc5 chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.2 2025-12-07 16:55:50 +00:00
argoyle dd39632739 Merge branch 'renovate/golangci-golangci-lint-2.x' into 'main'
chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.1

See merge request unboundsoftware/dbsetup!50
2025-12-04 16:24:03 +01:00
Renovate f55d8afb36 chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.1 2025-12-04 14:56:07 +00:00
argoyle 89bc4c6640 Merge branch 'renovate/golangci-golangci-lint-2.x' into 'main'
chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.0

See merge request unboundsoftware/dbsetup!49
2025-12-04 08:27:08 +01:00
Renovate f25317e79e chore(deps): update pre-commit hook golangci/golangci-lint to v2.7.0 2025-12-03 19:55:35 +00:00
argoyle 8ab056aad0 Merge branch 'renovate/golang-1.x' into 'main'
chore(deps): update golang docker tag to v1.25.5

See merge request unboundsoftware/dbsetup!48
2025-12-02 19:38:37 +01:00
Renovate 26e03cce50 chore(deps): update golang docker tag to v1.25.5 2025-12-02 18:07:36 +00:00
argoyle a041827a5b Merge branch 'renovate/gitleaks-gitleaks-8.x' into 'main'
chore(deps): update pre-commit hook gitleaks/gitleaks to v8.30.0

See merge request unboundsoftware/dbsetup!47
2025-11-27 00:03:42 +01:00
Renovate 36a7477f42 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.30.0 2025-11-26 18:55:41 +00:00
argoyle 5218833229 Merge branch 'renovate/gitleaks-gitleaks-8.x' into 'main'
chore(deps): update pre-commit hook gitleaks/gitleaks to v8.29.1

See merge request unboundsoftware/dbsetup!46
2025-11-20 09:19:37 +01:00
Renovate 699a879a75 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.29.1 2025-11-19 21:55:08 +00:00
argoyle 704a6c995d Merge branch 'renovate/golang-1.25.4' into 'main'
chore(deps): update golang:1.25.4 docker digest to efe81fa

See merge request unboundsoftware/dbsetup!45
2025-11-18 16:19:42 +01:00
Renovate 3676693ebb chore(deps): update golang:1.25.4 docker digest to efe81fa 2025-11-18 11:55:15 +00:00
argoyle 2f338c102d Merge branch 'renovate/golangci-golangci-lint-2.x' into 'main'
chore(deps): update pre-commit hook golangci/golangci-lint to v2.6.2

See merge request unboundsoftware/dbsetup!43
2025-11-14 16:20:36 +01:00
Renovate c2d07e9c93 chore(deps): update pre-commit hook golangci/golangci-lint to v2.6.2 2025-11-14 13:54:54 +00:00
7 changed files with 104 additions and 16 deletions
+15
View File
@@ -0,0 +1,15 @@
{
"permissions": {
"allow": [
"Bash(ls:*)",
"Bash(git -C /Users/argoyle/Source/Unbound/dbsetup log --oneline -20)",
"Bash(find:*)",
"WebSearch",
"Bash(git add:*)",
"Bash(pre-commit run:*)",
"Bash(go build:*)",
"Bash(go test:*)",
"Bash(but status)"
]
}
}
+30
View File
@@ -0,0 +1,30 @@
name: dbsetup
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Run tests
run: go test -race -coverprofile=coverage.txt ./...
vulnerabilities:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Check vulnerabilities
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
+2 -2
View File
@@ -7,7 +7,7 @@ include:
- project: unboundsoftware/ci-templates
file: Pre-Commit-Go.gitlab-ci.yml
image: amd64/golang:1.25.4@sha256:2476911a55fb171469c5266ee3d81e180fd25592c4f74ae79488fb49578bdc96
image: amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63
stages:
- deps
@@ -32,7 +32,7 @@ test:
vulnerabilities:
stage: test
image: amd64/golang:1.25.4@sha256:2476911a55fb171469c5266ee3d81e180fd25592c4f74ae79488fb49578bdc96
image: amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63
script:
- go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./...
+3 -10
View File
@@ -10,13 +10,6 @@ repos:
args:
- --allow-multiple-documents
- id: check-added-large-files
- repo: https://gitlab.com/devopshq/gitlab-ci-linter
rev: v1.0.6
hooks:
- id: gitlab-ci-linter
args:
- --project
- unboundsoftware/dbsetup
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.23.0
hooks:
@@ -30,17 +23,17 @@ repos:
- id: go-imports
args:
- -local
- gitlab.com/unboundsoftware/shiny/presenter
- git.unbound.se/unboundsoftware/shiny/presenter
- repo: https://github.com/lietu/go-pre-commit
rev: v1.0.0
hooks:
- id: go-test
- id: gofumpt
- repo: https://github.com/golangci/golangci-lint
rev: v2.6.1
rev: v2.8.0
hooks:
- id: golangci-lint-full
- repo: https://github.com/gitleaks/gitleaks
rev: v8.29.0
rev: v8.30.0
hooks:
- id: gitleaks
+53
View File
@@ -0,0 +1,53 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
**dbsetup** is a Go helper module for database connection pool initialization with OpenTelemetry (OTEL) instrumentation. It wraps database connections with OTEL to automatically add SQL queries to tracing spans.
- Module path: `git.unbound.se/unboundsoftware/dbsetup`
- Primary dependencies: sqlx, goose (migrations), otelsqlx (OTEL wrapper)
## Common Commands
```bash
# Download dependencies
go mod download
# Run tests with race detection and coverage
CGO_ENABLED=1 go test -race -coverprofile=coverage.txt ./...
# Generate coverage report
go tool cover -html=coverage.txt -o coverage.html
# Check for security vulnerabilities
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
# Run pre-commit hooks (add all files first)
git add -A && pre-commit run --all-files
```
## Architecture
Single-package module with one source file (`database.go`):
- **DatabaseConfig**: Configuration struct with connection URL, driver name, and pool settings. Uses struct tags compatible with kong CLI parser.
- **Database**: Main handler providing:
- `SetupDB()` - Validates database connection and returns Database instance
- `Connect()` - Creates OTEL-wrapped connection pool via otelsqlx
- `RunMigrations()` - Executes goose migrations from an `fs.FS` filesystem
## Code Quality
Pre-commit hooks enforce:
- gofumpt formatting (stricter than gofmt)
- golangci-lint
- go-imports with local path `git.unbound.se/unboundsoftware/`
- Conventional commits format (feat:, fix:, chore:, etc.)
- Gitleaks for secret detection
## CI/CD
GitLab CI pipeline runs: dependency download → tests with race detector → vulnerability scanning → Codecov upload.
-3
View File
@@ -2,6 +2,3 @@
Helper module for setting up database connection pool using an
OTEL-wrapper which adds the actual query to a span.
[![Build Status](https://gitlab.com/unboundsoftware/dbsetup/badges/main/pipeline.svg)](https://gitlab.com/unboundsoftware/dbsetup/commits/main)
[![codecov](https://codecov.io/gl/unboundsoftware/dbsetup/branch/main/graph/badge.svg?token=XHA5XE1UVL)](https://codecov.io/gl/unboundsoftware/dbsetup)
+1 -1
View File
@@ -1,4 +1,4 @@
module gitlab.com/unboundsoftware/dbsetup
module git.unbound.se/unboundsoftware/dbsetup
go 1.24.4