fix(slides): accept presentation aliases on slide add and delete - #2168
fix(slides): accept presentation aliases on slide add and delete#2168leave330 wants to merge 1 commit into
Conversation
+add-slide and +delete-slide declared --presentation inline instead of using the shared locator flag, so they were the only slides commands that rejected --url, --token, --presentation-id and the other aliases every sibling command accepts. The two commands predate the shared flag, and the contract test that pins it predates their merge, so each change was green on its own base and only the combination fails.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe slide add and delete commands now use the shared required presentation flag helper. The alias test requires ChangesSlide presentation flag requirements
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested labels: 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@694d94e6fd2aeb1656b686a7282fb735f383ae25🧩 Skill updatenpx skills add larksuite/cli#fix/slides-presentation-flag-aliases -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2168 +/- ##
==========================================
+ Coverage 75.65% 75.69% +0.03%
==========================================
Files 940 942 +2
Lines 99876 100079 +203
==========================================
+ Hits 75564 75750 +186
- Misses 18530 18537 +7
- Partials 5782 5792 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
slides +add-slideandslides +delete-slidedeclare--presentationas an inline flag literal instead of using the domain's shared locator flag, so they are the only two slides commands that reject--url,--token,--presentation-id,--presentation-token,--presentation_idand--xml-presentation-id. Every sibling command accepts all six. This PR routes both commands through the shared flag and registers them in the contract test that pins it.The inconsistency is invisible from
--help(aliases are not listed there) and shows up only at call time, which makes it the kind of defect an agent caller hits and cannot diagnose: the same locator argument works on one verb of the same domain and fails on the next.maincurrently failsunit-testandcoverageon the contract test that catches this, which blocks every open pull request. Both commands were written before the shared flag existed, and the contract test that pins it landed before they merged, so each change was green on its own base and only the combination fails.Changes
--presentationliteral with the sharedrequiredPresentationRefFlag()inshortcuts/slides/slides_add_slide.goandshortcuts/slides/slides_delete_slide.go, so both commands carry the same alias set and description as the rest of the domain+add-slideand+delete-slideinwantRequiredinshortcuts/slides/shortcuts_alias_test.go, which is what makes the contract test hold both commands to the shared alias set from now onNo behavior changes beyond the aliases: the canonical
--presentationflag, its description, its required-ness, and every other flag on both commands are untouched.Test Plan
make unit-testpassedunexpected presentation flag on +add-slide/+delete-slidebefore the change and passes afterslides +add-slide --url <slides-url> --slide '<slide/>' --dry-runreturnsunknown flag "--url"onmainand renders the dry-run envelope after the changeshortcuts/sheetsdeclares its locator flag through the shared helper everywhere and its equivalent contract test passesRelated Issues
N/A
Summary by CodeRabbit
+add-slideand+delete-slideshortcuts now correctly require a presentation to be specified.