Enhance CI pipeline and documentation

- Update Drone CI configuration to include triggers for push and tag events.
- Improve test coverage commands and add coverage checks.
- Introduce release notes generation and packaging steps in the CI pipeline.
- Add comprehensive release documentation and a checklist for the release process.
- Implement tests for GELF logging functionality.
- Update dependencies in go.mod and go.sum for better compatibility.
- Add scripts for checking coverage and generating release notes.
This commit is contained in:
2026-03-29 17:53:05 +02:00
parent 66789d67ad
commit f29bea3c1f
10 changed files with 606 additions and 22 deletions
+13 -3
View File
@@ -2,11 +2,13 @@
## Purpose
This Definition of Done defines the minimum quality bar for every completed change in this repository.
This Definition of Done defines the minimum quality bar for every
completed change in this repository.
## Mandatory Criteria
1. Tests
- Every code change is covered by tests where applicable.
- New functionality includes new tests.
- Bug fixes include at least one regression test.
@@ -14,10 +16,12 @@ This Definition of Done defines the minimum quality bar for every completed chan
- Automated test coverage is at least 80%.
1. Functional documentation
- Implemented functionality is documented.
- Public API-relevant changes are reflected in README and/or docs.
1. Documentation standards
- Documentation is written in English.
- Documentation files are placed under `docs/`.
- Exceptions: `README.md` and `AGENTS.md` remain at repository root.
@@ -25,17 +29,22 @@ This Definition of Done defines the minimum quality bar for every completed chan
## Technical Completion Criteria
1. Build and test status
- The project builds successfully.
- Relevant test commands run successfully.
1. No unresolved critical issues
- No new blocking errors are introduced.
- Known non-blocking warnings are acceptable only if unrelated to the change or documented.
- Known non-blocking warnings are acceptable only if unrelated to the
change or documented.
1. SonarQube status
- No SonarQube errors are present.
1. Documentation links and structure
- Links to moved or newly added docs are valid.
- Documentation structure remains consistent with project rules.
@@ -47,6 +56,7 @@ This Definition of Done defines the minimum quality bar for every completed chan
- [ ] Automated test coverage is at least 80%.
- [ ] Functionality is documented.
- [ ] Documentation is in English.
- [ ] Documentation is located under `docs/` (except `README.md` and `AGENTS.md`).
- [ ] Documentation is located under `docs/` (except `README.md` and
`AGENTS.md`).
- [ ] No SonarQube errors are present.
- [ ] No critical regressions found.
+115
View File
@@ -0,0 +1,115 @@
# Releasing go-lib/gelf
This document describes the process for creating a release of the
`go-lib/gelf` library.
## Overview
Releases in this project are managed via Git tags. When you push a
tag matching the pattern `v*` (for example, `v0.2.0`), the Drone
pipeline automatically:
1. Runs quality checks (tests, coverage gate, vet, vulnerability scan)
2. Generates release notes from commits
3. Creates a source archive (`sources.tar.gz`)
4. Publishes a release to Gitea with attached artifacts
## Versioning
This library follows semantic versioning: `MAJOR.MINOR.PATCH`
(for example, `v1.2.3`).
- `v1.0.0`: breaking API changes
- `v1.1.0`: backward-compatible features
- `v1.0.1`: backward-compatible fixes
## Prerequisites
Before creating a release, ensure:
1. Working tree is clean (`git status`)
2. Tests pass locally (`go test ./...`)
3. Coverage is at least 80%
4. Dependencies are tidy (`go mod tidy`)
5. Documentation is up to date (README/docs)
## Create a Release
### 1. Prepare (optional)
Update docs, examples, or changelog if needed:
```bash
git add README.md docs/
git commit -m "docs: prepare release"
```
### 2. Create tag
```bash
git tag -a v0.2.0 -m "Release v0.2.0"
```
### 3. Push tag
```bash
git push origin v0.2.0
```
### 4. Verify pipeline and release
After pushing the tag, verify in Drone and Gitea:
- Pipeline succeeded for tag build
- Gitea release exists with artifacts:
- `.build/coverage.txt`
- `.build/sources.tar.gz`
- `.build/release-notes.md`
## Install Released Version
```bash
# latest
go get scm.yoorie.de/go-lib/gelf
# specific
go get scm.yoorie.de/go-lib/gelf@v0.2.0
```
## Troubleshooting
### Coverage below threshold
Run locally and inspect uncovered code:
```bash
go test -v -coverprofile .build/coverage.out ./...
go tool cover -func .build/coverage.out
```
### Release step fails
Common causes:
- Missing Drone secret `gitea_token`
- Tag does not match `v*`
- Earlier pipeline step failed
### Wrong tag pushed
```bash
git tag -d v0.2.0
git push origin :refs/tags/v0.2.0
```
Then create and push the corrected tag.
## Release Checklist
- [ ] Tests pass locally
- [ ] Coverage is at least 80%
- [ ] `go vet ./...` passes
- [ ] `govulncheck ./...` is clean or reviewed
- [ ] Tag `vX.Y.Z` created and pushed
- [ ] Drone pipeline succeeded
- [ ] Gitea release contains expected artifacts