GitHub Workflow¶
How code flows from your branch to merged.
Branch + PR¶
- Fork dnl555/kpulse on GitHub.
- Clone your fork, create a branch:
- Make your changes. Run
go test ./...andgofmt -w .before committing. - Commit. Short imperative subject (under 70 chars), optional 1-2 line body. No AI attribution lines.
- Push and open a PR against
main:
PR title and body¶
- Title under 70 chars
- Body: 1-3 bullets under a
## Summarysection - No need for "Context" / "Test plan" sections unless asked
Example:
## Summary
- Add Mattermost notifier with native message formatting
- Wire it in `notifiers.Build` when `channels.mattermost.enabled` is set
- Tests cover happy path and 4xx error
CI¶
Two workflows run automatically:
ci.ymlon every push and PR:go test ./... -race,golangci-lint run,docker buildrelease.ymlon tagsv*: build + push image toghcr.io/dnl555/kpulse:<tag>, renderkpulse.yaml, create a GitHub Release
A green ci check is required before merge.
Adding a new monitor¶
internal/monitors/<name>.goimplementingmonitors.Monitor.- Add config knobs to
internal/config/config.go(Monitorsstruct + defaults indefaults()). - Wire it into
cmd/kpulse/main.gobuildMonitors. - Add a section to the Monitors docs including how to trigger it on a test cluster.
- Test against a
fake.NewSimpleClientset; seepod_crashes_test.gofor the pattern.
Adding a new channel¶
- Implement the
notifiers.Notifierinterface ininternal/notifiers/<name>.go. - Add a config stanza under
Channelsininternal/config/config.go. - Register it in
internal/notifiers/build.go. - Add a
channels.<name>block incharts/kpulse/values.yamland wire it incharts/kpulse/templates/configmap.yaml. - Document the channel under Channels.
Conventions¶
- One responsibility per package.
- Use existing interfaces (
Submitter,Notifier); don't introduce new abstractions for one-off cases. - Default to no code comments. Add one only when the why is non-obvious.
- No external services or telemetry. kpulse must remain self-contained.
Releases¶
Tag-driven; the maintainer cuts releases. Contributors don't need to do anything release-related.