Add slack notifications #1
Merged
Merged
Conversation
Scaffold a Viam generic-service module designed to grow into multiple
notification backends (email, sms, ...) behind one DoCommand convention.
- notify: shared Sender interface + DoCommand dispatcher ("send" verb)
- models/slack: viam:notifications:slack, posts via bot token
(chat.postMessage, supports channel override + threads) or incoming webhook
- cmd/module: entrypoint registering the slack model
- tests: dispatcher routing + slack send/validate via httptest mocks
- docs: consolidated setup, config, and DoCommand usage in README
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a Test workflow that runs `make test` on pull_request events, gated to PRs whose head branch lives in this repo (not forks) via github.event.pull_request.head.repo.full_name == github.repository. Pin all GitHub Actions to commit SHAs and add read-only default permissions in deploy.yml for consistency with the new workflow. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- .golangci.yaml: golangci-lint v2 with revive, misspell, unconvert and gofmt/goimports formatters - Makefile: `make lint` runs the pinned golangci-lint version - test.yml: add a lint job (same-repo PRs only) using the pinned golangci-lint-action - fix all findings: check resp.Body.Close error, add package comment, rename unused params, and have slack.New return the notify.Sender interface instead of the unexported *slack Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
NickPPC
approved these changes
Jun 4, 2026
| WebhookURL string `json:"webhook_url,omitempty"` | ||
| // DefaultChannel is used when a DoCommand does not specify "channel". Only | ||
| // applies to the bot token path. | ||
| DefaultChannel string `json:"default_channel,omitempty"` |
Rename the DoCommand payload key "channel" -> "channel_id" and the config attribute "default_channel" -> "default_channel_id" to require explicit Slack channel IDs (e.g. C0123456789) rather than channel names. The Slack API request field stays "channel" as the API expects. Update tests and README accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
No description provided.