Skip to content

docs(common): sync ParseResourceURL doc comment with new URL prefixes#1136

Open
Wang-Yeah623 wants to merge 1 commit into
larksuite:mainfrom
Wang-Yeah623:docs/resource-url-prefixes-sync
Open

docs(common): sync ParseResourceURL doc comment with new URL prefixes#1136
Wang-Yeah623 wants to merge 1 commit into
larksuite:mainfrom
Wang-Yeah623:docs/resource-url-prefixes-sync

Conversation

@Wang-Yeah623
Copy link
Copy Markdown
Contributor

@Wang-Yeah623 Wang-Yeah623 commented May 27, 2026

Summary

#1106 added three new URL prefixes to urlPathToType (/drive/file/, /drive/shr/, /chat/drive/), so ParseResourceURL recognizes them in practice — but the godoc comment above the function still listed only the original nine patterns. The /bitable/ alias of /base/ has also been absent from the comment.

AI agents and contributors reading the godoc were seeing an outdated supported-pattern list. This PR syncs the comment with the actual code.

Changes

  • shortcuts/common/resource_url.go: add the four missing entries (/bitable/, /drive/file/, /drive/shr/, /chat/drive/) to the godoc patterns list. Placement follows the order of the matching entries in urlPathToType. +4 lines, no behavior change.

Test Plan

  • go test ./shortcuts/common/ -run TestParseResourceURL — passes (existing table-driven tests already cover all four prefixes, including doubao-host variants)
  • gofmt -l shortcuts/common/resource_url.go — clean
  • No source code touched outside the doc comment

Related Issues

Summary by CodeRabbit

  • Documentation
    • Clarified documentation for resource URL parsing to better explain supported URL path patterns and alias behavior.

Review Change Stack

larksuite#1106 added three new URL prefixes to urlPathToType -- /drive/file/,
/drive/shr/, /chat/drive/ -- so ParseResourceURL now recognizes them in
practice, but the godoc comment above the function still listed only the
original nine patterns. The /bitable/ alias of /base/ has also been
absent from the comment since it was added.

AI agents and contributors reading the godoc were seeing an outdated
supported-pattern list. Tests in resource_url_test.go already cover all
four undocumented prefixes, so this is a doc-only sync -- no behavior
change.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 652e0900-ed94-464a-888b-e691926f1dc0

📥 Commits

Reviewing files that changed from the base of the PR and between ab94ee9 and 3e94889.

📒 Files selected for processing (1)
  • shortcuts/common/resource_url.go

📝 Walkthrough

Walkthrough

The ParseResourceURL function documentation is enhanced to clarify additional supported URL path patterns, including the /bitable/ token alias and drive-related prefixes (/drive/file/, /drive/shr/, /chat/drive/). No functional code is modified.

Changes

Documentation Updates

Layer / File(s) Summary
ParseResourceURL documentation clarification
shortcuts/common/resource_url.go
Documentation comment block for ParseResourceURL extended to explicitly list supported URL path patterns (/bitable/TOKEN alias, /drive/file/, /drive/shr/, /chat/drive/ with resource types). No code logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • wittam-01

Poem

🐰 A rabbit hops through docs so fine,
Clarifying paths that intertwine,
/bitable/ and /drive/ too,
Comments clear, no code to chew!
Small but mighty, truth refined! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: synchronizing documentation for ParseResourceURL with newly supported URL prefixes.
Description check ✅ Passed The description comprehensively covers all required sections with clear explanations, specific changes, and thorough test verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant