From d7efec67d60175d2195147ae070449b14a3f95c1 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Fri, 24 May 2024 01:12:44 +0200 Subject: [PATCH 1/7] ci: Fix incorrect DLL version on release (#380) --- .github/workflows/release-automated.yml | 14 ++++++------ package-lock.json | 30 +++++++++++++++++++++++++ package.json | 1 + release.config.js | 7 ++++++ 4 files changed, 45 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-automated.yml b/.github/workflows/release-automated.yml index d686f1d9..f4863e62 100644 --- a/.github/workflows/release-automated.yml +++ b/.github/workflows/release-automated.yml @@ -15,13 +15,13 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: '5.0.x' - - name: Restore .NET dependencies - run: dotnet restore /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/Parse.csproj - - name: Build .NET project - run: dotnet build /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/Parse.csproj -c Release - - name: List output directory contents - run: ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0 + dotnet-version: '8' + # - name: Restore .NET dependencies + # run: dotnet restore /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/Parse.csproj + # - name: Build .NET project + # run: dotnet build /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/Parse.csproj -c Release + # - name: List output directory contents + # run: ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0 - name: Set up Node.js uses: actions/setup-node@v2 with: diff --git a/package-lock.json b/package-lock.json index 4ad2bc29..53d6b2b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@droidsolutions-oss/semantic-release-update-file": "1.4.0", "@semantic-release/changelog": "6.0.0", "@semantic-release/commit-analyzer": "9.0.2", + "@semantic-release/exec": "6.0.3", "@semantic-release/git": "10.0.1", "@semantic-release/release-notes-generator": "10.0.3", "semantic-release": "19.0.3" @@ -365,6 +366,35 @@ "integrity": "sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg==", "dev": true }, + "node_modules/@semantic-release/exec": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/exec/-/exec-6.0.3.tgz", + "integrity": "sha512-bxAq8vLOw76aV89vxxICecEa8jfaWwYITw6X74zzlO0mc/Bgieqx9kBRz9z96pHectiTAtsCwsQcUyLYWnp3VQ==", + "dev": true, + "dependencies": { + "@semantic-release/error": "^3.0.0", + "aggregate-error": "^3.0.0", + "debug": "^4.0.0", + "execa": "^5.0.0", + "lodash": "^4.17.4", + "parse-json": "^5.0.0" + }, + "engines": { + "node": ">=14.17" + }, + "peerDependencies": { + "semantic-release": ">=18.0.0" + } + }, + "node_modules/@semantic-release/exec/node_modules/@semantic-release/error": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", + "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", + "dev": true, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@semantic-release/git": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", diff --git a/package.json b/package.json index 25b44e4d..fc0c8418 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "@droidsolutions-oss/semantic-release-update-file": "1.4.0", "@semantic-release/changelog": "6.0.0", "@semantic-release/commit-analyzer": "9.0.2", + "@semantic-release/exec": "6.0.3", "@semantic-release/git": "10.0.1", "@semantic-release/release-notes-generator": "10.0.3", "semantic-release": "19.0.3" diff --git a/release.config.js b/release.config.js index b14351ad..4632c511 100644 --- a/release.config.js +++ b/release.config.js @@ -89,6 +89,13 @@ async function config() { } ] }], + ["@semantic-release/exec", { + 'verifyConditionsCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0', + 'prepareCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0', + 'publishCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0', + 'successCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0', + 'failCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0', + }], ['@droidsolutions-oss/semantic-release-nuget', { projectPath: './Parse/Parse.csproj', includeSymbols: true, From 816ba02fa3765e01825da741cedb377eb53c97f6 Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 24 May 2024 01:40:28 +0200 Subject: [PATCH 2/7] fix: SDK crash on conversion of double type range values to long type (#342) --- Parse.Tests/JsonTests.cs | 25 +++++++++++++++++++ .../Infrastructure/Utilities/JsonUtilities.cs | 16 ++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/Parse.Tests/JsonTests.cs b/Parse.Tests/JsonTests.cs index ef67f6e8..49688cb1 100644 --- a/Parse.Tests/JsonTests.cs +++ b/Parse.Tests/JsonTests.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Globalization; using Microsoft.VisualStudio.TestTools.UnitTesting; using Parse.Infrastructure.Utilities; @@ -250,5 +251,29 @@ public void TestSpecialJsonNumbersAndModifiers() Assert.AreEqual(123456789123456789, (JsonUtilities.Parse("{ \"mura\": 123456789123456789 }") as IDictionary)["mura"]); } + + + [TestMethod] + public void TestJsonNumbersAndValueRanges() + { + //Assert.ThrowsException(() => JsonUtilities.Parse("+123456789")); + Assert.IsInstanceOfType((JsonUtilities.Parse("{ \"long\": " + long.MaxValue + " }") as IDictionary)["long"], typeof(long)); + Assert.IsInstanceOfType((JsonUtilities.Parse("{ \"long\": " + long.MinValue + " }") as IDictionary)["long"], typeof(long)); + + Assert.AreEqual((JsonUtilities.Parse("{ \"long\": " + long.MaxValue + " }") as IDictionary)["long"], long.MaxValue); + Assert.AreEqual((JsonUtilities.Parse("{ \"long\": " + long.MinValue + " }") as IDictionary)["long"], long.MinValue); + + + Assert.IsInstanceOfType((JsonUtilities.Parse("{ \"double\": " + double.MaxValue.ToString(CultureInfo.InvariantCulture) + " }") as IDictionary)["double"], typeof(double)); + Assert.IsInstanceOfType((JsonUtilities.Parse("{ \"double\": " + double.MinValue.ToString(CultureInfo.InvariantCulture) + " }") as IDictionary)["double"], typeof(double)); + + Assert.AreEqual((JsonUtilities.Parse("{ \"double\": " + double.MaxValue.ToString(CultureInfo.InvariantCulture) + " }") as IDictionary)["double"], double.MaxValue); + Assert.AreEqual((JsonUtilities.Parse("{ \"double\": " + double.MinValue.ToString(CultureInfo.InvariantCulture) + " }") as IDictionary)["double"], double.MinValue); + + double outOfInt64RangeValue = -9223372036854776000d; + Assert.IsInstanceOfType((JsonUtilities.Parse("{ \"double\": " + outOfInt64RangeValue.ToString(CultureInfo.InvariantCulture) + " }") as IDictionary)["double"], typeof(double)); + Assert.AreEqual((JsonUtilities.Parse("{ \"double\": " + outOfInt64RangeValue.ToString(CultureInfo.InvariantCulture) + " }") as IDictionary)["double"], outOfInt64RangeValue); + } + } } diff --git a/Parse/Infrastructure/Utilities/JsonUtilities.cs b/Parse/Infrastructure/Utilities/JsonUtilities.cs index 3f7d5a79..585e2110 100644 --- a/Parse/Infrastructure/Utilities/JsonUtilities.cs +++ b/Parse/Infrastructure/Utilities/JsonUtilities.cs @@ -212,8 +212,20 @@ private bool ParseNumber(out object output) } else { - output = Int64.Parse(m.Value, CultureInfo.InvariantCulture); - return true; + // try to parse to a long assuming it is an integer value (this might fail due to value range differences when storing as double without decimal point or exponent) + if (Int64.TryParse(m.Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out long longValue)) + { + output = longValue; + return true; + } + // try to parse as double again (most likely due to value range exceeding long type + else if (Double.TryParse(m.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out double doubleValue)) + { + output = doubleValue; + return true; + } + else + return false; } } From 860e2577a8f9316dfca84252799b41ac3398ab4f Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Fri, 24 May 2024 10:57:19 +0200 Subject: [PATCH 3/7] ci: Fix auto-release (#382) --- .github/workflows/ci.yml | 2 +- .github/workflows/release-automated.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ddec8a0..829e364b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Set up .NET SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: '5.0.x' + dotnet-version: '6.x' - name: Cache NuGet packages uses: actions/cache@v2 with: diff --git a/.github/workflows/release-automated.yml b/.github/workflows/release-automated.yml index f4863e62..2c89b036 100644 --- a/.github/workflows/release-automated.yml +++ b/.github/workflows/release-automated.yml @@ -15,7 +15,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: '8' + dotnet-version: '6.x' # - name: Restore .NET dependencies # run: dotnet restore /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/Parse.csproj # - name: Build .NET project From b7cdca4fb4affd813e440a9d75cf0b2bc3051500 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Fri, 24 May 2024 11:09:24 +0200 Subject: [PATCH 4/7] ci: Fix auto-release (#384) --- release.config.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/release.config.js b/release.config.js index 4632c511..f9e52ffe 100644 --- a/release.config.js +++ b/release.config.js @@ -90,11 +90,18 @@ async function config() { ] }], ["@semantic-release/exec", { - 'verifyConditionsCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0', - 'prepareCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0', - 'publishCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0', - 'successCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0', - 'failCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin/Release/netstandard2.0', + 'verifyConditionsCmd': 'find / -name "Parse.dll" 2>/dev/null', + 'prepareCmd': 'find / -name "Parse.dll" 2>/dev/null', + 'publishCmd': 'find / -name "Parse.dll" 2>/dev/null', + 'successCmd': 'find / -name "Parse.dll" 2>/dev/null', + 'failCmd': 'find / -name "Parse.dll" 2>/dev/null', + }], + ["@semantic-release/exec", { + 'verifyConditionsCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin', + 'prepareCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin', + 'publishCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin', + 'successCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin', + 'failCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin', }], ['@droidsolutions-oss/semantic-release-nuget', { projectPath: './Parse/Parse.csproj', From c95a1c0d8e161f5f4fa480e04127a1c1d0bc816c Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sat, 25 May 2024 00:02:19 +0200 Subject: [PATCH 5/7] ci: Fix auto-release (#385) --- release.config.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/release.config.js b/release.config.js index f9e52ffe..e836dfc8 100644 --- a/release.config.js +++ b/release.config.js @@ -89,20 +89,20 @@ async function config() { } ] }], - ["@semantic-release/exec", { - 'verifyConditionsCmd': 'find / -name "Parse.dll" 2>/dev/null', - 'prepareCmd': 'find / -name "Parse.dll" 2>/dev/null', - 'publishCmd': 'find / -name "Parse.dll" 2>/dev/null', - 'successCmd': 'find / -name "Parse.dll" 2>/dev/null', - 'failCmd': 'find / -name "Parse.dll" 2>/dev/null', - }], - ["@semantic-release/exec", { - 'verifyConditionsCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin', - 'prepareCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin', - 'publishCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin', - 'successCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin', - 'failCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin', - }], + // ["@semantic-release/exec", { + // 'verifyConditionsCmd': 'find / -name "Parse.dll" 2>/dev/null', + // 'prepareCmd': 'find / -name "Parse.dll" 2>/dev/null', + // 'publishCmd': 'find / -name "Parse.dll" 2>/dev/null', + // 'successCmd': 'find / -name "Parse.dll" 2>/dev/null', + // 'failCmd': 'find / -name "Parse.dll" 2>/dev/null', + // }], + // ["@semantic-release/exec", { + // 'verifyConditionsCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin 2>/dev/null', + // 'prepareCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin 2>/dev/null', + // 'publishCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin 2>/dev/null', + // 'successCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin 2>/dev/null', + // 'failCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin 2>/dev/null', + // }], ['@droidsolutions-oss/semantic-release-nuget', { projectPath: './Parse/Parse.csproj', includeSymbols: true, From 571e265520a015c28d3bb84a4487d67a19e3b51f Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sat, 25 May 2024 00:09:52 +0200 Subject: [PATCH 6/7] ci: Fix auto-release (#386) --- release.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release.config.js b/release.config.js index e836dfc8..247bb4e8 100644 --- a/release.config.js +++ b/release.config.js @@ -78,6 +78,7 @@ async function config() { ['@semantic-release/changelog', { 'changelogFile': changelogFile, }], + // Updates the project version in the semantic release prepare step ['@droidsolutions-oss/semantic-release-update-file', { 'files': [ { @@ -103,6 +104,10 @@ async function config() { // 'successCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin 2>/dev/null', // 'failCmd': 'ls -la /home/runner/work/Parse-SDK-dotNET/Parse-SDK-dotNET/Parse/bin 2>/dev/null', // }], + // Build the DLL file after the version has been updated + ["@semantic-release/exec", { + 'prepareCmd': 'dotnet build ./Parse/Parse.csproj -c Release', + }], ['@droidsolutions-oss/semantic-release-nuget', { projectPath: './Parse/Parse.csproj', includeSymbols: true, From 86efe371ba4e61244b34d793f71456e306a540bd Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 24 May 2024 22:10:26 +0000 Subject: [PATCH 7/7] chore(release): 3.0.1 [skip ci] ## [3.0.1](https://github.com/parse-community/Parse-SDK-dotNET/compare/3.0.0...3.0.1) (2024-05-24) ### Bug Fixes * SDK crash on conversion of double type range values to long type ([#342](https://github.com/parse-community/Parse-SDK-dotNET/issues/342)) ([816ba02](https://github.com/parse-community/Parse-SDK-dotNET/commit/816ba02fa3765e01825da741cedb377eb53c97f6)) --- CHANGELOG.md | 7 +++++++ Parse/Parse.csproj | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 918ce5a0..8a1bd385 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [3.0.1](https://github.com/parse-community/Parse-SDK-dotNET/compare/3.0.0...3.0.1) (2024-05-24) + + +### Bug Fixes + +* SDK crash on conversion of double type range values to long type ([#342](https://github.com/parse-community/Parse-SDK-dotNET/issues/342)) ([816ba02](https://github.com/parse-community/Parse-SDK-dotNET/commit/816ba02fa3765e01825da741cedb377eb53c97f6)) + # [3.0.0](https://github.com/parse-community/Parse-SDK-dotNET/compare/2.0.0...3.0.0) (2024-05-23) diff --git a/Parse/Parse.csproj b/Parse/Parse.csproj index bbd83611..ad42605f 100644 --- a/Parse/Parse.csproj +++ b/Parse/Parse.csproj @@ -3,7 +3,7 @@ netstandard2.0 bin\Release\netstandard2.0\Parse.xml - 3.0.0 + 3.0.1 latest Parse diff --git a/package-lock.json b/package-lock.json index 53d6b2b9..e175a24d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "parse-sdk-dotnet", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "parse-sdk-dotnet", - "version": "3.0.0", + "version": "3.0.1", "devDependencies": { "@droidsolutions-oss/semantic-release-nuget": "1.4.1", "@droidsolutions-oss/semantic-release-update-file": "1.4.0", diff --git a/package.json b/package.json index fc0c8418..9eb3598d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parse-sdk-dotnet", - "version": "3.0.0", + "version": "3.0.1", "devDependencies": { "@droidsolutions-oss/semantic-release-nuget": "1.4.1", "@droidsolutions-oss/semantic-release-update-file": "1.4.0",