Skip to content

feat: drive search 支持 original_creator_ids#1046

Open
BytedanceSearch wants to merge 1 commit into
mainfrom
feat/doc-universal-original-creator
Open

feat: drive search 支持 original_creator_ids#1046
BytedanceSearch wants to merge 1 commit into
mainfrom
feat/doc-universal-original-creator

Conversation

@BytedanceSearch
Copy link
Copy Markdown
Collaborator

@BytedanceSearch BytedanceSearch commented May 22, 2026

Summary:

  • add --original-creator-ids to drive +search
  • change --created-by-me to send original_creator_ids for current user, while --mine remains owner/creator_ids
  • update lark-drive skill docs and reference

Test:

  • go test ./shortcuts/drive -run Test(ValidateDriveSearchIDs|BuildDriveSearchRequest|EnrichDriveSearchError)

Summary by CodeRabbit

  • New Features

    • Added --created-by-me flag to filter documents by original creator, distinguishing from ownership-based filtering.
    • Added --original-creator-ids flag to filter documents by specific original creator identifiers.
  • Documentation

    • Updated search documentation to clarify the distinction between "documents I created" (original creator) and "documents I own" filtering options.
    • Enhanced error messages to reference original creator filtering options.

Review Change Stack

sa: none

fg: none

cfg: none

doc: none

test: ppe
Change-Id: I88bedd02a5daa3307b05c9b6f94748e1544d279a
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 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: f514723e-e68b-4a0e-a33d-d13ad377d803

📥 Commits

Reviewing files that changed from the base of the PR and between 5c01a7f and c2d6ba6.

📒 Files selected for processing (4)
  • shortcuts/drive/drive_search.go
  • shortcuts/drive/drive_search_test.go
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-search.md

📝 Walkthrough

Walkthrough

This PR adds --created-by-me and --original-creator-ids flags to the drive search command to support filtering by original document creator, distinct from current owner-based filtering via --mine and --creator-ids. The change includes validation, request building, tests, and documentation updates.

Changes

Original Creator Filtering

Layer / File(s) Summary
CLI spec, flags, and help text
shortcuts/drive/drive_search.go
Adds --created-by-me (bool) and --original-creator-ids (comma-separated IDs) to the DriveSearch command. Extends the driveSearchSpec struct with CreatedByMe and OriginalCreatorIDs fields, reads them from CLI flags, and updates Tips to clarify the distinction from --mine.
Request building and validation logic
shortcuts/drive/drive_search.go
Validates that --created-by-me and --original-creator-ids are mutually exclusive, requires userOpenID when either is used, and updates request building to populate original_creator_ids in API filters while preserving existing creator_ids behavior for owner semantics.
ID validation and error handling
shortcuts/drive/drive_search.go
Validates each entry in OriginalCreatorIDs using common ID validation, and updates error hint text for visibility errors to include --original-creator-ids alongside --creator-ids and --sharer-ids.
Test coverage
shortcuts/drive/drive_search_test.go
Expands test fixtures to include OriginalCreatorIDs, adds assertions that CreatedByMe maps to original_creator_ids, validates ID format errors, and tests missing userOpenID and mutual-exclusion constraint violations.
Documentation
skills/lark-drive/SKILL.md, skills/lark-drive/references/lark-drive-search.md
Maps natural language "我创建的" to --created-by-me and clarifies distinction from "我负责的" (--mine). Updates parameter tables to distinguish creator_ids (owner) from original_creator_ids (original creator), documents mutual-exclusion rules, and clarifies contact visibility authorization limits.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • larksuite/cli#951: Modifies identity-filter CLI semantics and mutual-exclusion logic in the same drive_search.go file that this PR extends with the new original-creator flags.
  • larksuite/cli#658: Earlier change to drive search identity filtering that provides the foundation this PR builds upon.

Suggested labels

size/M, domain/ccm

Suggested reviewers

  • liujinkun2025
  • fangshuyu-768
  • zhaoleibd

Poem

🐰 A creator's touch, now clearly seen,
Docs I made, from those I oversee—
Two paths diverge with --created-by-me,
Identity refined, semantics pristine! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description covers the key changes and test plan, but lacks formal structure matching the template (no clear Summary/Changes/Test Plan sections with proper formatting). Restructure the description to match the template format with clear Summary, Changes list, and Test Plan sections; add 'Closes/Fixes' for any related issues.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and specifically describes the main change: adding support for original_creator_ids to the drive search functionality.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/doc-universal-original-creator
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/doc-universal-original-creator

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 domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths labels May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant