Skip to content

Add slack notifications #1

Merged
ale7714 merged 4 commits into
mainfrom
feat/slack-notifications
Jun 4, 2026
Merged

Add slack notifications #1
ale7714 merged 4 commits into
mainfrom
feat/slack-notifications

Conversation

@ale7714

@ale7714 ale7714 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

ale7714 and others added 2 commits June 4, 2026 15:37
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>
@ale7714 ale7714 requested a review from NickPPC June 4, 2026 20:50
- .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>
Comment thread models/slack/slack.go Outdated
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"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DefaultChannelID ?

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>
@ale7714 ale7714 merged commit d735c1b into main Jun 4, 2026
2 checks passed
@ale7714 ale7714 deleted the feat/slack-notifications branch June 4, 2026 22:33
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.

2 participants