Skip to content

Fix Slack API error handling in notify hook - #1224

Draft
shunichironomura wants to merge 1 commit into
mainfrom
fix/1079-slack-api-response
Draft

shunichironomura wants to merge 1 commit into
mainfrom
fix/1079-slack-api-response

Conversation

@shunichironomura

Copy link
Copy Markdown
Member

Warning

This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.

Summary

  • validate the JSON-level ok field returned by chat.postMessage
  • surface Slack's error value instead of recording failed notifications as successful
  • preserve timestamp extraction for successful responses and add regression coverage

Fixes #1079.

AI assistance

  • AI used: yes — Amp investigated the issue, implemented the fix, and added tests
  • Human review of AI-assisted code: pending

Breaking changes

  • No breaking changes
  • Breaking changes; the breaking change label is applied

Verification

  • cargo fmt --check --all
  • cargo test -p capsula-notify-slack
  • cargo clippy -p capsula-notify-slack --all-targets --all-features -- -D warnings

Amp-Thread-ID: https://ampcode.com/threads/T-01a06b7a-4fbd-73b1-a867-029472d7b38a
Co-authored-by: Shunichiro Nomura <shunichiro.nomura.1035@gmail.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.49%. Comparing base (433b438) to head (673284a).

Files with missing lines Patch % Lines
crates/capsula-notify-slack/src/lib.rs 93.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1224      +/-   ##
==========================================
+ Coverage   54.16%   54.49%   +0.32%     
==========================================
  Files          44       44              
  Lines        4233     4259      +26     
==========================================
+ Hits         2293     2321      +28     
+ Misses       1940     1938       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

notify-slack: Slack ok:false API responses are treated as success

3 participants