Skip to content

fix(auth): localize --no-wait --json hint output#1142

Open
cloudyan wants to merge 1 commit into
larksuite:mainfrom
cloudyan:fix/auth-login-nowait-localization
Open

fix(auth): localize --no-wait --json hint output#1142
cloudyan wants to merge 1 commit into
larksuite:mainfrom
cloudyan:fix/auth-login-nowait-localization

Conversation

@cloudyan
Copy link
Copy Markdown

@cloudyan cloudyan commented May 27, 2026

The --no-wait --json branch in auth login was hardcoding an English hint string, ignoring the user's configured language. Use the already localized msg.AgentTimeoutHint instead, matching the behavior of the regular --json branch.

Also update the corresponding test assertions to match the Chinese localization (the default language).

Summary

The --no-wait --json branch in auth login was hardcoding an English hint string, ignoring the user's configured language. This change makes it use the already-localized msg.AgentTimeoutHint instead, matching the behavior of the regular --json branch.

Fixes: lark-cli auth login --domain all --no-wait --json now outputs localized hint text.

Summary by CodeRabbit

  • Localization
    • Updated hint messages for the auth login --no-wait command to use localized text instead of hardcoded English guidance.

Review Change Stack

The --no-wait --json branch in auth login was hardcoding an English
hint string, ignoring the user's configured language. Use the already
localized msg.AgentTimeoutHint instead, matching the behavior of the
regular --json branch.

Also update the corresponding test assertions to match the Chinese
localization (the default language).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added the size/L Large or sensitive change across domains or core paths label May 27, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 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: 62ae358b-0799-47e1-aedc-a2c09ece9669

📥 Commits

Reviewing files that changed from the base of the PR and between bbef3cb and 82176c6.

📒 Files selected for processing (2)
  • cmd/auth/login.go
  • cmd/auth/login_test.go

📝 Walkthrough

Walkthrough

The auth login --no-wait JSON response's hint field is updated to use the localized msg.AgentTimeoutHint constant instead of a hardcoded instruction template. The corresponding test is updated to assert the new localized hint content.

Changes

Hint Message Localization

Layer / File(s) Summary
Localize hint message and update test
cmd/auth/login.go, cmd/auth/login_test.go
The --no-wait JSON response's hint field now uses the shared localized msg.AgentTimeoutHint message constant instead of a hardcoded string with injected device code. Test assertions are updated to verify the new localized guidance content.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • larksuite/cli#1088: Adjusts the auth login --no-wait JSON hint text to enforce new URL-then-QR display guidance with corresponding test updates.
  • larksuite/cli#933: Updates to AgentTimeoutHint and device-flow guidance with corresponding --no-wait --json hint test expectations.
  • larksuite/cli#856: Updates AgentTimeoutHint with opaque/raw-URL handling guidance and assertions on hint content.

Suggested reviewers

  • JackZhao10086
  • albertnusouo

🐰 A message moves from code to locale store,
A test hops along to check it once more,
No QR codes hardcoded, just pointers so clean,
The localization dream is now realized, I ween! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 summarizes the main change: localizing the hint output for the --no-wait --json flag in auth login, which aligns with the actual code modifications.
Description check ✅ Passed The description covers the motivation (hardcoded English hint ignored user's language), the solution (use localized msg.AgentTimeoutHint), and mentions test updates. Though less structured than the template, it contains sufficient detail.
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 unit tests (beta)
  • Create PR with unit tests

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.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@liangshuo-1
Copy link
Copy Markdown
Collaborator

Thanks for the fix, @cloudyan! The only thing blocking this PR is the CLA — could you sign it here? https://cla-assistant.io/larksuite/cli?pullRequest=1142

Once the check turns green we'll review and merge. 🙏

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