From 7dde80e907e6bf0eb731d59e36479afc4f06550b Mon Sep 17 00:00:00 2001
From: Cristian Maglie <c.maglie@arduino.cc>
Date: Wed, 17 Jul 2024 21:23:38 +0200
Subject: [PATCH 1/3] Removed useless gRPCClientUnknown tag

---
 commands/instances.go | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/commands/instances.go b/commands/instances.go
index bd6764cf51d..3ec59027070 100644
--- a/commands/instances.go
+++ b/commands/instances.go
@@ -67,9 +67,6 @@ func (s *arduinoCoreServerImpl) Create(ctx context.Context, req *rpc.CreateReque
 	if md, ok := metadata.FromIncomingContext(ctx); ok {
 		userAgent = strings.Join(md.Get("user-agent"), " ")
 	}
-	if userAgent == "" {
-		userAgent = "gRPCClientUnknown/0.0.0"
-	}
 
 	// Setup downloads directory
 	downloadsDir := s.settings.DownloadsDir()

From 7f8ad1ff9ffaedc452c4d55ed1000bb2573573ea Mon Sep 17 00:00:00 2001
From: Cristian Maglie <c.maglie@arduino.cc>
Date: Wed, 17 Jul 2024 21:49:43 +0200
Subject: [PATCH 2/3] 'task build' now uses a compliant semver notation

---
 .github/workflows/publish-go-tester-task.yml | 2 +-
 Taskfile.yml                                 | 2 +-
 commands/service_check_for_updates.go        | 2 +-
 internal/cli/version/version.go              | 2 +-
 internal/integrationtest/main/main_test.go   | 6 +++---
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml
index c83f00957d8..0af77c9bc55 100644
--- a/.github/workflows/publish-go-tester-task.yml
+++ b/.github/workflows/publish-go-tester-task.yml
@@ -151,7 +151,7 @@ jobs:
         uses: actions/download-artifact@v3
       - name: Output checksum
         run: |
-          TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot"
+          TAG="${{ needs.package-name-prefix.outputs.prefix }}1.0.0-snapshot"
           declare -a artifacts=($(ls -d */))
           for artifact in ${artifacts[@]}
           do
diff --git a/Taskfile.yml b/Taskfile.yml
index d5cbf0131a0..848ea4dfc4f 100755
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -362,7 +362,7 @@ vars:
     sh: echo "{{now | date "20060102"}}"
   TAG:
     sh: echo "$(git tag --points-at=HEAD 2> /dev/null | head -n1 | sed 's/^v//')"
-  VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}git-snapshot{{end}}"
+  VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}1.0.0-snapshot{{end}}"
   CONFIGURATION_PACKAGE: "github.com/arduino/arduino-cli/version"
   LDFLAGS: >-
     -ldflags
