diff --git a/.buildkite/pipeline.full.yml b/.buildkite/pipeline.full.yml index 78310a520..0669c7f46 100644 --- a/.buildkite/pipeline.full.yml +++ b/.buildkite/pipeline.full.yml @@ -2,7 +2,7 @@ aliases: - &2020 "2020.3.48f1" - &2021 "2021.3.36f1" - &2022 "2022.3.22f1" - - &2023 "2023.2.17f1" + - &2023 "2023.2.19f1" agents: @@ -186,8 +186,6 @@ steps: - label: Run WebGL e2e tests for Unity 2020 timeout_in_minutes: 30 depends_on: "cocoa-webgl-2020-fixtures" - agents: - queue: opensource-mac-cocoa-11 env: UNITY_VERSION: *2020 plugins: @@ -221,8 +219,6 @@ steps: - label: Run WebGL e2e tests for Unity 2022 timeout_in_minutes: 30 depends_on: 'cocoa-webgl-2022-fixtures' - agents: - queue: opensource-mac-cocoa-11 env: UNITY_VERSION: *2022 plugins: @@ -238,8 +234,6 @@ steps: - label: Run WebGL e2e tests for Unity 2023 timeout_in_minutes: 30 depends_on: 'cocoa-webgl-2023-fixtures' - agents: - queue: opensource-mac-cocoa-11 env: UNITY_VERSION: *2023 plugins: diff --git a/CHANGELOG.md b/CHANGELOG.md index f5e3f3cf1..447772331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 7.7.6 (2024-05-17) + +- Fixed issue where meta files for the MacOS bundle were not generated. [#802](https://github.com/bugsnag/bugsnag-unity/pull/802) + ## 7.7.5 (2024-05-02) ### Bug Fixes diff --git a/build.cake b/build.cake index 327ccfa42..f85a1a27f 100644 --- a/build.cake +++ b/build.cake @@ -5,7 +5,7 @@ var target = Argument("target", "Default"); var solution = File("./BugsnagUnity.sln"); var configuration = Argument("configuration", "Release"); var project = File("./src/BugsnagUnity/BugsnagUnity.csproj"); -var version = "7.7.5"; +var version = "7.7.6"; Task("Restore-NuGet-Packages") .Does(() => NuGetRestore(solution)); diff --git a/features/support/env.rb b/features/support/env.rb index 7f55fd1b7..dc450ff05 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -64,8 +64,6 @@ BeforeAll do $api_key = 'a35a2a72bd230ac0aa0f52715bbdc6aa' - Maze.config.enforce_bugsnag_integrity = false - if Maze.config.os&.downcase == 'macos' # The default macOS Crash Reporter "#{app_name} quit unexpectedly" alert grabs focus which can cause tests to flake. # This option, which appears to have been introduced in macOS 10.11, displays a notification instead of the alert. @@ -113,6 +111,14 @@ end end +Before do |scenario| + # Detect if we're running the webgl tests + if Maze.config.farm.to_s.eql?('local') + # Allows each scenario to auto retry once due to instability in the local browser + scenario.tags << Cucumber::Core::Test::Tag.new(nil, '@retry') + end +end + After do |scenario| next if scenario.status == :skipped diff --git a/src/BugsnagUnity/Delivery.cs b/src/BugsnagUnity/Delivery.cs index 2057f387f..55b8601fd 100644 --- a/src/BugsnagUnity/Delivery.cs +++ b/src/BugsnagUnity/Delivery.cs @@ -9,6 +9,7 @@ using BugsnagUnity.Payload; using UnityEngine; using UnityEngine.Networking; +using System.Security.Cryptography; namespace BugsnagUnity { @@ -187,6 +188,8 @@ IEnumerator PushToServer(IPayload payload) { req.SetRequestHeader("Content-Type", "application/json"); req.SetRequestHeader("Bugsnag-Sent-At", DateTimeOffset.Now.ToString("o", CultureInfo.InvariantCulture)); + req.SetRequestHeader("Bugsnag-Integrity", "sha1 " + Hash(body)); + foreach (var header in payload.Headers) { req.SetRequestHeader(header.Key, header.Value); @@ -278,6 +281,20 @@ private byte[] PrepareEventBodySimple(IPayload payload) return serialisedPayload; } + private string Hash(byte[] input) + { + using (SHA1Managed sha1 = new SHA1Managed()) + { + var hash = sha1.ComputeHash(input); + var sb = new StringBuilder(hash.Length * 2); + foreach (byte b in hash) + { + sb.Append(b.ToString("x2")); + } + return sb.ToString(); + } + } + private bool TruncateBreadcrumbs(Dictionary @event, int bytesToRemove) { var breadcrumbsList = (@event[EVENT_KEY_BREADCRUMBS] as Dictionary[]).ToList(); diff --git a/upm-tools/build-upm-package.sh b/upm-tools/build-upm-package.sh index 521631964..52b03f926 100755 --- a/upm-tools/build-upm-package.sh +++ b/upm-tools/build-upm-package.sh @@ -16,13 +16,22 @@ fi VERSION=$1 -if [ -z "$UNITY_VERSION" ] +if [ -z "$UNITY_UPM_VERSION" ] then - echo "UNITY_VERSION must be set" + echo "UNITY_UPM_VERSION must be set" exit 1 fi -UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS" +#There is a bug in some versions of unity 2020, 2021 and 2022 where macos bundles will not be imported as a single plugin file. +#In which case all sub dirs and files must have .meta files to work with UPM. +#Building the UPM package with unity 2019 ensures that the meta files are created + +if [[ "$UNITY_UPM_VERSION" != *"2019"* ]]; then + echo "ERROR: UNITY_UPM_VERSION must be a version of Unity 2019. See script comments for details." + exit 1 +fi + +UNITY_PATH="/Applications/Unity/Hub/Editor/$UNITY_UPM_VERSION/Unity.app/Contents/MacOS"