No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Gilles Fritz a66132890e
All checks were successful
ci / test (push) Successful in 2m34s
ci / release (push) Has been skipped
Send publish reports to Argus from the release job (#8)
Closes #7

Monitoring plan, phase 5 rollout, same as the pilots argus/backend#45 and argus/frontend#35.

## Changes (`.forgejo/workflows/ci.yml`)
- New step "Collect publish details for Argus": `/tmp/dependencies.txt` = the direct requirements of `go.mod` (`module version` lines). A Go module has no artifact of its own, so the report carries the version, the release page and the dependencies. There is no devel snapshot here, so only the numbered release sends a report.
- The publish-release call (numbered release; no devel snapshot here) gets `ARGUS_UPLOAD_TOKEN: ${{ secrets.ARGUS_UPLOAD_TOKEN }}` and `--dependencies /tmp/dependencies.txt`. A failed upload only warns, the release itself is unaffected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA
Reviewed-on: #8
2026-10-30 08:13:21 +00:00
.forgejo/workflows Send publish reports to Argus from the release job (#8) 2026-10-30 08:13:21 +00:00
docs docs: logo éclairci (palette plus claire, à la demande) 2026-09-29 00:42:05 +02:00
.gitignore Migrate onto Argus for test/coverage reporting 2026-10-16 13:07:26 +02:00
client.go Translate README and source comments to English 2026-09-29 00:58:15 +02:00
config.go Translate README and source comments to English 2026-09-29 00:58:15 +02:00
COPYING Passe la licence de GPLv3 à LGPLv3 2026-09-28 23:36:57 +02:00
COPYING.LESSER Passe la licence de GPLv3 à LGPLv3 2026-09-28 23:36:57 +02:00
go.mod Migrate onto Argus for test/coverage reporting 2026-10-16 13:07:26 +02:00
go.sum Migrate onto Argus for test/coverage reporting 2026-10-16 13:07:26 +02:00
middleware.go Translate README and source comments to English 2026-09-29 00:58:15 +02:00
README.md Migrate onto Argus for test/coverage reporting 2026-10-16 13:07:26 +02:00
registry.go Translate README and source comments to English 2026-09-29 00:58:15 +02:00
registry_test.go Fix module path and add CI/release pipeline 2026-09-26 14:20:06 +02:00
renovate.json Renovate: run go mod tidy after Go updates 2026-10-24 22:11:22 +02:00

vieuxhibou-gin

CI Coverage Tests License: LGPL v3

Structured logging for Gin services: a hot-reloadable slog logger registry (NOTSET/DEBUG/INFO/WARNING/ERROR/ CRITICAL levels, a table aligned with vieuxhibou-django so both share the same dashboard), a middleware exposing a /loggers/ API to read/change them, and optional registration/heartbeat with a central vieuxhibou server.

Installation

go get git.stationmyr.net/Gilles/vieuxhibou-gin@latest

(requires GOPROXY to point at this Forgejo instance's Go registry, or direct VCS mode -- private instance).

Usage

import "git.stationmyr.net/Gilles/vieuxhibou-gin"

func main() {
    vieuxhibou.Configure(vieuxhibou.Config{
        ServiceName: "my-service",
        Env:         "prod",
        Version:     "1.2.3",
        // Empty disables registration/heartbeat.
        ServerURL:   "https://vieuxhibou.example.org",
        SelfURL:     "https://my-service.example.org",
        SharedToken: os.Getenv("VIEUXHIBOU_SHARED_TOKEN"),
    })

    log := vieuxhibou.Logger("myapp.tasks")
    log.Info("started")

    router := gin.Default()
    vh := router.Group("/vieuxhibou")
    vieuxhibou.Mount(vh) // GET/POST /vieuxhibou/loggers/...

    ctx, cancel := context.WithCancel(context.Background())
    defer cancel()
    go vieuxhibou.StartHeartbeat(ctx, slog.Default())

    router.Run()
}

The /loggers/ API (reading and writing levels) only has shared-token authentication (SharedToken, no notion of a user session): only expose it behind a forward-auth layer (Traefik/Authentik) if direct human access is wanted.

Release

No build/publish step for untagged code: go get git.stationmyr.net/Gilles/vieuxhibou-gin@master already resolves a pseudo-version automatically. A real release is a semver tag (vX.Y.Z), pushed via a manual trigger of the ci workflow (Actions tab → "Run workflow" → version field); Forgejo's built-in Go proxy then serves it on its own.

Development

gofmt -l .                                              # formatting
go vet ./...                                            # static analysis
go test ./...                                           # tests
go tool gotestsum -- ./... -coverprofile=coverage.out   # tests + coverage, JUnit-ready (CI)
go tool cover -html=coverage.out                        # coverage report in the browser

License

LGPLv3, see COPYING + COPYING.LESSER -- chosen over GPLv3 precisely because this package is meant to be imported (hence "linked", in the LGPL sense) by projects that have no reason to be GPL themselves.