18 Commits

Author SHA1 Message Date
argoyle ca8c3a9e1b Merge pull request 'ci: add code coverage integration' (#96) from ci-coverage-integration into main
Release / release (push) Successful in 3m26s
otelsetup / test (push) Successful in 5m40s
otelsetup / vulnerabilities (push) Successful in 6m13s
pre-commit / pre-commit (push) Successful in 8m46s
Reviewed-on: #96
2026-01-28 12:37:47 +00:00
argoyle 8540caba8c ci: add code coverage integration
otelsetup / vulnerabilities (pull_request) Successful in 2m49s
otelsetup / test (pull_request) Successful in 4m11s
pre-commit / pre-commit (pull_request) Successful in 6m22s
Add go-test-coverage for coverage threshold enforcement. Coverage data
is uploaded as artifacts on main branch and compared against baseline
in PRs using shell script that gracefully handles first run without
baseline. PR comments show coverage percentage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 13:03:07 +01:00
argoyle a66446b1df Merge pull request 'chore: remove GitLab CI configuration' (#94) from remove-gitlab-ci into main
Release / release (push) Successful in 2m29s
otelsetup / vulnerabilities (push) Successful in 6m43s
otelsetup / test (push) Successful in 8m58s
pre-commit / pre-commit (push) Successful in 18m53s
Reviewed-on: #94
2026-01-19 06:54:59 +00:00
argoyle 06aaa0c202 chore: remove GitLab CI configuration
otelsetup / vulnerabilities (pull_request) Successful in 1m43s
otelsetup / test (pull_request) Successful in 7m31s
pre-commit / pre-commit (pull_request) Successful in 8m33s
2026-01-18 20:36:15 +01:00
renovate bfbe6a09e5 chore(deps): update golang docker tag to v1.25.6 (#93)
Release / release (push) Failing after 41s
otelsetup / vulnerabilities (push) Successful in 1m39s
otelsetup / test (push) Successful in 2m48s
pre-commit / pre-commit (push) Successful in 4m7s
2026-01-17 18:39:29 +00:00
renovate 026a08d54e chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.24.0 (#92)
Release / release (push) Failing after 1m14s
otelsetup / test (push) Successful in 2m40s
otelsetup / vulnerabilities (push) Successful in 3m21s
pre-commit / pre-commit (push) Successful in 10m9s
2026-01-13 21:31:21 +00:00
renovate 10282596e2 chore(deps): update golang:1.25.5 docker digest to 3a01526 (#91)
Release / release (push) Failing after 1m10s
otelsetup / vulnerabilities (push) Successful in 6m7s
otelsetup / test (push) Successful in 8m16s
pre-commit / pre-commit (push) Successful in 8m56s
2026-01-13 06:22:24 +00:00
renovate 8271687580 fix(deps): update module github.com/99designs/gqlgen to v0.17.86 (#90)
Release / release (push) Failing after 2m27s
otelsetup / vulnerabilities (push) Successful in 6m19s
otelsetup / test (push) Successful in 7m0s
pre-commit / pre-commit (push) Successful in 9m23s
2026-01-12 02:20:08 +00:00
renovate ae2ca7265b fix(deps): update module github.com/99designs/gqlgen to v0.17.86 (#90)
otelsetup / test (push) Has been cancelled
otelsetup / vulnerabilities (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Release / release (push) Has been cancelled
2026-01-12 02:20:04 +00:00
argoyle 608ad2b582 Merge pull request 'chore(release): prepare for v0.2.1' (#88) from next-release into main
Release / release (push) Successful in 46s
otelsetup / vulnerabilities (push) Successful in 1m47s
otelsetup / test (push) Successful in 2m12s
pre-commit / pre-commit (push) Successful in 4m5s
Reviewed-on: #88
2026-01-09 14:07:26 +00:00
releaser 7c1b3bf801 chore(release): prepare for v0.2.1
otelsetup / vulnerabilities (pull_request) Successful in 6m26s
otelsetup / test (pull_request) Successful in 7m1s
pre-commit / pre-commit (pull_request) Successful in 12m15s
2026-01-09 13:54:38 +00:00
releaser 95d1a52df6 chore(release): prepare for v0.2.1 2026-01-09 13:54:31 +00:00
argoyle 23c3deb623 Merge pull request 'chore: migrate module path to gitea.unbound.se' (#89) from migrate-to-gitea into main
Release / release (push) Successful in 3m3s
otelsetup / vulnerabilities (push) Successful in 5m3s
otelsetup / test (push) Successful in 5m38s
pre-commit / pre-commit (push) Successful in 10m15s
Reviewed-on: #89
2026-01-09 13:49:55 +00:00
argoyle 450cc99f41 chore: migrate module path to gitea.unbound.se
otelsetup / vulnerabilities (pull_request) Successful in 2m58s
otelsetup / test (pull_request) Successful in 3m20s
pre-commit / pre-commit (pull_request) Successful in 8m10s
Update module path from git.unbound.se to gitea.unbound.se for Go module
discovery over HTTPS.
2026-01-09 14:30:41 +01:00
releaser 2b5127d91a chore(release): prepare for v0.2.1
otelsetup / vulnerabilities (pull_request) Successful in 3m42s
otelsetup / test (pull_request) Successful in 4m6s
pre-commit / pre-commit (pull_request) Successful in 5m40s
2026-01-09 09:30:28 +00:00
releaser 8b71dd6f20 chore(release): prepare for v0.2.1 2026-01-09 09:30:24 +00:00
argoyle 467bdd7b69 Merge pull request 'chore(deps): update actions/setup-python action to v6' (#87) from renovate/actions-setup-python-6.x into main
otelsetup / vulnerabilities (push) Successful in 1m16s
Release / release (push) Successful in 1m15s
otelsetup / test (push) Successful in 2m37s
pre-commit / pre-commit (push) Successful in 7m24s
Reviewed-on: #87
2026-01-09 09:28:31 +00:00
renovate 689df41ded chore(deps): update actions/setup-python action to v6
otelsetup / vulnerabilities (pull_request) Successful in 1m7s
otelsetup / test (pull_request) Successful in 1m49s
pre-commit / pre-commit (pull_request) Successful in 3m51s
2026-01-09 09:20:53 +00:00
10 changed files with 87 additions and 50 deletions
+55
View File
@@ -17,6 +17,61 @@ jobs:
- name: Run tests - name: Run tests
run: go test -race -coverprofile=coverage.txt ./... run: go test -race -coverprofile=coverage.txt ./...
- name: Check coverage
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yml
# Download baseline coverage from main branch (for PRs)
- name: Download baseline coverage
if: gitea.event_name == 'pull_request'
uses: actions/download-artifact@v3
with:
name: coverage-baseline
path: ./baseline
continue-on-error: true
# Compare coverage against baseline (for PRs)
- name: Compare coverage
if: gitea.event_name == 'pull_request'
run: |
CURRENT=$(go tool cover -func=coverage.txt | grep "^total:" | awk '{print $NF}' | tr -d '%')
if [ -f ./baseline/coverage.txt ]; then
BASE=$(go tool cover -func=./baseline/coverage.txt | grep "^total:" | awk '{print $NF}' | tr -d '%')
echo "Base coverage: ${BASE}%"
echo "Current coverage: ${CURRENT}%"
if [ "$(echo "$CURRENT < $BASE" | bc -l)" -eq 1 ]; then
echo "::error::Coverage decreased from ${BASE}% to ${CURRENT}%"
exit 1
fi
echo "Coverage maintained or improved: ${BASE}% -> ${CURRENT}%"
else
echo "No baseline coverage found, skipping comparison"
echo "Current coverage: ${CURRENT}%"
fi
# Upload coverage as baseline (only on main)
- name: Upload coverage baseline
if: gitea.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: coverage-baseline
path: coverage.txt
retention-days: 90
# Post coverage to PR comment
- name: Post coverage comment
if: gitea.event_name == 'pull_request'
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_URL: ${{ gitea.server_url }}
run: |
COVERAGE=$(go tool cover -func=coverage.txt | grep "^total:" | awk '{print $NF}')
curl -X POST "${GITEA_URL}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.event.pull_request.number }}/comments" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"body\": \"## Coverage Report\n\nTotal coverage: **${COVERAGE}**\"}"
vulnerabilities: vulnerabilities:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-go@v6 - uses: actions/setup-go@v6
with: with:
go-version: stable go-version: stable
- uses: actions/setup-python@v5 - uses: actions/setup-python@v6
with: with:
python-version: '3.14' python-version: '3.14'
- name: Install goimports - name: Install goimports
-38
View File
@@ -1,38 +0,0 @@
include:
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
- project: unboundsoftware/ci-templates
file: Defaults.gitlab-ci.yml
- project: unboundsoftware/ci-templates
file: Release.gitlab-ci.yml
- project: unboundsoftware/ci-templates
file: Pre-Commit-Go.gitlab-ci.yml
image: amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63
stages:
- deps
- test
deps:
stage: deps
script:
- go mod download
test:
stage: test
dependencies:
- deps
script:
- CGO_ENABLED=1 go test -mod=readonly -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=$(go list ./... | tr '\n' , | sed 's/,$//') ./...
- go tool cover -html=coverage.txt -o coverage.html
- go tool cover -func=coverage.txt
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- chmod +x codecov
- ./codecov -t ${CODECOV_TOKEN} -R $CI_PROJECT_DIR -C $CI_COMMIT_SHA -r $CI_PROJECT_PATH
vulnerabilities:
stage: test
image: amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63
script:
- go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./...
+2 -2
View File
@@ -11,7 +11,7 @@ repos:
- --allow-multiple-documents - --allow-multiple-documents
- id: check-added-large-files - id: check-added-large-files
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.23.0 rev: v9.24.0
hooks: hooks:
- id: commitlint - id: commitlint
stages: [ commit-msg ] stages: [ commit-msg ]
@@ -23,7 +23,7 @@ repos:
- id: go-imports - id: go-imports
args: args:
- -local - -local
- git.unbound.se/shiny/otelsetup - gitea.unbound.se/shiny/otelsetup
- 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:
+13
View File
@@ -0,0 +1,13 @@
# Coverage configuration for go-test-coverage
# https://github.com/vladopajic/go-test-coverage
profile: coverage.txt
threshold:
file: 0
package: 0
total: 0
exclude:
paths:
- _test\.go$
+1 -1
View File
@@ -1,3 +1,3 @@
{ {
"version": "v0.2.0" "version": "v0.2.1"
} }
+7
View File
@@ -2,6 +2,13 @@
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.2.1] - 2026-01-09
### ⚙️ Miscellaneous Tasks
- *(deps)* Update actions/setup-python action to v6
- Migrate module path to gitea.unbound.se
## [0.2.0] - 2026-01-09 ## [0.2.0] - 2026-01-09
### 🚀 Features ### 🚀 Features
+1 -1
View File
@@ -17,7 +17,7 @@ Provides standardized OpenTelemetry configuration for tracing, metrics, and logg
### Usage ### Usage
```go ```go
import "git.unbound.se/shiny/otelsetup" import "gitea.unbound.se/shiny/otelsetup"
// Bootstrap OpenTelemetry SDK // Bootstrap OpenTelemetry SDK
shutdown, err := otelsetup.SetupOTelSDK(ctx, enabled, serviceName, buildVersion, environment) shutdown, err := otelsetup.SetupOTelSDK(ctx, enabled, serviceName, buildVersion, environment)
+3 -3
View File
@@ -1,9 +1,9 @@
module git.unbound.se/shiny/otelsetup module gitea.unbound.se/shiny/otelsetup
go 1.24.3 go 1.24.3
require ( require (
github.com/99designs/gqlgen v0.17.85 github.com/99designs/gqlgen v0.17.86
go.opentelemetry.io/otel v1.39.0 go.opentelemetry.io/otel v1.39.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.39.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.39.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0
@@ -30,7 +30,7 @@ require (
go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect
golang.org/x/net v0.48.0 // indirect golang.org/x/net v0.48.0 // indirect
golang.org/x/sys v0.39.0 // indirect golang.org/x/sys v0.39.0 // indirect
golang.org/x/text v0.32.0 // indirect golang.org/x/text v0.33.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/grpc v1.77.0 // indirect google.golang.org/grpc v1.77.0 // indirect
+4 -4
View File
@@ -1,5 +1,5 @@
github.com/99designs/gqlgen v0.17.85 h1:EkGx3U2FDcxQm8YDLQSpXIAVmpDyZ3IcBMOJi2nH1S0= github.com/99designs/gqlgen v0.17.86 h1:C8N3UTa5heXX6twl+b0AJyGkTwYL6dNmFrgZNLRcU6w=
github.com/99designs/gqlgen v0.17.85/go.mod h1:yvs8s0bkQlRfqg03YXr3eR4OQUowVhODT/tHzCXnbOU= github.com/99designs/gqlgen v0.17.86/go.mod h1:KTrPl+vHA1IUzNlh4EYkl7+tcErL3MgKnhHrBcV74Fw=
github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM= github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM=
github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU= github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
@@ -67,8 +67,8 @@ golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls= google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=