Skip to content

Production-grade OSS readiness: tests, CI, docs, hardening#2

Merged
smoreg merged 5 commits into
mainfrom
feature/oss-readiness
May 10, 2026
Merged

Production-grade OSS readiness: tests, CI, docs, hardening#2
smoreg merged 5 commits into
mainfrom
feature/oss-readiness

Conversation

@smoreg

@smoreg smoreg commented May 10, 2026

Copy link
Copy Markdown
Owner

Summary

End-to-end pass to bring the project up to a release-ready open-source baseline.

  • Hygiene & correctness: clear all in-code TODOs, fix race in RetryLastLayer, stop background goroutines on Stop / context cancel, nil-safety on callback queries, no-op default logger (drops logrus from require), bump module to Go 1.26, new WithLayerTTL option.
  • Testability: extract narrow telegramAPI interface; hand-rolled mock; full unit-test suite with race detector. Coverage of the bf package: 84%.
  • CI/CD: GitHub Actions for vet + race tests + golangci-lint + gitleaks + Codecov; release workflow driven by GoReleaser on v* tags; dependabot for gomod and actions; issue/PR templates.
  • Docs: rewritten README with badges, install, quick start, core concepts; doc.go for pkg.go.dev; minimal example/echo alongside the existing example/jokeBot (which is now slog-based).
  • Repo metadata: CONTRIBUTING.md, CODE_OF_CONDUCT.md (Contributor Covenant 2.1), SECURITY.md, CHANGELOG.md (Keep a Changelog), Makefile, .goreleaser.yaml.

Closes the README TODO list (tests, docs, CI, badges, coverage).

Test plan

  • go vet ./... clean
  • go test -race -count=1 ./... green
  • golangci-lint run ./... reports 0 issues
  • go build ./... builds library and both examples
  • CI on this PR is green

smoreg added 5 commits May 9, 2026 22:41
- Resolve outstanding TODOs in layers.go (text/data duplicates, AnyText typing).
- Stop background goroutines (cleaner, chatController) on Stop / ctx cancel.
- Make mainLoop respect ctx cancellation and updates-channel close.
- Copy layer in RetryLastLayer instead of mutating shared pointer.
- nil-safety on CallbackQuery without Message/ReplyMarkup.
- Extract telegramAPI interface for testability.
- Replace default logrus logger with a no-op implementation; drop logrus
  from go.mod require. Example now uses log/slog via a tiny adapter.
- Logger uses any instead of interface{}.
- Add WithLayerTTL option; layer TTLs no longer hardcoded.
- Bump go directive to 1.26 (toolchain go1.26.1).
- Tighten .golangci.yml: standard exit code 1, gofumpt 1.26, ignore noise on tests.
- Add Stop, RegisterButton, RegisterAudio to ChatBot interface.
Cover layers, events, utils, options, main-loop, default handlers and
public bot methods. Race-detector clean. Coverage of the bf package: 84%.
CI runs vet, race-tested unit tests, golangci-lint and gitleaks on every
push and pull request. Coverage is uploaded to Codecov when CODECOV_TOKEN
is set. A separate release workflow drives goreleaser on v* tags.
Dependabot tracks gomod and github-actions weekly.
README now carries badges, install instructions, a quick-start snippet,
core concepts and pointers to the two examples. The DO-NOT-USE warning
is replaced with a realistic alpha note. doc.go gives pkg.go.dev a real
package overview. example/echo is the minimal first-bot to copy.
CONTRIBUTING covers local setup and PR checklist; SECURITY documents the
private-advisory disclosure path; CODE_OF_CONDUCT adopts Contributor
Covenant 2.1; CHANGELOG follows Keep a Changelog with a 0.1.0 entry.
Makefile exposes test, lint, cover, fmt, tidy, ci. goreleaser config
ships GitHub release notes only (the project is a library, no binaries).
@smoreg smoreg merged commit fe21c35 into main May 10, 2026
2 of 3 checks passed
@smoreg smoreg deleted the feature/oss-readiness branch May 10, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant