Skip to content

feat: support source file preview artifacts - #2085

Merged
wittam-01 merged 1 commit into
mainfrom
feat/drive-preview-source-file
Jul 31, 2026
Merged

feat: support source file preview artifacts#2085
wittam-01 merged 1 commit into
mainfrom
feat/drive-preview-source-file

Conversation

@wittam-01

@wittam-01 wittam-01 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Support source file preview artifacts as a first-class content viewing path for Drive files and native Markdown file reads.

Changes

  • Add drive +preview --type source_file as a direct source file preview artifact mode that skips preview candidate lookup.
  • Preserve preview_result diagnostics for drive +preview --list-only failures while appending an actionable source_file recovery hint for non-retryable API errors.
  • Add HTTP 403 guidance to drive +download, suggesting drive +preview --type source_file --output <path> when direct download is blocked.
  • Change Markdown remote content reads (markdown +fetch, +patch, and +diff) to use the same source file preview artifact path with preview_type=16.
  • Update lark-drive skill docs for content viewing, preview candidate listing, and download 403 troubleshooting.
  • Add unit, dry-run E2E, and live workflow coverage for the new preview mode, download 403 hint, and Markdown dry-run request structure.

Test Plan

  • Drive unit tests pass: go test ./shortcuts/drive -run 'TestDrivePreview(DryRunSourceFileDocumentsDirectDownload|ListOnlyErrorAddsSourceFileHint|ListOnlyRateLimitKeepsOriginalHint|SourceFileHintGuards)|TestDriveDownloadHTTP(403SuggestsPreview|404DoesNotSuggestPreview)' -count=1
  • Markdown unit tests pass: go test ./shortcuts/markdown -run 'TestMarkdown(Fetch|Patch|Diff)' -count=1
  • Build passes: go build -o tmp/lark-cli-source-file-preview-review .
  • Drive dry-run E2E passes: LARK_CLI_BIN=/Users/bytedance/go/src/github.com/larksuite/cli/tmp/lark-cli-source-file-preview-review go test ./tests/cli_e2e/drive -run 'TestDrivePreviewDryRun_(SourceFile|Download|ListOnly)' -count=1
  • Markdown dry-run E2E passes: LARK_CLI_BIN=/Users/bytedance/go/src/github.com/larksuite/cli/tmp/lark-cli-source-file-preview-review go test ./tests/cli_e2e/markdown -run 'TestMarkdown(DiffDryRun|FetchDryRun|PatchDryRun)_' -count=1
  • Live Drive source_file workflow coverage added; local targeted run skips without tenant credentials: LARK_CLI_BIN=/Users/bytedance/go/src/github.com/larksuite/cli/tmp/lark-cli-source-file-preview-review go test ./tests/cli_e2e/drive -run 'TestDrive_PreviewAndCoverWorkflow/source_file_download' -count=1 -v
  • Diff whitespace check passes: git diff --check origin/main...HEAD

Related Issues

  • None

Summary by CodeRabbit

  • New Features
    • Added --type source_file support for drive +preview, including direct source-file downloads and source_file-specific dry-run/execute behavior.
  • Bug Fixes
    • Drive download HTTP 403 errors now suggest the drive +preview source-file recovery flow.
    • Improved drive +preview --list-only hinting for eligible API errors; rate-limit errors keep original hint behavior.
  • Documentation
    • Updated drive +preview and drive +download docs to describe source-file viewing/recovery.
    • Clarified preview usage and examples for Markdown-related shortcuts.
  • Tests
    • Expanded Drive and Markdown coverage for preview-download endpoints, hints, and version validation.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact labels Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Drive preview supports direct source_file downloads with fallback hints, while Markdown fetch, diff, and patch operations use Drive preview-download endpoints with preview type and version parameters.

Changes

Drive preview and download fallback

