Commit Graph
6 Commits
Author SHA1 Message Date
lukaszraczylo f06f5561d4 fix: make internals yaegi-interpretable for traefik plugin consumers
Swap atomic.Pointer[string] for a mutex-guarded string, atomic.Bool for the function-based sync/atomic int32 API, two range-over-int loops for classic index loops, and drop the init() that seeded the endpoint pointer. No public API or runtime behaviour change; go test, go vet, and golangci-lint all pass.

Rationale: the traefikoidc Traefik plugin vendors and interprets dependency source via Yaegi, which on several Traefik runtimes cannot interpret generic stdlib types or range-over-int. This keeps the package importable from that plugin without altering what it does.
2026-05-30 12:35:42 +01:00
lukaszraczylo 1fb9f14efa feat: SendForModule + tighten validVersion to match receiver
Add SendForModule/ResolveModuleVersion helpers so consumers no longer
need to hand-maintain a bumped version constant; the library resolves
the running module version from runtime/debug.BuildInfo (Deps[] for
library consumers, Main for go-install'ed binaries) and falls back to
the caller-supplied string otherwise. Leading "v" is stripped to match
the canonical wire form the receiver stores.

Tighten validVersion: previously any [A-Za-z0-9._+-] passed client-side
but the receiver rejects anything that does not start with a digit, so
"dev"/"next"/"latest" pings were silently 400'd at the edge with no
client signal. Now validVersion enforces the same SemVer-ish shape as
the receiver (with optional leading v stripped), so junk versions drop
at the source without a wasted HTTP roundtrip. normalizeVersion strips
the leading v on the wire so callers may pass either form.

New tests cover the resolver fallback path, leading-v normalization,
and rejection of non-semver junk. Existing test contract (Send accepts
"v1.0.0", "1.0.0+meta", etc.) is preserved.
2026-05-22 23:31:29 +01:00
lukaszraczylo 8b8c92fb3c ci: bump Go to 1.25.x + golangci-lint-action to v7
First CI run failed because:
- staticcheck v0.7.0, gosec, govulncheck (all @latest) require Go >= 1.25
- golangci-lint-action v6 does not support golangci-lint v2

Aligns Go version with the rest of the consumer projects (go-telegram,
mcp-filepuff, kportal, lolcathost all on 1.25.x).
2026-05-21 04:11:21 +01:00
lukaszraczylo 789324a3d4 ci: mirror go-telegram's release pipeline with auto-tagging
Replicates the standard CI + release process from go-telegram:
- vet, staticcheck, govulncheck, gosec, golangci-lint, race-tested test
  on every push and PR
- ci-success aggregator as the single required status check
- release job auto-fires on clean push to main: lukaszraczylo/semver-generator
  computes next version from commit history, tags v<X.Y.Z>, and
  `gh release create --generate-notes` publishes a GitHub release

oss-telemetry is library-only, so unlike go-telegram there is no
GoReleaser step and no binaries are attached — consumers continue to
go get github.com/lukaszraczylo/oss-telemetry@<tag>.

.semver.yaml mirrors the keyword set used in go-telegram (Conventional
Commits prefixes, BREAKING CHANGE for major).
2026-05-21 04:09:44 +01:00
lukaszraczylo 6dd2e0b5bc docs: rename disable section for stable anchor
Renames the README section from "How users disable telemetry" to
"Disabling telemetry" so consumer projects can link to a clean,
stable URL fragment (#disabling-telemetry) instead of duplicating the
opt-out table in each downstream README.
2026-05-21 04:03:19 +01:00
lukaszraczylo e02d51419c feat: initial fire-and-forget telemetry client
Anonymous OSS usage telemetry library with zero third-party deps.

- Send(project, version): fire-and-forget POST to oss.raczylo.com/v1/ping
- Disable() and Wait(timeout) helpers
- Disable via DO_NOT_TRACK, OSS_TELEMETRY_DISABLED, or per-project env
- Failproof: never blocks, never panics, never returns errors
- Hand-written JSON (no encoding/json) and byte-loop validators (no regexp)
- golangci-lint v2 clean, all tests pass with -race
2026-05-21 01:58:11 +01:00