refactor!: fix P9 interface-shape lies in workflow and analytics (#350)#410
Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_6ac7aa06-3b88-4762-9d68-9d6feae14771) |
5ba13c3 to
89be444
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_bd43df38-6fd8-4b16-867f-7f310c6d606a) |
89be444 to
563fff7
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_5f7105d4-8600-47d6-9b67-afb9e4a8ff79) |
Workflow approve/reject/resubmit helpers returned ApprovalTaskActionResult with success always true after discarding the real response. Return SDKResult<()> instead so success/failure is only expressed by Result. Analytics deleted search/v2 query and user runtime stubs that always returned Err with dead setters (no verified Feishu endpoints; aligns with Platform/user Service::new fixes already landed in #373/#360.
563fff7 to
2683a0a
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_26ae3080-b8e6-4874-8a80-99bb1f792f01) |
MSRV job copies .github/msrv/Cargo.lock and runs cargo check --locked; workflow gained wiremock for approve helper e2e tests (#350).
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_b163a5a9-02ec-4045-b1da-1e63c273e7fd) |
- Assert approve/reject/resubmit hit the three Feishu paths via wiremock - Propagate-error test uses neutral business code 99991400 and matches real leaf behavior (Validation on non-zero code without data) - Clarify analytics stub migration: never wired, user search still absent - Fix stale #308 alternative paths that pointed at deleted query/user
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_ce9624ec-3873-40e0-a7ee-4690da2ee987) |
Summary
Closes the remaining #350 (P9 interface-shape lies) work after platform/user were fixed earlier.
approve_task/reject_task/resubmit_taskno longer discard the real response and return a forever-trueApprovalTaskActionResult { success: true }. They now returnSDKResult<()>(Feishu approval v4 action data is empty).ApprovalTaskActionResultremoved.search/v2/query.rsanduser.rsruntime stubs that always returnedErrwith unused setters (no verified Feishu endpoints; same honesty direction as [refactor] analytics: 给 Search/SearchV2/search() 标 #[deprecated](为下个 breaking 窗口铺路) #308 facade removal).AnalyticsService::new:SDKResult<Self>→Self; client facade drops?.PlatformService::new(refactor(platform)!: 修 PlatformService::new 误导签名(#350 P9 platform 子项) #373),UserService::new(refactor(user): 砍 PersonalSettingsResource 中间层 + 修 UserService::new 误导签名(ADR 0001 阶段2) #360) — documented only, not re-done.Migration
Test plan
cargo test -p openlark-workflow --all-features(incl. new wiremock success + error helpers)cargo test -p openlark-analytics --all-featurescargo clippy -p openlark-workflow -p openlark-analytics -p openlark-client --all-targets --all-features -- -Dwarningscargo clippy -p openlark-workflow -p openlark-analytics --all-targets --no-default-features -- -Dwarningscargo fmt --all -- --checkCloses #350
Note
Medium Risk
Breaking public API changes in workflow helpers and analytics construction/search surface; behavior is more honest but callers must migrate off removed types and
?onAnalyticsService::new.Overview
Breaking API honesty fixes (#350) for workflow and analytics, aligning with earlier platform/user
Service::newcorrections.Workflow:
approve_task,reject_task, andresubmit_tasknow returnSDKResult<()>instead of always-trueApprovalTaskActionResult { success: true }. The helpers propagate real HTTP/leaf errors and drop the fakesuccessfield. Migration: useservice.approve_task(...).await?instead of checkingr.success.Analytics: Removes
search/v2/queryandsearch/v2/usermodules (always-Errstubs with dead setters; no verified Feishu endpoints).AnalyticsService::newchanges fromSDKResult<Self>toSelf;openlark-clientanalytics init no longer uses?. Callers should use live search leaves (doc_wiki,schema,app,message,data_source).Docs, changelog, openspec, examples, and wiremock tests in
openlark-workflowlock the new helper contract.Reviewed by Cursor Bugbot for commit d26625c. Bugbot is set up for automated code reviews on this repo. Configure here.