diff --git a/commands/service_check_for_updates.go b/commands/service_check_for_updates.go
index 15221905d56..da850975c48 100644
--- a/commands/service_check_for_updates.go
+++ b/commands/service_check_for_updates.go
@@ -61,7 +61,7 @@ func (s *arduinoCoreServerImpl) CheckForArduinoCLIUpdates(ctx context.Context, r
 // shouldCheckForUpdate return true if it actually makes sense to check for new updates,
 // false in all other cases.
 func (s *arduinoCoreServerImpl) shouldCheckForUpdate(currentVersion *semver.Version) bool {
-	if strings.Contains(currentVersion.String(), "git-snapshot") || strings.Contains(currentVersion.String(), "nightly") {
+	if strings.Contains(currentVersion.String(), "1.0.0-snapshot") || strings.Contains(currentVersion.String(), "nightly") {
 		// This is a dev build, no need to check for updates
 		return false
 	}
diff --git a/internal/cli/version/version.go b/internal/cli/version/version.go
index 5748ded3a64..153b4736ab6 100644
--- a/internal/cli/version/version.go
+++ b/internal/cli/version/version.go
@@ -48,7 +48,7 @@ func runVersionCommand(ctx context.Context, srv rpc.ArduinoCoreServiceServer) {
 	logrus.Info("Executing `arduino-cli version`")
 
 	info := version.VersionInfo
-	if strings.Contains(info.VersionString, "git-snapshot") || strings.Contains(info.VersionString, "nightly") {
+	if strings.Contains(info.VersionString, "1.0.0-snapshot") || strings.Contains(info.VersionString, "nightly") {
 		// We're using a development version, no need to check if there's a
 		// new release available
 		feedback.PrintResult(info)
diff --git a/internal/integrationtest/main/main_test.go b/internal/integrationtest/main/main_test.go
index b702e07aecc..abbdfdf60a2 100644
--- a/internal/integrationtest/main/main_test.go
+++ b/internal/integrationtest/main/main_test.go
@@ -58,10 +58,10 @@ func TestVersion(t *testing.T) {
 	// Checks if Application's value is arduino-cli
 	require.Equal(t, jsonMap["Application"], "arduino-cli")
 
-	// Checks if VersionString's value is git-snapshot, nightly or a valid semantic versioning
+	// Checks if VersionString's value is 1.0.0-snapshot, nightly or a valid semantic versioning
 	switch version := jsonMap["VersionString"]; version {
-	case "git-snapshot":
-		require.Contains(t, version, "git-snapshot")
+	case "1.0.0-snapshot":
+		require.Contains(t, version, "1.0.0-snapshot")
 	case "nightly":
 		require.Contains(t, version, "nightly")
 	default:

From aae8c8a7b9d1693aae9a4a3f754ae922b26792b6 Mon Sep 17 00:00:00 2001
From: Cristian Maglie <c.maglie@arduino.cc>
Date: Thu, 18 Jul 2024 12:13:55 +0200
Subject: [PATCH 3/3] Revert "'task build' now uses a compliant semver
 notation"

This reverts commit 7f8ad1ff9ffaedc452c4d55ed1000bb2573573ea.
---
 .github/workflows/publish-go-tester-task.yml | 2 +-
 Taskfile.yml                                 | 2 +-
 commands/service_check_for_updates.go        | 2 +-
 internal/cli/version/version.go              | 2 +-
 internal/integrationtest/main/main_test.go   | 6 +++---
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml
index 0af77c9bc55..c83f00957d8 100644
--- a/.github/workflows/publish-go-tester-task.yml
+++ b/.github/workflows/publish-go-tester-task.yml
@@ -151,7 +151,7 @@ jobs:
         uses: actions/download-artifact@v3
       - name: Output checksum
         run: |
-          TAG="${{ needs.package-name-prefix.outputs.prefix }}1.0.0-snapshot"
+          TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot"
           declare -a artifacts=($(ls -d */))
           for artifact in ${artifacts[@]}
           do
diff --git a/Taskfile.yml b/Taskfile.yml
index 848ea4dfc4f..d5cbf0131a0 100755
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -362,7 +362,7 @@ vars:
     sh: echo "{{now | date "20060102"}}"
   TAG:
     sh: echo "$(git tag --points-at=HEAD 2> /dev/null | head -n1 | sed 's/^v//')"
-  VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}1.0.0-snapshot{{end}}"
+  VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}git-snapshot{{end}}"
   CONFIGURATION_PACKAGE: "github.com/arduino/arduino-cli/version"
   LDFLAGS: >-
     -ldflags
diff --git a/commands/service_check_for_updates.go b/commands/service_check_for_updates.go
index da850975c48..15221905d56 100644
--- a/commands/service_check_for_updates.go
+++ b/commands/service_check_for_updates.go
@@ -61,7 +61,7 @@ func (s *arduinoCoreServerImpl) CheckForArduinoCLIUpdates(ctx context.Context, r
 // shouldCheckForUpdate return true if it actually makes sense to check for new updates,
 // false in all other cases.
 func (s *arduinoCoreServerImpl) shouldCheckForUpdate(currentVersion *semver.Version) bool {
-	if strings.Contains(currentVersion.String(), "1.0.0-snapshot") || strings.Contains(currentVersion.String(), "nightly") {
+	if strings.Contains(currentVersion.String(), "git-snapshot") || strings.Contains(currentVersion.String(), "nightly") {
 		// This is a dev build, no need to check for updates
 		return false
 	}
diff --git a/internal/cli/version/version.go b/internal/cli/version/version.go
index 153b4736ab6..5748ded3a64 100644
--- a/internal/cli/version/version.go
+++ b/internal/cli/version/version.go
@@ -48,7 +48,7 @@ func runVersionCommand(ctx context.Context, srv rpc.ArduinoCoreServiceServer) {
 	logrus.Info("Executing `arduino-cli version`")
 
 	info := version.VersionInfo
-	if strings.Contains(info.VersionString, "1.0.0-snapshot") || strings.Contains(info.VersionString, "nightly") {
+	if strings.Contains(info.VersionString, "git-snapshot") || strings.Contains(info.VersionString, "nightly") {
 		// We're using a development version, no need to check if there's a
 		// new release available
 		feedback.PrintResult(info)
diff --git a/internal/integrationtest/main/main_test.go b/internal/integrationtest/main/main_test.go
index abbdfdf60a2..b702e07aecc 100644
--- a/internal/integrationtest/main/main_test.go
+++ b/internal/integrationtest/main/main_test.go
@@ -58,10 +58,10 @@ func TestVersion(t *testing.T) {
 	// Checks if Application's value is arduino-cli
 	require.Equal(t, jsonMap["Application"], "arduino-cli")
 
-	// Checks if VersionString's value is 1.0.0-snapshot, nightly or a valid semantic versioning
+	// Checks if VersionString's value is git-snapshot, nightly or a valid semantic versioning
 	switch version := jsonMap["VersionString"]; version {
-	case "1.0.0-snapshot":
-		require.Contains(t, version, "1.0.0-snapshot")
+	case "git-snapshot":
+		require.Contains(t, version, "git-snapshot")
 	case "nightly":
 		require.Contains(t, version, "nightly")
 	default: