Production-grade OSS readiness: tests, CI, docs, hardening#2
Merged
Conversation
- 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
End-to-end pass to bring the project up to a release-ready open-source baseline.
RetryLastLayer, stop background goroutines onStop/ context cancel, nil-safety on callback queries, no-op default logger (dropslogrusfromrequire), bump module to Go 1.26, newWithLayerTTLoption.telegramAPIinterface; hand-rolled mock; full unit-test suite with race detector. Coverage of thebfpackage: 84%.v*tags; dependabot for gomod and actions; issue/PR templates.doc.gofor pkg.go.dev; minimalexample/echoalongside the existingexample/jokeBot(which is nowslog-based).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 ./...cleango test -race -count=1 ./...greengolangci-lint run ./...reports 0 issuesgo build ./...builds library and both examples