Mattermost notifications are sent by the Slack sender, which wrapped every HTTP error status in ErrSlackFailed. With DNSWATCHER_MATTERMOST_WEBHOOK answering 503, the warning said "endpoint":"mattermost" but "error":"slack notification failed: status 503".
The sender now takes the error to wrap: the Slack endpoint passes ErrSlackFailed and the Mattermost endpoint passes ErrMattermostFailed. A new test in internal/notify/delivery_test.go sets both endpoints to a stand-in server answering 503 and checks that the error logged after retries for each names its own endpoint.
The test-only SendSlack export takes the same new parameter, so the existing Slack sender tests now pass ErrSlackFailed themselves.
Scope: a delivery that gets no HTTP answer at all still reads sending webhook request: ... for both endpoints, as before; the endpoint field tells them apart, and the issue covers HTTP errors only.
Judgement call: the sender keeps its name sendSlack rather than being renamed, to keep the change small.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/dnswatcher/issues/227
Mattermost notifications are sent by the Slack sender, which wrapped every HTTP error status in `ErrSlackFailed`. With `DNSWATCHER_MATTERMOST_WEBHOOK` answering 503, the warning said `"endpoint":"mattermost"` but `"error":"slack notification failed: status 503"`.
The sender now takes the error to wrap: the Slack endpoint passes `ErrSlackFailed` and the Mattermost endpoint passes `ErrMattermostFailed`. A new test in `internal/notify/delivery_test.go` sets both endpoints to a stand-in server answering 503 and checks that the error logged after retries for each names its own endpoint.
The test-only `SendSlack` export takes the same new parameter, so the existing Slack sender tests now pass `ErrSlackFailed` themselves.
- Scope: a delivery that gets no HTTP answer at all still reads `sending webhook request: ...` for both endpoints, as before; the `endpoint` field tells them apart, and the issue covers HTTP errors only.
- Judgement call: the sender keeps its name `sendSlack` rather than being renamed, to keep the change small.
Model: opus-5-5
Mattermost is sent by the Slack sender, which wrapped every HTTP error
status in ErrSlackFailed, so a Mattermost endpoint answering 503 was
logged as "slack notification failed". The sender now takes the error
to wrap: the Slack endpoint passes ErrSlackFailed and the Mattermost
endpoint passes ErrMattermostFailed, which was defined but unused.
A new delivery test sets both endpoints to a stand-in server answering
503 and checks the error logged for each names its own endpoint.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #227
Mattermost notifications are sent by the Slack sender, which wrapped every HTTP error status in
ErrSlackFailed. WithDNSWATCHER_MATTERMOST_WEBHOOKanswering 503, the warning said"endpoint":"mattermost"but"error":"slack notification failed: status 503".The sender now takes the error to wrap: the Slack endpoint passes
ErrSlackFailedand the Mattermost endpoint passesErrMattermostFailed. A new test ininternal/notify/delivery_test.gosets both endpoints to a stand-in server answering 503 and checks that the error logged after retries for each names its own endpoint.The test-only
SendSlackexport takes the same new parameter, so the existing Slack sender tests now passErrSlackFailedthemselves.sending webhook request: ...for both endpoints, as before; theendpointfield tells them apart, and the issue covers HTTP errors only.sendSlackrather than being renamed, to keep the change small.Model: opus-5-5
Review passed on
bdd6de3.Model: opus-5-5
bdd6de396ctoe3c632c793