Layer / File(s) Summary
Forbidden download preview guidance
shortcuts/drive/drive_download.go, shortcuts/drive/drive_errors.go, shortcuts/drive/drive_io_test.go, skills/lark-drive/references/lark-drive-download.md
HTTP 403 download errors gain token-specific drive +preview guidance while 404 errors remain unchanged.
Direct source-file preview flow
shortcuts/drive/drive_preview.go, shortcuts/drive/drive_preview_common.go, shortcuts/drive/drive_preview_test.go, tests/cli_e2e/drive/*, skills/lark-drive/*
--type source_file issues direct preview-download requests, reports source-file metadata, preserves eligible API diagnostics, and documents fallback usage.

Markdown preview-download migration

Layer / File(s) Summary
Markdown preview-download migration
shortcuts/markdown/*, tests/cli_e2e/markdown/*
Markdown fetch, diff, and patch paths request preview artifacts with preview_type=16, propagate versions, and update dry-run and HTTP assertions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant DrivePreview
  participant DriveAPI
  participant OutputFile
  CLI->>DrivePreview: request source_file preview
  DrivePreview->>DriveAPI: GET preview_download with preview_type 16
  DriveAPI-->>DrivePreview: source artifact
  DrivePreview->>OutputFile: save artifact
  DrivePreview-->>CLI: return download metadata
Loading

Possibly related PRs

  • larksuite/cli#876: Directly overlaps with the Markdown preview-download and version/query changes.
  • larksuite/cli#1259: Touches the Drive preview implementation and related error-hint behavior.

Suggested labels: feature

Suggested reviewers: fangshuyu-768

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.98% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: support for source file preview artifacts.
Description check ✅ Passed The description matches the required template with Summary, Changes, Test Plan, and Related Issues sections filled in.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/drive-preview-source-file

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.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.88506% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.48%. Comparing base (0f35676) to head (0f86082).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/markdown/markdown_diff.go 58.06% 13 Missing ⚠️
shortcuts/markdown/helpers.go 77.77% 6 Missing and 4 partials ⚠️
shortcuts/drive/drive_errors.go 73.33% 3 Missing and 1 partial ⚠️
shortcuts/drive/drive_preview_common.go 93.33% 2 Missing and 1 partial ⚠️
shortcuts/markdown/markdown_fetch.go 40.00% 3 Missing ⚠️
shortcuts/drive/drive_preview.go 93.10% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2085      +/-   ##
==========================================
+ Coverage   75.44%   75.48%   +0.03%     
==========================================
  Files         924      928       +4     
  Lines       98297    98600     +303     
==========================================
+ Hits        74163    74427     +264     
- Misses      18494    18519      +25     
- Partials     5640     5654      +14     

☔ 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.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/drive-preview-source-file -y -g

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 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 `@shortcuts/drive/drive_errors.go`:
- Around line 34-43: Add table-driven 403 test cases for the error-handling flow
around the existing drive +preview check: verify an existing drive +preview hint
is preserved unchanged, and verify a different non-empty hint receives the
generated download-forbidden preview hint appended to it. Use the existing test
helpers and expected error structure.

In `@shortcuts/drive/drive_io_test.go`:
- Around line 1565-1638: The download error tests in
shortcuts/drive/drive_io_test.go lines 1565-1638 must assert
errs.SubtypeNetworkTransport via errs.ProblemOf and verify the underlying
transport cause is preserved; update both
TestDriveDownloadHTTP403SuggestsPreview and
TestDriveDownloadHTTP404DoesNotSuggestPreview as applicable. The preview error
tests in shortcuts/drive/drive_preview_test.go lines 713-762 must assert the API
subtype and verify the underlying cause supplied by the classified API error
remains available.

In `@shortcuts/drive/drive_preview_common.go`:
- Around line 825-839: Add tests covering the error-hint handling around
errs.ProblemOf: non-API errors, hints already containing "--type source_file",
and empty or whitespace-only server hints. Verify each guard preserves or
appends the expected hint behavior without changing the existing implementation.

In `@shortcuts/drive/drive_preview_test.go`:
- Around line 503-530: Add direct assertions that requested_type equals
"source_file" in both source-file dry-run contracts:
shortcuts/drive/drive_preview_test.go lines 503-530 near the existing
selected_type checks, and tests/cli_e2e/drive/drive_preview_dryrun_test.go lines
118-139 near the response field assertions.

In `@tests/cli_e2e/drive/drive_preview_dryrun_test.go`:
- Around line 96-140: Add a live bot-credential E2E test alongside
TestDrivePreviewDryRun_SourceFile that creates or uploads a source file, invokes
drive +preview with type source_file, verifies the downloaded artifact’s
contents, and cleans up all created resources and temporary output. Keep the
flow self-contained and use the existing E2E helpers and cleanup conventions.
🪄 Autofix (Beta)

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: 6301d6f6-9799-4295-bc66-dfd5e8b2b373

📥 Commits

Reviewing files that changed from the base of the PR and between d2e22c5 and 22d665a.

📒 Files selected for processing (10)
  • shortcuts/drive/drive_download.go
  • shortcuts/drive/drive_errors.go
  • shortcuts/drive/drive_io_test.go
  • shortcuts/drive/drive_preview.go
  • shortcuts/drive/drive_preview_common.go
  • shortcuts/drive/drive_preview_test.go
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-download.md
  • skills/lark-drive/references/lark-drive-preview.md
  • tests/cli_e2e/drive/drive_preview_dryrun_test.go

Comment thread shortcuts/drive/drive_errors.go
Comment thread shortcuts/drive/drive_io_test.go
Comment thread shortcuts/drive/drive_preview_common.go
Comment thread shortcuts/drive/drive_preview_test.go
Comment thread tests/cli_e2e/drive/drive_preview_dryrun_test.go
@wittam-01
wittam-01 force-pushed the feat/drive-preview-source-file branch from 22d665a to c4e0c8a Compare July 28, 2026 12:09
@github-actions github-actions Bot added size/L Large or sensitive change across domains or core paths and removed size/M Single-domain feat or fix with limited business impact labels Jul 28, 2026
@wittam-01 wittam-01 changed the title feat(drive): support source file preview artifacts feat: support source file preview artifacts Jul 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/cli_e2e/markdown/markdown_dryrun_test.go (1)

151-156: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert version parameters on each preview-download call.

The two broad version assertions only prove that both strings appear somewhere in the dry-run output; they do not prove that each version is attached to the correct [1] or [2] API request. Decode the API steps and assert each request’s params.version alongside preview_type.

🤖 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 `@tests/cli_e2e/markdown/markdown_dryrun_test.go` around lines 151 - 156,
Update the dry-run assertions around the preview-download output in the markdown
test to decode the API steps and inspect each request individually. Assert that
both `[1]` and `[2]` requests contain preview_type "16" with their respective
params.version values, rather than relying on broad output-wide version
assertions.

Source: Coding guidelines

🤖 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 `@skills/lark-drive/SKILL.md`:
- Around line 143-144: Update the +download shortcut row in the command
reference table to include the fallback destination argument, using `+preview
--type source_file --output <path>`, so users can save the preview output when
replacing a failed 403 download.

---

Nitpick comments:
In `@tests/cli_e2e/markdown/markdown_dryrun_test.go`:
- Around line 151-156: Update the dry-run assertions around the preview-download
output in the markdown test to decode the API steps and inspect each request
individually. Assert that both `[1]` and `[2]` requests contain preview_type
"16" with their respective params.version values, rather than relying on broad
output-wide version assertions.
🪄 Autofix (Beta)

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: 57c5f664-e901-467f-a206-fb22cbe7383f

📥 Commits

Reviewing files that changed from the base of the PR and between 22d665a and c4e0c8a.

📒 Files selected for processing (20)
  • shortcuts/drive/drive_download.go
  • shortcuts/drive/drive_errors.go
  • shortcuts/drive/drive_io_test.go
  • shortcuts/drive/drive_preview.go
  • shortcuts/drive/drive_preview_common.go
  • shortcuts/drive/drive_preview_test.go
  • shortcuts/markdown/helpers.go
  • shortcuts/markdown/markdown_diff.go
  • shortcuts/markdown/markdown_diff_test.go
  • shortcuts/markdown/markdown_fetch.go
  • shortcuts/markdown/markdown_patch.go
  • shortcuts/markdown/markdown_patch_test.go
  • shortcuts/markdown/markdown_test.go
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-download.md
  • skills/lark-drive/references/lark-drive-preview.md
  • skills/lark-markdown/SKILL.md
  • skills/lark-markdown/references/lark-markdown-fetch.md
  • tests/cli_e2e/drive/drive_preview_dryrun_test.go
  • tests/cli_e2e/markdown/markdown_dryrun_test.go
🚧 Files skipped from review as they are similar to previous changes (9)
  • shortcuts/drive/drive_download.go
  • skills/lark-drive/references/lark-drive-download.md
  • shortcuts/drive/drive_io_test.go
  • tests/cli_e2e/drive/drive_preview_dryrun_test.go
  • skills/lark-drive/references/lark-drive-preview.md
  • shortcuts/drive/drive_preview_common.go
  • shortcuts/drive/drive_errors.go
  • shortcuts/drive/drive_preview.go
  • shortcuts/drive/drive_preview_test.go

Comment thread skills/lark-drive/SKILL.md Outdated
Comment thread skills/lark-markdown/references/lark-markdown-fetch.md Outdated
Comment thread skills/lark-markdown/SKILL.md Outdated
Comment thread skills/lark-drive/references/lark-drive-download.md Outdated
Comment thread skills/lark-drive/references/lark-drive-preview.md Outdated
@wittam-01
wittam-01 force-pushed the feat/drive-preview-source-file branch from c4e0c8a to d02f3d4 Compare July 29, 2026 03:13

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@shortcuts/markdown/helpers.go`:
- Around line 249-266: Update markdownSourceFilePreviewQuery and
markdownSourceFilePreviewDryRunParams to validate the supplied version at the
input boundary, returning a typed validation error for whitespace-only values
instead of omitting the version. For valid non-blank versions, preserve and pass
the original version string unchanged in both request paths; adjust function
signatures as needed to propagate the validation error.
🪄 Autofix (Beta)

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: bddd4a07-bcae-4df5-abca-9092f1ae8bb1

📥 Commits

Reviewing files that changed from the base of the PR and between c4e0c8a and d02f3d4.

📒 Files selected for processing (19)
  • shortcuts/drive/drive_download.go
  • shortcuts/drive/drive_errors.go
  • shortcuts/drive/drive_io_test.go
  • shortcuts/drive/drive_preview.go
  • shortcuts/drive/drive_preview_common.go
  • shortcuts/drive/drive_preview_test.go
  • shortcuts/markdown/helpers.go
  • shortcuts/markdown/markdown_diff.go
  • shortcuts/markdown/markdown_diff_test.go
  • shortcuts/markdown/markdown_fetch.go
  • shortcuts/markdown/markdown_patch.go
  • shortcuts/markdown/markdown_patch_test.go
  • shortcuts/markdown/markdown_test.go
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-download.md
  • skills/lark-drive/references/lark-drive-preview.md
  • tests/cli_e2e/drive/drive_preview_dryrun_test.go
  • tests/cli_e2e/drive/drive_preview_workflow_test.go
  • tests/cli_e2e/markdown/markdown_dryrun_test.go
🚧 Files skipped from review as they are similar to previous changes (15)
  • shortcuts/drive/drive_download.go
  • shortcuts/markdown/markdown_patch.go
  • shortcuts/markdown/markdown_fetch.go
  • skills/lark-drive/references/lark-drive-preview.md
  • shortcuts/markdown/markdown_diff.go
  • shortcuts/drive/drive_io_test.go
  • tests/cli_e2e/drive/drive_preview_dryrun_test.go
  • tests/cli_e2e/markdown/markdown_dryrun_test.go
  • shortcuts/drive/drive_errors.go
  • shortcuts/markdown/markdown_test.go
  • shortcuts/markdown/markdown_patch_test.go
  • shortcuts/markdown/markdown_diff_test.go
  • shortcuts/drive/drive_preview_common.go
  • shortcuts/drive/drive_preview.go
  • shortcuts/drive/drive_preview_test.go

Comment thread shortcuts/markdown/helpers.go Outdated
@wittam-01
wittam-01 force-pushed the feat/drive-preview-source-file branch from d02f3d4 to 41aded2 Compare July 29, 2026 04:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
shortcuts/markdown/markdown_patch_test.go (1)

480-484: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Assert the typed validation contract on this error path.

This test only matches text. Assert category/subtype with errs.ProblemOf, read Param via errors.As on the validation error, and verify the expected cause state. As per coding guidelines, error-path tests must assert typed metadata and cause preservation rather than relying only on message substrings. Based on learnings, errs.ProblemOf does not expose Param; obtain it from *errs.ValidationError.

🤖 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 `@shortcuts/markdown/markdown_patch_test.go` around lines 480 - 484, Update
TestMarkdownPatchRejectsEmptyPatchedContent to assert the typed validation
contract instead of only matching error text: use errs.ProblemOf to verify the
expected category and subtype, extract Param from the resulting
*errs.ValidationError with errors.As, and verify the expected preserved cause
state.

Sources: Coding guidelines, Learnings

🤖 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.

Outside diff comments:
In `@shortcuts/markdown/markdown_patch_test.go`:
- Around line 480-484: Update TestMarkdownPatchRejectsEmptyPatchedContent to
assert the typed validation contract instead of only matching error text: use
errs.ProblemOf to verify the expected category and subtype, extract Param from
the resulting *errs.ValidationError with errors.As, and verify the expected
preserved cause state.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bb9d205-c341-4d07-b21f-6a17565ca473

📥 Commits

Reviewing files that changed from the base of the PR and between d02f3d4 and 41aded2.

📒 Files selected for processing (19)
  • shortcuts/drive/drive_download.go
  • shortcuts/drive/drive_errors.go
  • shortcuts/drive/drive_io_test.go
  • shortcuts/drive/drive_preview.go
  • shortcuts/drive/drive_preview_common.go
  • shortcuts/drive/drive_preview_test.go
  • shortcuts/markdown/helpers.go
  • shortcuts/markdown/markdown_diff.go
  • shortcuts/markdown/markdown_diff_test.go
  • shortcuts/markdown/markdown_fetch.go
  • shortcuts/markdown/markdown_patch.go
  • shortcuts/markdown/markdown_patch_test.go
  • shortcuts/markdown/markdown_test.go
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-download.md
  • skills/lark-drive/references/lark-drive-preview.md
  • tests/cli_e2e/drive/drive_preview_dryrun_test.go
  • tests/cli_e2e/drive/drive_preview_workflow_test.go
  • tests/cli_e2e/markdown/markdown_dryrun_test.go
🚧 Files skipped from review as they are similar to previous changes (14)
  • skills/lark-drive/references/lark-drive-download.md
  • shortcuts/drive/drive_download.go
  • tests/cli_e2e/drive/drive_preview_workflow_test.go
  • skills/lark-drive/references/lark-drive-preview.md
  • shortcuts/drive/drive_io_test.go
  • shortcuts/markdown/markdown_test.go
  • shortcuts/markdown/helpers.go
  • shortcuts/drive/drive_preview.go
  • tests/cli_e2e/markdown/markdown_dryrun_test.go
  • shortcuts/drive/drive_errors.go
  • tests/cli_e2e/drive/drive_preview_dryrun_test.go
  • shortcuts/markdown/markdown_fetch.go
  • shortcuts/markdown/markdown_diff_test.go
  • shortcuts/drive/drive_preview_test.go

@wittam-01
wittam-01 force-pushed the feat/drive-preview-source-file branch from 41aded2 to 2593c7f Compare July 29, 2026 07:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@shortcuts/drive/drive_preview_test.go`:
- Around line 155-163: Update the httpmock.Stub registration for the preview
download endpoint to use RawBody instead of Body, preserving the literal
markdown artifact bytes so the preview-reading logic receives "# markdown\n"
directly.
🪄 Autofix (Beta)

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: 21944183-5df4-4c51-8644-6ff52272eeeb

📥 Commits

Reviewing files that changed from the base of the PR and between 41aded2 and 2593c7f.

📒 Files selected for processing (19)
  • shortcuts/drive/drive_download.go
  • shortcuts/drive/drive_errors.go
  • shortcuts/drive/drive_io_test.go
  • shortcuts/drive/drive_preview.go
  • shortcuts/drive/drive_preview_common.go
  • shortcuts/drive/drive_preview_test.go
  • shortcuts/markdown/helpers.go
  • shortcuts/markdown/markdown_diff.go
  • shortcuts/markdown/markdown_diff_test.go
  • shortcuts/markdown/markdown_fetch.go
  • shortcuts/markdown/markdown_patch.go
  • shortcuts/markdown/markdown_patch_test.go
  • shortcuts/markdown/markdown_test.go
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-download.md
  • skills/lark-drive/references/lark-drive-preview.md
  • tests/cli_e2e/drive/drive_preview_dryrun_test.go
  • tests/cli_e2e/drive/drive_preview_workflow_test.go
  • tests/cli_e2e/markdown/markdown_dryrun_test.go
🚧 Files skipped from review as they are similar to previous changes (13)
  • shortcuts/drive/drive_download.go
  • skills/lark-drive/references/lark-drive-download.md
  • skills/lark-drive/references/lark-drive-preview.md
  • tests/cli_e2e/drive/drive_preview_dryrun_test.go
  • shortcuts/markdown/markdown_patch.go
  • shortcuts/drive/drive_errors.go
  • tests/cli_e2e/markdown/markdown_dryrun_test.go
  • shortcuts/markdown/markdown_test.go
  • shortcuts/markdown/helpers.go
  • shortcuts/markdown/markdown_diff.go
  • shortcuts/markdown/markdown_diff_test.go
  • shortcuts/markdown/markdown_patch_test.go
  • shortcuts/drive/drive_preview.go

Comment thread shortcuts/drive/drive_preview_test.go
Comment thread shortcuts/drive/drive_preview_common.go
Comment thread shortcuts/drive/drive_errors.go Outdated
Comment thread shortcuts/drive/drive_preview.go
@wittam-01
wittam-01 force-pushed the feat/drive-preview-source-file branch 2 times, most recently from da2cb49 to dd9079e Compare July 31, 2026 06:19
Comment thread skills/lark-drive/references/lark-drive-preview.md Outdated
@wittam-01
wittam-01 force-pushed the feat/drive-preview-source-file branch 2 times, most recently from d237150 to 81f2a19 Compare July 31, 2026 09:09
@wittam-01
wittam-01 force-pushed the feat/drive-preview-source-file branch from 81f2a19 to 0f86082 Compare July 31, 2026 09:32
@wittam-01
wittam-01 merged commit 7946e5c into main Jul 31, 2026
27 checks passed
@wittam-01
wittam-01 deleted the feat/drive-preview-source-file branch July 31, 2026 09:52
@liangshuo-1 liangshuo-1 mentioned this pull request Jul 31, 2026
3 tasks
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