Skip to content

feat: simplify scope reporting in login flow#582

Merged
JackZhao10086 merged 1 commit intomainfrom
feat/auth_response_opt
Apr 21, 2026
Merged

feat: simplify scope reporting in login flow#582
JackZhao10086 merged 1 commit intomainfrom
feat/auth_response_opt

Conversation

@JackZhao10086
Copy link
Copy Markdown
Collaborator

@JackZhao10086 JackZhao10086 commented Apr 21, 2026

Summary

Reduce misleading/misinterpretable auth logs so AI agents don’t treat progress messages as “authorization succeeded”. Also deduplicate and standardize auth scope warning text for cleaner, consistent output.

Changes

  • Replace success-sounding device-flow log with neutral wording (token response received).
  • Remove duplicated “missing scopes” text output (drop the separate “Not granted scopes” / 本次未授予 scopes breakdown line).
  • Make auth progress copy neutral: Authorization confirmed... (avoid “completed” / 授权已完成).
  • Standardize punctuation in scope-mismatch summary (授权结果异常: uses ASCII :).

Test Plan

  • Unit tests pass (go test ./cmd/auth)
  • Local manual verify: run lark-cli auth login (and a flow that triggers missing-scope warning) and confirm stderr messages are neutral and non-duplicative

Related Issues

Summary by CodeRabbit

  • Bug Fixes

    • Removed "missing scopes" text reporting from login output (JSON responses unchanged)
    • Refined login success message wording
  • Style

    • Updated authorization error message punctuation and phrasing
    • Improved device flow operation logging message

@github-actions github-actions Bot added the size/L Large or sensitive change across domains or core paths label Apr 21, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 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: 5ef633e6-ff74-48ed-a355-82751765a043

📥 Commits

Reviewing files that changed from the base of the PR and between 24e0bb3 and 1bc7909.

📒 Files selected for processing (4)
  • cmd/auth/login_messages.go
  • cmd/auth/login_result.go
  • cmd/auth/login_test.go
  • internal/auth/device_flow.go

📝 Walkthrough

Walkthrough

Removed MissingScopes message field and its output from login authentication flows. Updated success and error message text in both Chinese and English across login messages and device flow logging. Test assertions were adjusted to match new messaging format and expectations.

Changes

Cohort / File(s) Summary
Login Authentication Messaging
cmd/auth/login_messages.go, cmd/auth/login_result.go, cmd/auth/login_test.go
Removed MissingScopes struct field and stopped emitting missing scopes line in text output. Updated AuthSuccess phrasing from "completed" to "confirmed", adjusted ScopeMismatch punctuation, and updated test assertions for Chinese messaging format and missing scopes handling.
Device Flow Logging
internal/auth/device_flow.go
Changed PollDeviceToken success-path logging message from "token obtained successfully" to "token response received".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

size/M

Suggested reviewers

  • liangshuo-1
  • albertnusouo

Poem

🐰 Messages trimmed, scopes confirmed instead,
Missing reports now rest their weary head,
Device tokens speak in simpler words,
A cleaner auth dance, by fewer strings spurred! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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 'feat: simplify scope reporting in login flow' directly and clearly summarizes the main objective of the changeset - simplifying and reducing duplication in authentication scope reporting.
Description check ✅ Passed The description follows the template structure with all required sections (Summary, Changes, Test Plan, Related Issues) completed. It provides clear motivation, detailed change list, and test verification status.
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/auth_response_opt

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 60.63%. Comparing base (293a9f8) to head (1bc7909).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
internal/auth/device_flow.go 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #582      +/-   ##
==========================================
+ Coverage   60.42%   60.63%   +0.21%     
==========================================
  Files         393      393              
  Lines       33657    33789     +132     
==========================================
+ Hits        20336    20489     +153     
+ Misses      11433    11392      -41     
- Partials     1888     1908      +20     

☔ View full report in Codecov by Sentry.
📢 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
Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/auth_response_opt -y -g

@JackZhao10086 JackZhao10086 requested review from XingjianSun and removed request for albertnusouo April 21, 2026 06:02
@JackZhao10086 JackZhao10086 requested review from XingjianSun and albertnusouo and removed request for XingjianSun April 21, 2026 06:07
@JackZhao10086 JackZhao10086 merged commit e15aef9 into main Apr 21, 2026
19 of 20 checks passed
@JackZhao10086 JackZhao10086 deleted the feat/auth_response_opt branch April 21, 2026 06:07
@liangshuo-1 liangshuo-1 mentioned this pull request Apr 21, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants