28 Commits

Author SHA1 Message Date
argoyle 54aad809cc Merge pull request 'chore(release): prepare for v0.1.0' (#45) from next-release into main
dbsetup / vulnerabilities (push) Successful in 2m13s
Release / release (push) Successful in 3m42s
pre-commit / pre-commit (push) Successful in 5m43s
dbsetup / test (push) Successful in 7m19s
Reviewed-on: #45
2026-01-09 08:01:40 +00:00
releaser dd09c790bb chore(release): prepare for v0.1.0 2026-01-09 07:59:22 +00:00
releaser 95201cc5ad chore(release): prepare for v0.1.0 2026-01-09 07:59:17 +00:00
argoyle e28661b667 Merge pull request 'ci: add pre-commit and release workflows' (#60) from add-workflows into main
Release / release (push) Successful in 1m36s
dbsetup / vulnerabilities (push) Successful in 2m25s
dbsetup / test (push) Successful in 2m26s
pre-commit / pre-commit (push) Has been cancelled
Reviewed-on: #60
2026-01-09 07:58:05 +00:00
argoyle c443c48690 ci: add pre-commit and release workflows
dbsetup / vulnerabilities (pull_request) Successful in 5m29s
dbsetup / test (pull_request) Successful in 5m35s
pre-commit / pre-commit (pull_request) Successful in 3m38s
- Add pre-commit workflow to run hooks on PRs and main branch pushes
- Add release workflow using shared unboundsoftware release template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 08:41:38 +01:00
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
Unbound Release d61efd3b0d chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release af6597b216 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 95d4d17722 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 8777a59ced chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 70a557afce chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 82e94c7fbb chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 26436c1c91 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 14ad17748b chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 0ab624be6b chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 18250f9863 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 36ca2ca0fe chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 6206c37aac chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release f63c8fb341 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 2a5340c8c6 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release a3f9974186 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 1c26beed2b chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release ff5b418602 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 82a08a50e6 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 842b1794e0 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release cecab087c8 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
Unbound Release 6c01846189 chore(release): prepare for v0.0.4 2025-12-30 15:04:02 +00:00
9 changed files with 132 additions and 14 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)"
]
}
}
+9
View File
@@ -0,0 +1,9 @@
name: Release
on:
push:
branches: [main]
jobs:
release:
uses: unboundsoftware/shared-workflows/.gitea/workflows/Release.yml@main
+25
View File
@@ -0,0 +1,25 @@
name: pre-commit
permissions: read-all
on:
pull_request:
push:
branches:
- main
jobs:
pre-commit:
runs-on: ubuntu-latest
env:
SKIP: no-commit-to-branch
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
- uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- uses: pre-commit/action@v3.0.1
+1 -8
View File
@@ -10,13 +10,6 @@ repos:
args: args:
- --allow-multiple-documents - --allow-multiple-documents
- id: check-added-large-files - 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 - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.23.0 rev: v9.23.0
hooks: hooks:
@@ -30,7 +23,7 @@ repos:
- id: go-imports - id: go-imports
args: args:
- -local - -local
- gitlab.com/unboundsoftware/shiny/presenter - git.unbound.se/unboundsoftware/shiny/presenter
- repo: https://github.com/lietu/go-pre-commit - repo: https://github.com/lietu/go-pre-commit
rev: v1.0.0 rev: v1.0.0
hooks: hooks:
+3 -1
View File
@@ -1 +1,3 @@
{"version":"v0.0.3"} {
"version": "v0.1.0"
}
+25 -1
View File
@@ -2,7 +2,31 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.0.3] - 2025-11-05 ## [0.1.0] - 2026-01-09
### 🚀 Features
- Add Gitea Actions workflow
### ⚙️ Miscellaneous Tasks
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.6.2
- *(deps)* Update golang:1.25.4 docker digest to efe81fa
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.29.1
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.30.0
- *(deps)* Update golang docker tag to v1.25.5
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.2
- *(deps)* Update golang:1.25.5 docker digest to 0c27bcf
- *(deps)* Update golang:1.25.5 docker digest to ad03ba9
- *(deps)* Update actions/checkout action to v6
- *(deps)* Update actions/setup-go action to v6
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.8.0
- Migrate module path from gitlab.com to git.unbound.se
- Add pre-commit and release workflows
## [0.0.3] - 2025-11-13
### 🐛 Bug Fixes ### 🐛 Bug Fixes
+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 Helper module for setting up database connection pool using an
OTEL-wrapper which adds the actual query to a span. 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 go 1.24.4