test#1625
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a new ChangesWhoami command
Sequence Diagram(s)sequenceDiagram
participant buildInternal
participant whoami.NewCmdWhoami
participant whoamiRun
participant buildIdentityView
participant printPretty
buildInternal->>whoami.NewCmdWhoami: register whoami subcommand
whoami.NewCmdWhoami->>whoamiRun: execute with parsed flags
whoamiRun->>buildIdentityView: normalize diagnostics into whoamiResult
whoamiRun->>printPretty: render human-readable output when --json is false
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@cmd/whoami/whoami_test.go`:
- Around line 102-108: The failure-path tests in whoami_test.go only assert that
an error occurred, so they can miss regressions in error metadata. Update the
affected tests around runWhoami and the typed error checks to use errs.ProblemOf
for category/subtype and cause preservation, and use errors.As with
*errs.ValidationError to verify Param where the --as validation path is
involved. Keep the assertions aligned with the existing error contract so the
tests fail if category, subtype, param, or cause handling changes.
In `@cmd/whoami/whoami.go`:
- Around line 77-85: In resolveSource, the check for strict mode should take
precedence over the --as flag so identity resolution reports the actual source.
Update the ordering in whoami.go so the ForcedIdentity() path from
f.ResolveStrictMode(ctx) returns "strictMode" before the
cmd.Flags().Changed("as") branch can return "flag"; keep the defaultAs fallback
after both.
- Around line 192-207: Pretty output is dropping the resolved bot identity
because printPretty only renders the user branch and never prints bot
AppName/OpenID from buildIdentityView. Update printPretty to also handle id.As
== core.AsBot and render the bot identity details alongside the existing user
and token/verified fields, keeping the human-readable output consistent with the
JSON path.
🪄 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
Run ID: 320ef62f-f41b-4b14-a1be-41046404fd4a
📒 Files selected for processing (4)
cmd/build.gocmd/whoami/whoami.gocmd/whoami/whoami_test.goskills/lark-shared/SKILL.md
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1625 +/- ##
==========================================
+ Coverage 74.64% 74.65% +0.01%
==========================================
Files 806 807 +1
Lines 81386 81493 +107
==========================================
+ Hits 60752 60842 +90
- Misses 16101 16109 +8
- Partials 4533 4542 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@1f9fc99c08d4cec7ee338dca28723310a29a4dd6🧩 Skill updatenpx skills add larksuite/cli#feat/whoami-identity -y -g |
|
Closing this PR — superseded/cleanup per author request. |
1f9fc99 to
8a268aa
Compare
No description provided.