From 0559b1fb16fc104baf5da3a5bddbad7742fca9b2 Mon Sep 17 00:00:00 2001 From: leehosu Date: Wed, 25 Sep 2024 11:51:54 +0900 Subject: [PATCH 01/10] feat: Add examples for 'argo archive list' with option explanations Signed-off-by: leehosu --- cmd/argo/commands/archive/list.go | 16 ++++++++++++++++ docs/cli/argo_archive_list.md | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/cmd/argo/commands/archive/list.go b/cmd/argo/commands/archive/list.go index 5747ffa73e96..18a4c0a01367 100644 --- a/cmd/argo/commands/archive/list.go +++ b/cmd/argo/commands/archive/list.go @@ -25,6 +25,22 @@ func NewListCommand() *cobra.Command { command := &cobra.Command{ Use: "list", Short: "list workflows in the archive", + Example: ` +# Display all archive lists in the default format (wide) +argo archive list + +# Output in JSON format +argo archive list -o json + +# Filter list based on a specific label selector +argo archive list -l key1=value1,key2=value2 + +# Fetch the list in chunks instead of all at once +argo archive list --chunk-size 100 + +# Display help information for the command +argo archive list -h +`, Run: func(cmd *cobra.Command, args []string) { ctx, apiClient := client.NewAPIClient(cmd.Context()) serviceClient, err := apiClient.NewArchivedWorkflowServiceClient() diff --git a/docs/cli/argo_archive_list.md b/docs/cli/argo_archive_list.md index 13de7b0df279..62b66a9aab6a 100644 --- a/docs/cli/argo_archive_list.md +++ b/docs/cli/argo_archive_list.md @@ -6,6 +6,24 @@ list workflows in the archive argo archive list [flags] ``` +## Examples +``` +# Display all archive lists in the default format (wide) +argo archive list + +# Output in JSON format +argo archive list -o json + +# Filter list based on a specific label selector +argo archive list -l key1=value1,key2=value2 + +# Fetch the list in chunks instead of all at once +argo archive list --chunk-size 100 + +# Display help information for the command +argo archive list -h +``` + ### Options ``` From f1d61a1b84e6f5926a2e26cd17cce2818843ad3a Mon Sep 17 00:00:00 2001 From: leehosu Date: Wed, 25 Sep 2024 13:26:31 +0900 Subject: [PATCH 02/10] refactor: syntax checking Signed-off-by: leehosu --- cmd/argo/commands/archive/list.go | 11 +++++------ docs/cli/argo_archive_list.md | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/argo/commands/archive/list.go b/cmd/argo/commands/archive/list.go index 18a4c0a01367..db55e8d376d6 100644 --- a/cmd/argo/commands/archive/list.go +++ b/cmd/argo/commands/archive/list.go @@ -25,20 +25,19 @@ func NewListCommand() *cobra.Command { command := &cobra.Command{ Use: "list", Short: "list workflows in the archive", - Example: ` -# Display all archive lists in the default format (wide) + Example: `# Display all archive lists in the default format (wide) : argo archive list -# Output in JSON format +# Output in JSON format : argo archive list -o json -# Filter list based on a specific label selector +# Filter list based on a specific label selector : argo archive list -l key1=value1,key2=value2 -# Fetch the list in chunks instead of all at once +# Fetch the list in chunks instead of all at once : argo archive list --chunk-size 100 -# Display help information for the command +# Display help information for the command : argo archive list -h `, Run: func(cmd *cobra.Command, args []string) { diff --git a/docs/cli/argo_archive_list.md b/docs/cli/argo_archive_list.md index 62b66a9aab6a..5470a2bd1469 100644 --- a/docs/cli/argo_archive_list.md +++ b/docs/cli/argo_archive_list.md @@ -6,7 +6,8 @@ list workflows in the archive argo archive list [flags] ``` -## Examples +### Examples + ``` # Display all archive lists in the default format (wide) argo archive list From 1d980485105deb97f4bb9be6d4e8a09f7fd08e84 Mon Sep 17 00:00:00 2001 From: leehosu Date: Wed, 25 Sep 2024 13:28:26 +0900 Subject: [PATCH 03/10] refactor: syntax checking Signed-off-by: leehosu --- cmd/argo/commands/archive/list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/argo/commands/archive/list.go b/cmd/argo/commands/archive/list.go index db55e8d376d6..567d56e282ce 100644 --- a/cmd/argo/commands/archive/list.go +++ b/cmd/argo/commands/archive/list.go @@ -25,7 +25,7 @@ func NewListCommand() *cobra.Command { command := &cobra.Command{ Use: "list", Short: "list workflows in the archive", - Example: `# Display all archive lists in the default format (wide) : + Example: `# Display all archive lists in the default format (wide) : argo archive list # Output in JSON format : From 588b36b35ca4138547083b8cdfb45cc1b97fa589 Mon Sep 17 00:00:00 2001 From: leehosu Date: Wed, 25 Sep 2024 14:05:48 +0900 Subject: [PATCH 04/10] refactor: Refactor archive list commands to maintain convention Signed-off-by: leehosu --- cmd/argo/commands/archive/list.go | 20 +++++++++----------- docs/cli/argo_archive_list.md | 18 ++++++++---------- v3 | 1 - 3 files changed, 17 insertions(+), 22 deletions(-) delete mode 120000 v3 diff --git a/cmd/argo/commands/archive/list.go b/cmd/argo/commands/archive/list.go index 567d56e282ce..b68c1934303e 100644 --- a/cmd/argo/commands/archive/list.go +++ b/cmd/argo/commands/archive/list.go @@ -25,20 +25,18 @@ func NewListCommand() *cobra.Command { command := &cobra.Command{ Use: "list", Short: "list workflows in the archive", - Example: `# Display all archive lists in the default format (wide) : -argo archive list + Example: ` +# List all archives: + argo archive list -# Output in JSON format : -argo archive list -o json +# List all archives in JSON format: + argo archive list -o json -# Filter list based on a specific label selector : -argo archive list -l key1=value1,key2=value2 +# List archives filtered that have both labels: + argo archive list -l key1=value1,key2=value2 -# Fetch the list in chunks instead of all at once : -argo archive list --chunk-size 100 - -# Display help information for the command : -argo archive list -h +# List archives fetched in chunks of 100: + argo archive list --chunk-size 100 `, Run: func(cmd *cobra.Command, args []string) { ctx, apiClient := client.NewAPIClient(cmd.Context()) diff --git a/docs/cli/argo_archive_list.md b/docs/cli/argo_archive_list.md index 5470a2bd1469..627005f762d0 100644 --- a/docs/cli/argo_archive_list.md +++ b/docs/cli/argo_archive_list.md @@ -9,20 +9,18 @@ argo archive list [flags] ### Examples ``` -# Display all archive lists in the default format (wide) -argo archive list +# List all archives: + argo archive list -# Output in JSON format -argo archive list -o json +# List all archives in JSON format: + argo archive list -o json -# Filter list based on a specific label selector -argo archive list -l key1=value1,key2=value2 +# List archives filtered that have both labels: + argo archive list -l key1=value1,key2=value2 -# Fetch the list in chunks instead of all at once -argo archive list --chunk-size 100 +# List archives fetched in chunks of 100: + argo archive list --chunk-size 100 -# Display help information for the command -argo archive list -h ``` ### Options diff --git a/v3 b/v3 deleted file mode 120000 index 945c9b46d684..000000000000 --- a/v3 +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file From 22b5a817d3b2998881b9faab184b6b01b5f82f35 Mon Sep 17 00:00:00 2001 From: leehosu Date: Wed, 25 Sep 2024 14:48:41 +0900 Subject: [PATCH 05/10] refactor: syntax checking Signed-off-by: leehosu --- docs/cli/argo_archive_list.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/cli/argo_archive_list.md b/docs/cli/argo_archive_list.md index 627005f762d0..07821af9aa56 100644 --- a/docs/cli/argo_archive_list.md +++ b/docs/cli/argo_archive_list.md @@ -7,7 +7,6 @@ argo archive list [flags] ``` ### Examples - ``` # List all archives: argo archive list @@ -20,7 +19,6 @@ argo archive list [flags] # List archives fetched in chunks of 100: argo archive list --chunk-size 100 - ``` ### Options From 697ac4c2322254b4853a487f41ad850e52a3502e Mon Sep 17 00:00:00 2001 From: leehosu Date: Wed, 25 Sep 2024 15:06:16 +0900 Subject: [PATCH 06/10] refactor: syntax checking Signed-off-by: leehosu --- docs/cli/argo_archive_list.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/cli/argo_archive_list.md b/docs/cli/argo_archive_list.md index 07821af9aa56..97d95d314f1e 100644 --- a/docs/cli/argo_archive_list.md +++ b/docs/cli/argo_archive_list.md @@ -7,6 +7,7 @@ argo archive list [flags] ``` ### Examples + ``` # List all archives: argo archive list From 8e372580725aca3c2d4b7ec5c04865ea5f1e8deb Mon Sep 17 00:00:00 2001 From: leehosu Date: Wed, 25 Sep 2024 15:59:51 +0900 Subject: [PATCH 07/10] refactor: syntax checking Signed-off-by: leehosu --- cmd/argo/commands/archive/list.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/argo/commands/archive/list.go b/cmd/argo/commands/archive/list.go index b68c1934303e..40cbe5d6fa5c 100644 --- a/cmd/argo/commands/archive/list.go +++ b/cmd/argo/commands/archive/list.go @@ -25,8 +25,7 @@ func NewListCommand() *cobra.Command { command := &cobra.Command{ Use: "list", Short: "list workflows in the archive", - Example: ` -# List all archives: + Example: `# List all archives: argo archive list # List all archives in JSON format: From a23bac74cd6ecd647df94ebad07bedb6e5273ab1 Mon Sep 17 00:00:00 2001 From: leehosu Date: Wed, 25 Sep 2024 18:12:11 +0900 Subject: [PATCH 08/10] refactor: syntax test for codegen test Signed-off-by: leehosu --- docs/cli/argo_archive_list.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/cli/argo_archive_list.md b/docs/cli/argo_archive_list.md index 97d95d314f1e..627005f762d0 100644 --- a/docs/cli/argo_archive_list.md +++ b/docs/cli/argo_archive_list.md @@ -20,6 +20,7 @@ argo archive list [flags] # List archives fetched in chunks of 100: argo archive list --chunk-size 100 + ``` ### Options From 2419107c83ab66c53783b0a5ee34fbb49bc2ece0 Mon Sep 17 00:00:00 2001 From: l2h Date: Fri, 27 Sep 2024 09:06:16 +0900 Subject: [PATCH 09/10] Update cmd/argo/commands/archive/list.go Co-authored-by: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> Signed-off-by: l2h --- cmd/argo/commands/archive/list.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/argo/commands/archive/list.go b/cmd/argo/commands/archive/list.go index 40cbe5d6fa5c..4a990d0ebea7 100644 --- a/cmd/argo/commands/archive/list.go +++ b/cmd/argo/commands/archive/list.go @@ -25,17 +25,17 @@ func NewListCommand() *cobra.Command { command := &cobra.Command{ Use: "list", Short: "list workflows in the archive", - Example: `# List all archives: + Example: `# List all archived workflows: argo archive list -# List all archives in JSON format: - argo archive list -o json +# List all archived workflows fetched in chunks of 100: + argo archive list --chunk-size 100 -# List archives filtered that have both labels: - argo archive list -l key1=value1,key2=value2 +# List all archived workflows in YAML format: + argo archive list -o yaml -# List archives fetched in chunks of 100: - argo archive list --chunk-size 100 +# List archived workflows that have both labels: + argo archive list -l key1=value1,key2=value2 `, Run: func(cmd *cobra.Command, args []string) { ctx, apiClient := client.NewAPIClient(cmd.Context()) From bfe6a09971f10877cd0cb5c98d005fd7fd51d326 Mon Sep 17 00:00:00 2001 From: leehosu Date: Sat, 28 Sep 2024 20:38:08 +0900 Subject: [PATCH 10/10] refactor: Apply previous suggestion to generated CLI docs Signed-off-by: leehosu --- docs/cli/argo_archive_list.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/cli/argo_archive_list.md b/docs/cli/argo_archive_list.md index 627005f762d0..c27daefa86c8 100644 --- a/docs/cli/argo_archive_list.md +++ b/docs/cli/argo_archive_list.md @@ -9,17 +9,17 @@ argo archive list [flags] ### Examples ``` -# List all archives: +# List all archived workflows: argo archive list -# List all archives in JSON format: - argo archive list -o json +# List all archived workflows fetched in chunks of 100: + argo archive list --chunk-size 100 -# List archives filtered that have both labels: - argo archive list -l key1=value1,key2=value2 +# List all archived workflows in YAML format: + argo archive list -o yaml -# List archives fetched in chunks of 100: - argo archive list --chunk-size 100 +# List archived workflows that have both labels: + argo archive list -l key1=value1,key2=value2 ```