Skip to content

feat: drive search 支持 original_creator_ids#1046

Merged
BytedanceSearch merged 1 commit into
mainfrom
feat/doc-universal-original-creator
Jun 15, 2026
Merged

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

Conversation

@BytedanceSearch

@BytedanceSearch BytedanceSearch commented May 22, 2026

Copy link
Copy Markdown
Collaborator

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

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

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
@BytedanceSearch
BytedanceSearch force-pushed the feat/doc-universal-original-creator branch from c2d6ba6 to cb88689 Compare June 9, 2026 08:32
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.35%. Comparing base (c0730b4) to head (b7274f1).

Files with missing lines Patch % Lines
shortcuts/drive/drive_search.go 86.66% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1046   +/-   ##
=======================================
  Coverage   73.35%   73.35%           
=======================================
  Files         750      750           
  Lines       69250    69264   +14     
=======================================
+ Hits        50799    50811   +12     
- Misses      14711    14713    +2     
  Partials     3740     3740           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BytedanceSearch
BytedanceSearch force-pushed the feat/doc-universal-original-creator branch from cb88689 to ceaf94e Compare June 9, 2026 09:40
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@b7274f1256f0680761b3adaed911d05befd30f66

🧩 Skill update

npx skills add larksuite/cli#feat/doc-universal-original-creator -y -g

sa: none

fg: none

cfg: none

doc: none

test: ppe
Change-Id: I88bedd02a5daa3307b05c9b6f94748e1544d279a
@BytedanceSearch
BytedanceSearch force-pushed the feat/doc-universal-original-creator branch from ceaf94e to b7274f1 Compare June 15, 2026 03:24
@BytedanceSearch
BytedanceSearch merged commit 72c2947 into main Jun 15, 2026
21 checks passed
@BytedanceSearch
BytedanceSearch deleted the feat/doc-universal-original-creator branch June 15, 2026 06:18
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.

2 participants