docs(slides): harden update file input guidance - #2273
Conversation
📝 WalkthroughWalkthroughThe change moves slide update guidance into the affordance documentation, removes shortcut tips, adds validation, and updates XML input examples with shell-safe file checks. ChangesSlides update guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/affordance/slides_source_test.go`:
- Line 16: Replace the os.DirFS call in SetSource with the repository-backed
fs.FS helper from internal/vfs, adding that helper if it does not already exist.
Ensure the affordance source remains rooted at the repository’s affordance
directory while using the internal filesystem abstraction.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3d67ae20-93cd-4963-b76c-ae3606786653
📒 Files selected for processing (5)
affordance/slides.mdinternal/affordance/slides_source_test.goshortcuts/slides/slides_update_slide.goskills/lark-slides/references/lark-slides-update-slide.mdskills/lark-slides/references/workflow/error-handling.md
| func TestSlidesUpdateAffordancePreservesSafetyAndShellGuidance(t *testing.T) { | ||
| prev := mdSource | ||
| t.Cleanup(func() { SetSource(prev) }) | ||
| SetSource(os.DirFS("../../affordance")) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 5 'os\.DirFS|fs\.FS|internal/vfs|SetSource' internal/affordance internal/vfsRepository: larksuite/cli
Length of output: 11924
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '--- files ---\n'
git ls-files 'internal/vfs/**/*.go' | sed -n '1,200p'
printf '\n--- os.DirFS / internal/vfs occurrences ---\n'
rg -n '"os"|os\.(DirFS|Open|ReadFile|Stat)|internal/vfs|func .*FS|fs\.open|Local|Open' internal/vfs internal/affordance | sed -n '1,240p'
printf '\n--- target test file ---\n'
cat -n internal/affordance/slides_source_test.go
printf '\n--- application source helpers if any ---\n'
sed -n '1,90p' internal/affordance/application_source_test.goRepository: larksuite/cli
Length of output: 242
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- files ---'
git ls-files 'internal/vfs/**/*.go' | sed -n '1,200p'
printf '%s\n' '--- os.DirFS / internal/vfs occurrences ---'
rg -n '"os"|os\.(DirFS|Open|ReadFile|Stat)|internal/vfs|func .*FS|fs\.open|Local|Open' internal/vfs internal/affordance | sed -n '1,280p'
printf '%s\n' '--- target test file ---'
cat -n internal/affordance/slides_source_test.go
printf '%s\n' '--- application source helpers if any ---'
sed -n '1,90p' internal/affordance/application_source_test.goRepository: larksuite/cli
Length of output: 18617
Use the repository filesystem abstraction for the affordance source.
SetSource(os.DirFS("../../affordance")) bypasses internal/vfs. Use or add a repository-backed fs.FS helper, then use that helper instead of os.DirFS.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@internal/affordance/slides_source_test.go` at line 16, Replace the os.DirFS
call in SetSource with the repository-backed fs.FS helper from internal/vfs,
adding that helper if it does not already exist. Ensure the affordance source
remains rooted at the repository’s affordance directory while using the internal
filesystem abstraction.
Sources: Coding guidelines, Learnings
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@ff4e13de58e794f2785560f595bc9e22c8aea3ed🧩 Skill updatenpx skills add larksuite/cli#docs/slides-update-shell-input -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2273 +/- ##
=======================================
Coverage 76.39% 76.39%
=======================================
Files 1013 1013
Lines 111788 111788
=======================================
Hits 85400 85400
Misses 19878 19878
Partials 6510 6510 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Improve
slides +update-slideguidance for shell loops where a computed@filepath can collapse to.xmlwhen a variable is empty or expanded too early. This keeps the command fail-closed and changes guidance only; file parsing and Slides write behavior are unchanged.Changes
+update-slidetips to the affordance surface and add safe shell-loop guidance.cannot read file ".xml"signal and clarify that braces alone do not fix an empty variable.Test Plan
make unit-testmake vetmake fmt-checkQUALITY_GATE_CHANGED_FROM=origin/main make quality-gatenode scripts/skill-format-check/index.jsgo run . slides +update-slide --helpverificationRelated Issues
Summary by CodeRabbit
Documentation
Tests