Skip to content

fix(drive): use docs secure label read scope - #1281

Merged
fangshuyu-768 merged 1 commit into
mainfrom
fix/secure_scope
Jun 5, 2026
Merged

fix(drive): use docs secure label read scope#1281
fangshuyu-768 merged 1 commit into
mainfrom
fix/secure_scope

Conversation

@caojie0621

@caojie0621 caojie0621 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Update the Drive secure label list shortcut to request the correct read scope, docs:secure_label:readonly, so auth scope checks match the secure label API requirement.

Changes

  • Replace the secure label list read scope with docs:secure_label:readonly
  • Add a unit test to pin the secure label list/update shortcut scopes

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark-cli drive +secure-label-list flow works as expected

Not run locally.

Related Issues

  • None

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Updated permission scopes for secure label operations.
  • Tests

    • Added verification tests for secure label permission scopes.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 00bde9d5-53c4-4473-b06a-db9db66099a0

📥 Commits

Reviewing files that changed from the base of the PR and between 3990151 and a27b8fa.

📒 Files selected for processing (2)
  • shortcuts/drive/drive_secure_label.go
  • shortcuts/drive/drive_secure_label_test.go

📝 Walkthrough

Walkthrough

The PR updates the OAuth scope constant used by the secure label listing shortcut from drive:file.meta.sec_label.read_only to docs:secure_label:readonly, and adds a test that verifies the exact scope strings for both secure label listing and update operations.

Changes

Secure Label OAuth Scope Update

Layer / File(s) Summary
Secure label read scope update and validation
shortcuts/drive/drive_secure_label.go, shortcuts/drive/drive_secure_label_test.go
secureLabelReadScope constant value is updated to docs:secure_label:readonly. A new test TestDriveSecureLabelScopes verifies that DriveSecureLabelList.Scopes and DriveSecureLabelUpdate.Scopes contain the correct scope identifiers.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • larksuite/cli#985: Introduced the secure-label shortcuts and their initial scope wiring, which this PR updates and validates.

Suggested labels

size/S, domain/ccm

Suggested reviewers

  • fangshuyu-768

Poem

🐰 A scope string takes a new name,
From drive-old to docs-new frame,
Tests now guard what must stay true,
Hopping onward, verified through! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 clearly and concisely describes the main change: updating the secure label read scope constant to use the correct API scope.
Description check ✅ Passed The description includes all key template sections with complete information: summary explains the motivation, changes list the modifications, test plan details verification steps, and related issues are addressed.
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 fix/secure_scope

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/M Single-domain feat or fix with limited business impact labels Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#fix/secure_scope -y -g

@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.17%. Comparing base (3990151) to head (a27b8fa).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1281   +/-   ##
=======================================
  Coverage   70.17%   70.17%           
=======================================
  Files         671      671           
  Lines       65329    65329           
=======================================
+ Hits        45843    45845    +2     
+ Misses      15796    15795    -1     
+ Partials     3690     3689    -1     

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

@fangshuyu-768
fangshuyu-768 merged commit 62364fc into main Jun 5, 2026
37 of 41 checks passed
@fangshuyu-768
fangshuyu-768 deleted the fix/secure_scope branch June 5, 2026 04:48
tuxedomm pushed a commit to zhumiaoxin/cli that referenced this pull request Jun 6, 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/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants