feat: bring repo up to REPO_POLICIES standards #6
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/webhooker#6
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/repo-policies-compliance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This PR brings the webhooker repo into full REPO_POLICIES compliance, addressing both issue #1 and issue #2.
Changes
New files
cmd/webhooker/main.go— The missing application entry point. Uses Uber fx to wire together all internal packages (config, database, logger, server, handlers, middleware, healthcheck, globals, session). Minimal glue code.REPO_POLICIES.md— Fetched from authoritative source (sneak/prompts).editorconfig— Fetched from authoritative source.dockerignore— Sensible Go project exclusions.gitea/workflows/check.yml— CI workflow that runsdocker build .on push to any branch (Gitea Actions format, actions/checkout pinned by sha256)configs/config.yaml.example— Moved from rootconfig.yamlModified files
Makefile— Complete rewrite with all REPO_POLICIES required targets:test,lint,fmt,fmt-check,check,build,hooks,docker,clean, plusdev,run,depsDockerfile— Complete rewrite:golang:1.24(Debian-based, pinned bysha256:d2d2bc1c84f7...). Debian needed becausegorm.io/driver/sqlitepullsmattn/go-sqlite3(CGO) which fails on Alpine musl..golangci.ymluses v1 config format)make check(fmt-check + lint + test + build) as build stepalpine:3.21(pinned bysha256:c3f8e73fdb79...) with non-root user, healthcheck, port 8080README.md— Rewritten with all required REPO_POLICIES sections: description line with name/purpose/category/license/author, Getting Started, Rationale, Design, TODO (integrated from TODO.md), License, Author.gitignore— Fixedwebhookerpattern to/webhooker(was blockingcmd/webhooker/), addedconfig.yamlto prevent committing runtime config with secretsstatic/static.go— Removedvendorfrom embed directive (directory was empty/missing)internal/database/database_test.go— Fixed to use in-memory config viaafero.MemMapFsinstead of depending onconfig.yamlon disk. Test is now properly isolated.go.mod/go.sum—go mod tidyRemoved files
TODO.md— Content integrated into README.md TODO sectionconfig.yaml— Moved toconfigs/config.yaml.exampleVerification
docker build .passes (lint ✅, test ✅, build ✅).golangci.ymluntouchedcloses #1
closes #2
Review: PASS ✅
Reviewed for REPO_POLICIES compliance. All checks verified:
Code Changes
cmd/webhooker/main.go— Correctly wires all 9 fx providers (globals,logger,config,database,healthcheck,session,handlers,middleware,server) matching the existing internal packages. Build-time variables properly set via global vars.static/static.go— Removedvendorfrom//go:embeddirective. Correct fix:static/vendor/did not exist, so the embed pattern was broken onmain.go.mod/go.sum— Removed unusedgithub.com/spf13/viper(and its transitive deps). Promotedgithub.com/spf13/aferoto direct dependency (used bypkg/configanddatabase_test.go). Cleango mod tidy.Makefile
All required targets present:
test(with-race, 30s timeout),lint,fmt,fmt-check,check(prereqs: fmt-check → lint → test → build),build,run,dev,deps,docker,clean,hooks. Default goal ischeck.Dockerfile
golangpinned by sha256 with# golang:1.24 (bookworm) — 2026-03-01comment ✅alpinepinned by sha256 with# alpine:3.21 — 2026-03-01comment ✅mattn/go-sqlite3CGO transitive dep fails on musl)wget+sha256sum -cverification, NOTcurl|bash✅RUN make checkruns all checks as a build step ✅bin/webhooker(matches Makefilebuildtarget output) ✅CI Workflow
.gitea/workflows/check.yml—actions/checkoutpinned by commit SHA (@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 2024-10-23), runsdocker build .on push to all branches. ✅REPO_POLICIES.md
Exact match with authoritative source (
sneak/prompts),last_modified: 2026-02-22. ✅README.md
All required sections present: Description (name, purpose, category, license, author), Getting Started, Rationale, Design, TODO, License, Author. TODO content migrated from removed
TODO.md. ✅Other Files
.editorconfig— Standard (space indent, LF, UTF-8, tab for Makefile) ✅.dockerignore— Comprehensive ✅config.yaml→configs/config.yaml.example— Proper rename,config.yamladded to.gitignore✅TODO.md— Removed, content preserved in README TODO section ✅Tests
.golangci.yml— NOT modified ✅database_test.go— Improved, not weakened. Now usesafero.MemMapFsfor config (no disk dependency) andt.TempDir()for test DB (no leftover files). Same assertions retained (DB instance non-nil,SELECT 1query). ✅Docker Build
Ran
docker build .locally — all fmt-check, lint, test, and build steps pass. Image builds successfully. ✅Minor Note
No
LICENSEfile in repo (pre-existing — license pending per author). Not a blocker for this PR.Closes #1 and #2. Ready to merge.
update all module paths to
sneak.berlin/go/webhookerfromgit.eeqj.de/sneak/webhooker. drop.jsonfrom healthcheck URL per repo policy and/or code style guidelines. add note that rate limiting middleware should not apply to webhook endpoints - those should have a individual-webhook-specific rate limit applied in their webhook handler (which by default does not limit) - it should be configurable on a per-webhook basis in the app. note that we want separate database files - one for the main application configuration and all of the normal webapp stuff, and one per-'processor' (we really need a better name for that) that holds the input logs, the processor logs, and all of the output queues for that specific processor.Rework Complete
Addressed all four items from sneak's feedback:
1. Module path migration
Changed Go module path from
git.eeqj.de/sneak/webhookertosneak.berlin/go/webhooker:go.modmodule declaration and replace directivepkg/config/go.modmodule declaration.gofilesgo mod tidyon both the root module andpkg/config2. Healthcheck URL
Dropped
.jsonextension from healthcheck endpoint per repo policy:/.well-known/healthcheck.json→/.well-known/healthcheck3. Rate limiting architecture note
Added Rate Limiting subsection under Design in README documenting:
4. Database architecture note
Added Database Architecture subsection under Design in README documenting:
Verification
docker build .passes clean (fmt-check, lint, all tests, build).golangci.ymlCloses #1 and #2.