test: use tri-state wiki node identity in delete verification#1931
Conversation
A get_node success response may omit data.node/node_token (the field is optional), so a missing token must not be read as proof of deletion. Classify the response as same / different / unknown: only a different non-empty node_token proves the original node is gone (move-to-drive), while an unknown identity keeps polling in isWikiNodeDeleted and still attempts deletion in deleteWikiNodeAndVerify instead of leaking nodes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughWiki E2E helpers now classify ChangesWiki node cleanup verification
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@57f165d09dbd099ac8df009949dcfdf9813a9b45🧩 Skill updatenpx skills add larksuite/cli#fix/wiki-delete-verify-tri-state -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1931 +/- ##
=======================================
Coverage 74.96% 74.96%
=======================================
Files 892 892
Lines 94058 94058
=======================================
Hits 70506 70506
Misses 18139 18139
Partials 5413 5413 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
The wiki
get_nodesuccess response may omitdata.node/node_token(the field is optional). The previous verification logic treated a missing token as proof that the original node was deleted, soisWikiNodeDeletedcould report a false deletion anddeleteWikiNodeAndVerifycould silently skip cleanup, leaking real wiki nodes. This PR replaces the two-state check with a tri-state identity classification so only positive evidence counts.Changes
wikiGetNodeMatchesTokenwith tri-statewikiGetNodeIdentityintests/cli_e2e/wiki/helpers_test.go: same token = node exists; different non-empty token = original node gone (move-to-drive); missing/empty token = indeterminateisWikiNodeDeletedtreats only a different non-emptynode_tokenas deletion proof; an indeterminate response keeps polling instead of reporting deleteddeleteWikiNodeAndVerifyreturns early only on a confirmed different identity; an indeterminate response still attempts the cleanup deleteTestWikiGetNodeIdentityregression test with 5 subcases covering the tri-state semanticsTest Plan
go test ./tests/cli_e2e/wiki/ -run 'TestWikiGetNodeIdentity|TestWikiVerifyTransientResult'passed (unit-style tests, no live credentials required)go vet ./tests/cli_e2e/wiki/andgofmt -lcleanTestWiki_MoveToDriveWorkflowin this PR's e2e-live CI jobRelated Issues
N/A
Summary by CodeRabbit