fix(registry): describe the attendance and mindnotes domains - #2210
Conversation
Both are registered, reachable business domains — `lark-cli attendance user_tasks query` and `lark-cli mindnotes nodes create` run, and both appear in `auth login --domain` — but neither had an entry in service_descriptions.json. GetServiceTitle/GetServiceDescription returned "", so buildDomainMeta fell back to the typed service spec, which carries one string for both languages. The result was visible in `--help`: mindnotes rendered its Chinese description in the English domain list, and attendance rendered "attendance record query", a lowercase fragment shown in both locales. Both keep their own scope namespaces (attendance:task:readonly, mindnote:node:create/read) and stay independent auth domains, so no auth_domain is set. whiteboard remains the only domain folded into docs. TestGetDomainMetadata_HasTitleAndDescription could not catch this: it asserts on buildDomainMeta's output, which the fallback had already made non-empty. The new reconciliation test walks EmbeddedServicesTyped plus AllShortcuts and asserts both languages resolve from the config itself, before any fallback. EmbeddedServicesTyped is the overlay-free parse, so the test does not depend on what remote_meta.json happens to hold on the machine — a domain that only ever arrives via remote overlay stays out of its reach.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe registry adds bilingual descriptions for ChangesService description coverage
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@5824114005ede5a92fca05d13fbf8fc2145d9751🧩 Skill updatenpx skills add larksuite/cli#fix/service-descriptions-missing-domains -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2210 +/- ##
==========================================
- Coverage 76.08% 76.07% -0.01%
==========================================
Files 983 983
Lines 103429 103429
==========================================
- Hits 78692 78686 -6
- Misses 18752 18758 +6
Partials 5985 5985 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Both are registered, reachable business domains — `lark-cli attendance user_tasks query` and `lark-cli mindnotes nodes create` run, and both appear in `auth login --domain` — but neither had an entry in service_descriptions.json. GetServiceTitle/GetServiceDescription returned "", so buildDomainMeta fell back to the typed service spec, which carries one string for both languages. The result was visible in `--help`: mindnotes rendered its Chinese description in the English domain list, and attendance rendered "attendance record query", a lowercase fragment shown in both locales. Both keep their own scope namespaces (attendance:task:readonly, mindnote:node:create/read) and stay independent auth domains, so no auth_domain is set. whiteboard remains the only domain folded into docs. TestGetDomainMetadata_HasTitleAndDescription could not catch this: it asserts on buildDomainMeta's output, which the fallback had already made non-empty. The new reconciliation test walks EmbeddedServicesTyped plus AllShortcuts and asserts both languages resolve from the config itself, before any fallback. EmbeddedServicesTyped is the overlay-free parse, so the test does not depend on what remote_meta.json happens to hold on the machine — a domain that only ever arrives via remote overlay stays out of its reach. Co-authored-by: TRAE CLI <traecli@bytedance.com>
Summary
internal/registry/service_descriptions.jsonis the description table for every business domain the CLI exposes, but two registered domains were missing from it:attendanceandmindnotes. Both are reachable today —lark-cli attendance user_tasks queryandlark-cli mindnotes nodes createrun, and both are offered byauth login --domain— so the omission surfaced directly in help output.With no entry,
registry.GetServiceTitle/GetServiceDescriptionreturn""andbuildDomainMeta(cmd/auth/login_interactive.go:95) falls back to the typed service spec, which carries a single string for both languages:A full two-way reconciliation found nothing else: the 21 pre-existing keys all map to live registered domains, so nothing is removed.
Changes
internal/registry/service_descriptions.json: add bilingualattendanceandmindnotesentries, inserted in the file's existing alphabetical positions.Neither gets an
auth_domain. Both own a top-level scope namespace (attendance:task:readonly,mindnote:node:create/mindnote:node:read), and folding a domain in removes it from theauth logindomain picker, so they stay independently selectable.whiteboardremains the only domain folded intodocs.cmd/auth/login_test.go: addTestEveryRegisteredDomain_HasBilingualDescription, which walksregistry.EmbeddedServicesTyped()plusshortcuts.AllShortcuts()and asserts both languages resolve for every registered domain.The pre-existing
TestGetDomainMetadata_HasTitleAndDescriptioncould not catch this class of bug: it asserts onbuildDomainMeta's output, and the spec fallback had already made that non-empty. The new test asserts on the registry getters, i.e. the config itself, before any fallback can paper over the gap. Failures name the domain and where it is registered.It reads
EmbeddedServicesTyped(the overlay-free parse) rather thanServicesTyped, so the result does not depend on whatever~/.lark-cli/cache/remote_meta.jsonholds on the machine — otherwise CI and a developer box could disagree. The stated cost is that a domain arriving only via remote overlay is out of its reach; that is recorded in the test comment rather than left implicit.No production code paths change — this is a data entry plus a test.
Test Plan
go test -count=1 ./cmd/... ./internal/... ./shortcuts/...— all greenConfirmed the new test is not vacuous: with the JSON change stashed it fails, naming exactly the two domains across all four assertions
Rebuilt and checked
lark-cli --helprenders English for both domains (output above)lark-cli auth login --helpstill listsattendanceandmindnotesas independent selectable domains, confirming no accidental foldTwo-way set diff of
--helpdomains against the JSON keys: 23 vs 23, both directions emptygofmtandgo vetclean on touched packages; JSON validatesRelated Issues
buildDomainMetafallback itself is what let a Chinese description render in English help. This PR fixes the two affected domains but leaves that mechanism in place, so the same failure mode returns if a future domain ships without an entry — the new test guards the embedded set, not the remote-overlay set.Summary by CodeRabbit
Documentation
Tests