From 2e6f1ade73bf59bdda11aa6bffb690fc9bb0c6f7 Mon Sep 17 00:00:00 2001 From: Kutluhan Metin Date: Tue, 26 Sep 2023 16:32:25 +0300 Subject: [PATCH 1/4] [CLC-215]: Serializer Generator Documentation (#406) --- docs/modules/ROOT/nav.adoc | 1 + .../ROOT/pages/clc-serializer-generator.adoc | 139 ++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 docs/modules/ROOT/pages/clc-serializer-generator.adoc diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 6fe04c131..4b435f114 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -33,6 +33,7 @@ ** xref:clc-version.adoc[] ** xref:clc-viridian.adoc[] ** xref:clc-project.adoc[] +** xref:clc-serializer-generator.adoc[] * xref:configuration-format.adoc[] * xref:environment-variables.adoc[] * xref:keyboard-shortcuts.adoc[] diff --git a/docs/modules/ROOT/pages/clc-serializer-generator.adoc b/docs/modules/ROOT/pages/clc-serializer-generator.adoc new file mode 100644 index 000000000..3e2435ef5 --- /dev/null +++ b/docs/modules/ROOT/pages/clc-serializer-generator.adoc @@ -0,0 +1,139 @@ += clc serializer generator (Beta) + +Serializer commands are a group of serializer generator operations. + +Check out the documentation for https://docs.hazelcast.com/hazelcast/latest/serialization/compact-serialization[Compact Serialization] for more information. + +Usage: + +[source,bash] +---- +clc serializer [command] [flags] +---- + +== Commands + +* <> + +== clc serializer generate + +Generates compact serialization code from the given schema for the target language. See https://docs.hazelcast.com/hazelcast/latest/serialization/compact-serialization#implementing-compactserializer[Compact Serialization] documentation for more information. + +Usage: + +[source, bash] +---- +clc serializer generate [schema] [flags] +---- + +Parameters: + +[cols="1m,1a,2a,1a"] +|=== +|Parameter|Required|Description|Default + +|`output-dir`, `-o` +|Optional +|Output directory for the serialization files. +|Current working directory. + +|`language`, `-l` +|Required +|Programming language that the serializer created for. +| +|=== + +Example: + +[source,bash] +---- +clc serializer generate my-schema.yaml --language java --output-dir my-dir +---- + +=== Schema Creation + +A schema allows you to: + +* describe the contents of a compact class using supported field types +* import other schema +* specify a namespaces for schema files and reference other namespaces +* define cyclic references between classes +* reference classes that are not present in the given schemas + +A schema is written in YAML. Schema format is given below: + +[source,yaml] +---- +namespace: +# note that other schema files can be imported with relative path to this yaml file +imports: + - someOtherSchema.yaml +# All objects in this file will share the same namespace. +classes: + - name: + fields: + - name: + type: + external: bool # to mark external types (external to this yaml file) +---- + +==== namespace + +Used for logical grouping of classes. Typically, for every namespace, you will have a schema file. Namespace is optional. If not provided, the classes will be generated at global namespace (no namespace). The user should provide the language specific best practice when using the namespace. The tool will use the namespace while generating code if provided. + +==== imports + +Used to import other schema files. The type definitions in the imported yaml schemas can be used within this yaml file. Cyclic imports will be checked and handled properly. For this version of the tool, an import can only be a single file name and the tool will assume all yaml files imported will be in the same directory as the importing schema file. + +==== classes + +Used to define classes in the schema. + +* name: Name of the class +* fields: Field specification of the class +** name: Name of the field +** type: Type of the field. Normally you should refer to another class as namespace.classname. You can use a class without namespace when the class is defined in the same schema yaml file. type can be one of the following: +*** `boolean` +*** `boolean[]` +*** `int8` +*** `int8[]` +*** `int16` +*** `int16[]` +*** `int32` +*** `int32[]` +*** `int64` +*** `int64[]` +*** `float32` +*** `float32[]` +*** `float64` +*** `float64[]` +*** `string` +*** `string[]` +*** `date` +*** `date[]` +*** `time` +*** `time[]` +*** `timestamp` +*** `timestamp[]` +*** `timestampWithTimezone` +*** `timestampWithTimezone[]` +*** `nullableBoolean` +*** `nullableBoolean[]` +*** `nullableInt8` +*** `nullableInt8[]` +*** `nullableInt16` +*** `nullableInt16[]` +*** `nullableInt32` +*** `nullableInt32[]` +*** `nullableInt64` +*** `nullableInt64[]` +*** `nullableFloat32` +*** `nullableFloat32[]` +*** `nullableFloat64` +*** `nullableFloat64[]` +*** `` +** external: +*** Used to mark if the type is external. If a field is external, the tool will not check if it is imported and available. External types are managed by the user and not generated by the tool. +*** The serializer of an external field can be a custom serializer which is handwritten, the zero-config serializer for Java and .NET, or previously genereated using the tool. This flag will enable such mixed use cases. +*** In generated code, external types are imported exactly what as the "type" of the field, hence for languages like Java the user should enter the full package name together with the class. E.g. type: `com.app1.dto.Address`. + From b0e9f353ae59ffafa985f83aec0dec6f721b2f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Y=C3=BCce=20Tekol?= Date: Tue, 26 Sep 2023 17:10:18 +0300 Subject: [PATCH 2/4] Fixed TestViridian/deleteCluster_NonInteractive (#407) --- base/commands/viridian/viridian_it_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/commands/viridian/viridian_it_test.go b/base/commands/viridian/viridian_it_test.go index ee7292dec..526b36f05 100644 --- a/base/commands/viridian/viridian_it_test.go +++ b/base/commands/viridian/viridian_it_test.go @@ -75,7 +75,7 @@ func loginWithParams_NonInteractiveTest(t *testing.T) { tcx.Tester(func(tcx it.TestContext) { ctx := context.Background() tcx.CLCExecute(ctx, "viridian", "login", "--api-base", "dev2", "--api-key", it.ViridianAPIKey(), "--api-secret", it.ViridianAPISecret()) - tcx.AssertStdoutContains("Viridian token was fetched and saved.") + tcx.AssertStdoutContains("Saved the access token") }) } From 9055d2ef9da9d3fb6e80d3d75102e49dcaf9a17b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Y=C3=BCce=20Tekol?= Date: Tue, 26 Sep 2023 18:28:22 +0300 Subject: [PATCH 3/4] Added 5.3.4 release notes (#408) * Added release notes for 5.3.4 * Fixed Viridian tests --- base/commands/viridian/viridian_it_test.go | 21 +++++++-------- docs/modules/ROOT/nav.adoc | 1 + .../ROOT/pages/release-notes-5.3.4.adoc | 26 +++++++++++++++++++ 3 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 docs/modules/ROOT/pages/release-notes-5.3.4.adoc diff --git a/base/commands/viridian/viridian_it_test.go b/base/commands/viridian/viridian_it_test.go index 526b36f05..d33528016 100644 --- a/base/commands/viridian/viridian_it_test.go +++ b/base/commands/viridian/viridian_it_test.go @@ -132,12 +132,12 @@ func listClusters_InteractiveTest(t *testing.T) { tcx.WithShell(ctx, func(tcx it.TestContext) { tcx.WithReset(func() { tcx.WriteStdin([]byte("\\viridian list-clusters\n")) - tcx.AssertStderrContains("OK") + tcx.AssertStdoutContains("OK") }) c := createOrGetClusterWithState(ctx, tcx, "RUNNING") tcx.WithReset(func() { tcx.WriteStdin([]byte("\\viridian list-clusters\n")) - tcx.AssertStderrContains("OK") + tcx.AssertStdoutContains("OK") tcx.AssertStdoutContains(c.ID) }) }) @@ -166,8 +166,7 @@ func createCluster_InteractiveTest(t *testing.T) { tcx.WriteStdinf("\\viridian create-cluster --development --verbose --name %s \n", clusterName) time.Sleep(10 * time.Second) check.Must(waitState(ctx, tcx, "", "RUNNING")) - tcx.AssertStdoutContains(fmt.Sprintf("Imported configuration: %s", clusterName)) - tcx.AssertStderrContains("OK") + tcx.AssertStdoutContains("OK") require.True(t, paths.Exists(paths.ResolveConfigDir(clusterName))) _ = check.MustValue(tcx.Viridian.GetClusterWithName(ctx, clusterName)) @@ -180,7 +179,7 @@ func stopCluster_NonInteractiveTest(t *testing.T) { viridianTester(t, func(ctx context.Context, tcx it.TestContext) { c := createOrGetClusterWithState(ctx, tcx, "RUNNING") tcx.CLCExecute(ctx, "viridian", "stop-cluster", c.ID) - tcx.AssertStderrContains("OK") + tcx.AssertStdoutContains("OK") check.Must(waitState(ctx, tcx, c.ID, "STOPPED")) }) } @@ -192,7 +191,7 @@ func stopCluster_InteractiveTest(t *testing.T) { tcx.WithReset(func() { c := createOrGetClusterWithState(ctx, tcx, "RUNNING") tcx.WriteStdinf("\\viridian stop-cluster %s\n", c.Name) - tcx.AssertStderrContains("OK") + tcx.AssertStdoutContains("OK") check.Must(waitState(ctx, tcx, c.ID, "STOPPED")) }) }) @@ -215,7 +214,7 @@ func resumeCluster_InteractiveTest(t *testing.T) { tcx.WithReset(func() { c := createOrGetClusterWithState(ctx, tcx, "STOPPED") tcx.WriteStdinf("\\viridian resume-cluster %s\n", c.Name) - tcx.AssertStderrContains("OK") + tcx.AssertStdoutContains("OK") check.Must(waitState(ctx, tcx, c.ID, "RUNNING")) }) }) @@ -240,7 +239,7 @@ func getCluster_InteractiveTest(t *testing.T) { tcx.WithReset(func() { c := createOrGetClusterWithState(ctx, tcx, "") tcx.WriteStdinf("\\viridian get-cluster %s\n", c.Name) - tcx.AssertStderrContains("OK") + tcx.AssertStdoutContains("OK") tcx.AssertStdoutContains(c.Name) tcx.AssertStdoutContains(c.ID) }) @@ -269,7 +268,7 @@ func deleteCluster_InteractiveTest(t *testing.T) { tcx.WriteStdinf("\\viridian delete-cluster %s\n", c.Name) tcx.AssertStdoutContains("(y/n)") tcx.WriteStdin([]byte("y")) - tcx.AssertStderrContains("OK") + tcx.AssertStdoutContains("OK") require.Eventually(t, func() bool { _, err := tcx.Viridian.GetCluster(ctx, c.ID) return err == nil @@ -287,7 +286,7 @@ func downloadLogs_NonInteractiveTest(t *testing.T) { c := createOrGetClusterWithState(ctx, tcx, "RUNNING") tcx.WithReset(func() { tcx.CLCExecute(ctx, "viridian", "download-logs", c.ID, "--output-dir", dir) - tcx.AssertStderrContains("OK") + tcx.AssertStdoutContains("OK") require.FileExists(t, paths.Join(dir, "node-1.log")) }) }) @@ -303,7 +302,7 @@ func downloadLogs_InteractiveTest(t *testing.T) { tcx.WithReset(func() { c := createOrGetClusterWithState(ctx, tcx, "RUNNING") tcx.WriteStdinf("\\viridian download-logs %s -o %s\n", c.Name, dir) - tcx.AssertStderrContains("OK") + tcx.AssertStdoutContains("OK") require.FileExists(t, paths.Join(dir, "node-1.log")) }) }) diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 4b435f114..e1f65fe28 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -40,6 +40,7 @@ * xref:phone-homes.adoc[] .Release Notes +* xref:release-notes-5.3.4.adoc[5.3.4] * xref:release-notes-5.3.3.adoc[5.3.3] * xref:release-notes-5.3.2.adoc[5.3.2] * xref:release-notes-5.3.1.adoc[5.3.1] diff --git a/docs/modules/ROOT/pages/release-notes-5.3.4.adoc b/docs/modules/ROOT/pages/release-notes-5.3.4.adoc new file mode 100644 index 000000000..d24343941 --- /dev/null +++ b/docs/modules/ROOT/pages/release-notes-5.3.4.adoc @@ -0,0 +1,26 @@ += 5.3.4 Release Notes + +== New Features + +* Added the `serializer generate` command that creates Java Compact Serialization classess from the given schema. +* Added an update checker which displays a notification in the interactive mode. You can disable it by setting the `CLC_SKIP_SERVER_VERSION_CHECK` to `1`. +* In order to make an informed decision about CLC improvements and features, we started to collect non-identifiable telemetry. You can disable this by setting `HZ_PHONE_HOME_ENABLED` environment variable to `false`. You can find more information in the xref:phone-homes.adoc[documentation]. +* CLC can now be installed using an install script on Linux and macOS systems. Just run `curl https://hazelcast.com/clc/install.sh | bash`. + +== Improvements + +* Improved configuration selector. +* If there's a single configuration, do not display the configuration selector and use that configuration automatically. +* Updated `job submit` command to deduce the job ID. + +== Changes + +* Confirmation is required from the user when `demo generate-data` command runs. + +== Fixes + +* CLC interactive prompt doesn't change after config wizard. +* Readline panic in the interactive mode if terminal width cannot be determined and left arrow is pressed. +* Map proxy is created when a `map` command is used. +* "connecting to cluster" prompt is not shown when `object list` command runs. +* Fixed `list add` command. From cc98064a8955d3aeb1dd521ab5e58f39faec3ab6 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Mon, 30 Oct 2023 12:04:50 +0300 Subject: [PATCH 4/4] Added the source code message. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index e7840b880..57498213d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # Hazelcast CLC +> [!IMPORTANT] +> This repository contains the source code for CLC v5.3.3. +> CLC v5.3.4 and up are binary only releases. +> The binary releases can be downloaded from: +> https://github.com/hazelcast/hazelcast-commandline-client/releases + ## Installation Currently we provide precompiled binaries of CLC for the following platforms and architectures: