From 5fde6222d40f85f9fcf25267af7951b1ae124a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E6=BE=9C?= Date: Tue, 14 Jul 2026 18:34:40 +0800 Subject: [PATCH 1/3] fix: correct calendar rooms help metavar --- internal/app/root_help_test.go | 19 +++++++++++++++++++ internal/cli/schema_catalog.json | 8 ++++---- internal/helpers/calendar.go | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/internal/app/root_help_test.go b/internal/app/root_help_test.go index 02d8e487..d83f31be 100644 --- a/internal/app/root_help_test.go +++ b/internal/app/root_help_test.go @@ -47,6 +47,25 @@ func TestRootHelpHidesCompatibilityOnlyCommands(t *testing.T) { } } +func TestCalendarEventCreateHelpKeepsRoomsStringMetavar(t *testing.T) { + cmd := NewRootCommand() + var out bytes.Buffer + cmd.SetOut(&out) + cmd.SetErr(&out) + cmd.SetArgs([]string{"calendar", "event", "create", "--help"}) + if err := cmd.Execute(); err != nil { + t.Fatalf("calendar event create --help: %v\n%s", err, out.String()) + } + + help := out.String() + if !strings.Contains(help, "--rooms string") { + t.Fatalf("calendar event create help missing string metavar for --rooms:\n%s", help) + } + if strings.Contains(help, "--rooms room search") { + t.Fatalf("calendar event create help treated description text as --rooms metavar:\n%s", help) + } +} + func TestRootKeepsMainBranchChatCompatibilityCommands(t *testing.T) { root := NewRootCommand() listDirect := mustFindCommand(t, root, "chat", "message", "list-direct") diff --git a/internal/cli/schema_catalog.json b/internal/cli/schema_catalog.json index af0aba58..6c5894a9 100644 --- a/internal/cli/schema_catalog.json +++ b/internal/cli/schema_catalog.json @@ -1,6 +1,6 @@ { "version": 1, - "source_hash": "sha256:884195abd73e845d7839395ca832b15ad182853163f5631f8b3d198ec9db3457", + "source_hash": "sha256:0e4542da49f6dd68f25292d9c9bed90df9820b586409af5a1070d134e5db7bc5", "surface_hash": "sha256:e858be68701d256818eccd085a6f7f97655835b9c7cbbce6275ed930c2436dc3", "catalog": { "agent_metadata": { @@ -139979,7 +139979,7 @@ "type": "string" }, "rooms": { - "description": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自 `room search` 返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)", + "description": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自“room search”返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)", "field_provenance": { "description": { "candidates": [ @@ -139987,7 +139987,7 @@ "precedence": "cobra_contract", "selected": true, "source": "cobra_usage", - "value": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自 `room search` 返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)" + "value": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自“room search”返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)" }, { "precedence": "mcp_metadata", @@ -140005,7 +140005,7 @@ "precedence": "cobra_contract", "resolution": "highest_precedence", "source": "cobra_usage", - "value": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自 `room search` 返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)" + "value": "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自“room search”返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)" }, "interface_type": { "candidates": [ diff --git a/internal/helpers/calendar.go b/internal/helpers/calendar.go index e9af5ff0..e0b3c975 100644 --- a/internal/helpers/calendar.go +++ b/internal/helpers/calendar.go @@ -1173,7 +1173,7 @@ func newCalendarCommand() *cobra.Command { eventCreateCmd.Flags().String("members", "", "") _ = eventCreateCmd.Flags().MarkHidden("members") eventCreateCmd.Flags().String("open-dingtalk-ids", "", "openDingTalkId 列表,逗号分隔 (与 --attendees 至少传一个)") - eventCreateCmd.Flags().String("rooms", "", "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自 `room search` 返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)") + eventCreateCmd.Flags().String("rooms", "", "会议室 roomId 列表,逗号分隔 (创建时直接预定,roomId 必须来自“room search”返回,若是循环会议,必须设置recurrence-end-date,避免长期预订)") eventCreateCmd.Flags().String("room-ids", "", "") _ = eventCreateCmd.Flags().MarkHidden("room-ids") eventCreateCmd.Flags().String("roomIds", "", "") From c2e5fec967424ed715b0063ea3a8474d5c8bce46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=AE=E9=9B=A8?= Date: Thu, 16 Jul 2026 11:59:31 +0800 Subject: [PATCH 2/3] test(calendar): cover rooms help in helpers package --- internal/helpers/calendar_help_test.go | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 internal/helpers/calendar_help_test.go diff --git a/internal/helpers/calendar_help_test.go b/internal/helpers/calendar_help_test.go new file mode 100644 index 00000000..1e1fa893 --- /dev/null +++ b/internal/helpers/calendar_help_test.go @@ -0,0 +1,39 @@ +// Copyright 2026 Alibaba Group +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package helpers + +import ( + "bytes" + "strings" + "testing" +) + +func TestCalendarEventCreateHelpKeepsRoomsStringMetavar(t *testing.T) { + cmd := newCalendarCommand() + var out bytes.Buffer + cmd.SetOut(&out) + cmd.SetErr(&out) + cmd.SetArgs([]string{"event", "create", "--help"}) + if err := cmd.Execute(); err != nil { + t.Fatalf("calendar event create --help: %v\n%s", err, out.String()) + } + + help := out.String() + if !strings.Contains(help, "--rooms string") { + t.Fatalf("calendar event create help missing string metavar for --rooms:\n%s", help) + } + if strings.Contains(help, "--rooms room search") { + t.Fatalf("calendar event create help treated description text as --rooms metavar:\n%s", help) + } +} From 2b715e35add5b5ba962769f331e6449a0280146b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=AE=E9=9B=A8?= Date: Thu, 16 Jul 2026 12:04:31 +0800 Subject: [PATCH 3/3] test(calendar): include help check in platform coverage --- internal/helpers/calendar_help_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/helpers/calendar_help_test.go b/internal/helpers/calendar_help_test.go index 1e1fa893..07a1a045 100644 --- a/internal/helpers/calendar_help_test.go +++ b/internal/helpers/calendar_help_test.go @@ -19,7 +19,7 @@ import ( "testing" ) -func TestCalendarEventCreateHelpKeepsRoomsStringMetavar(t *testing.T) { +func TestCrossPlatformCoverageCalendarEventCreateHelpKeepsRoomsStringMetavar(t *testing.T) { cmd := newCalendarCommand() var out bytes.Buffer cmd.SetOut(&out)