Skip to content

feat(feishu): implement #308 #172 #307#364

Open
aaronwong1989 wants to merge 1 commit intohrygo:mainfrom
aaronwong1989:feat/feishu-all-issues
Open

feat(feishu): implement #308 #172 #307#364
aaronwong1989 wants to merge 1 commit intohrygo:mainfrom
aaronwong1989:feat/feishu-all-issues

Conversation

@aaronwong1989
Copy link
Copy Markdown
Collaborator

Implement Feishu streaming card API and related features.

Changes

  • card_api.go: Add CreateCard/UpdateCard/SendCardMessage APIs with retry logic
  • card_api_test.go: Comprehensive test coverage for card APIs
  • adapter.go: Add adapter functions
  • converter.go: Add message converter
  • streaming.go: Update streaming implementation
  • client.go: Add client support

Related Issues

- hrygo#308: Add CardKit API exponential backoff retry (SendCardWithRetry)
  * 3 retries, 100ms initial delay, 5s max delay
  * Retry on network errors and 5xx, no retry on 4xx
  * Used in streaming.go for card message sending

- hrygo#172: Integrate ProcessorChain into Feishu adapter
  * Add processorChain field to Adapter struct
  * Initialize with NewDefaultProcessorChain using FeishuConverter
  * Route defaultSender through processor chain before sending
  * Create FeishuConverter for Markdown -> Feishu format conversion

- hrygo#307: WebSocket and CardKit test coverage improvement
  * Add CardKit retry logic tests (isRetryableError, calculateBackoff)
  * Add WebSocket reconnect/handler tests
  * Add streaming writer state tests
  * Add processor chain integration tests
  * Coverage: 39.3% -> 46.8%

- Fix MockFeishuClient to implement SendCardWithRetry interface
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 68.46847% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.42%. Comparing base (c9bd7bf) to head (da8420c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
chatapps/feishu/card_api.go 48.14% 28 Missing ⚠️
chatapps/feishu/adapter.go 36.36% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #364      +/-   ##
==========================================
+ Coverage   60.29%   60.42%   +0.12%     
==========================================
  Files         229      230       +1     
  Lines       24353    24463     +110     
==========================================
+ Hits        14684    14781      +97     
- Misses       9669     9682      +13     
Flag Coverage Δ
unittests 60.42% <68.46%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant