From 0a337dd683cd6a332c4e42965ffe872198bdbb62 Mon Sep 17 00:00:00 2001 From: Yousif Ahmed Date: Mon, 10 Jan 2022 11:21:06 +0000 Subject: [PATCH 1/4] Update CHANGELOG --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6285ab..6ae8e89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,22 @@ Changelog ========= +## 3.0.0 (2022-01-10) + +### Breaking Changes + +The `Bugnsag.dll`, `Bugsnag.AspNet.dll`, `Bugsnag.AspNet.Mvc.dll` and `Bugsnag.AspNet.WebApi.dll` assemblies are now strong-name signed. The strong name key file `Bugsnag.snk` has been added to the repository. `Bugsnag.AspNet.Core.dll` remains unchanged. See the upgrade guide for more details. + +### Bug fixes + +* Strong name sign assemblies + | [yousif-bugsnag](https://github.com/yousif-bugsnag) + | [#151](https://github.com/bugsnag/bugsnag-dotnet/pull/151) + +* Ensure breadcrumbs are returned in the correct order + | [yousif-bugsnag](https://github.com/yousif-bugsnag) + | [#150](https://github.com/bugsnag/bugsnag-dotnet/pull/150) + ## 2.2.3 (2021-09-06) ### Enhancements From e0f54856d72394cb9f1b9127f874af5930e427cc Mon Sep 17 00:00:00 2001 From: Yousif <74918474+yousif-bugsnag@users.noreply.github.com> Date: Mon, 24 Jan 2022 14:55:33 +0000 Subject: [PATCH 2/4] Update UPGRADING.md Co-authored-by: Gareth Thackeray --- UPGRADING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/UPGRADING.md b/UPGRADING.md index 9215e02..25fac76 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -9,6 +9,7 @@ If you are targeting .NET Framework, v3.0.0 contains binary breaking changes due true ``` +.NET Core and .NET 5/6 do not recognise strong names so there is no action required if targetting one of those. ## 1.x to 2.x *Our .NET notifier has gone through some major improvements, and there are some changes you'll need to make to get onto the new version.* From debfd1dd48b3b845e738b9ec68295495adf654c4 Mon Sep 17 00:00:00 2001 From: Yousif Ahmed Date: Mon, 31 Jan 2022 10:55:21 +0000 Subject: [PATCH 3/4] Update release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ae8e89..f40b72c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ Changelog ========= -## 3.0.0 (2022-01-10) +## 3.0.0 (2022-01-31) ### Breaking Changes From f199ee168a3016cd3a4483201f8c5837744f3618 Mon Sep 17 00:00:00 2001 From: Frank Mand Date: Wed, 16 Feb 2022 14:37:07 +0100 Subject: [PATCH 4/4] Ensure RemoveProjectRoots works for assemblies run on different OSes --- src/Bugsnag/Middleware.cs | 21 ++++++++++++++++++--- tests/Bugsnag.Tests/MiddlewareTests.cs | 6 ++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/Bugsnag/Middleware.cs b/src/Bugsnag/Middleware.cs index ca20cad..76511b4 100644 --- a/src/Bugsnag/Middleware.cs +++ b/src/Bugsnag/Middleware.cs @@ -39,11 +39,26 @@ public static class InternalMiddleware { var projectRoots = report.Configuration.ProjectRoots.Select(prefix => { // if the file prefix is missing a final directory seperator then we should - // add one first - if (prefix[prefix.Length - 1] != System.IO.Path.DirectorySeparatorChar) + // add one first. + var finalChar = prefix[prefix.Length - 1]; + + // Check if a prefix is a Unix-based path, if it is we add a `/`. + // Otherwise its a Windows-based path and we add `\` instead, if necessary. + if (prefix[0] == '/') + { + if (finalChar != '/') + { + prefix = $"{prefix}/"; + } + } + else if (finalChar != '\\') { - prefix = $"{prefix}{System.IO.Path.DirectorySeparatorChar}"; + // DirectorySeparatorChar is not being used because its `/` on Unix + // systems and will break the check when running assemblies build + // on Windows but are run on Linux. + prefix = $"{prefix}\\"; } + return prefix; }).ToArray(); diff --git a/tests/Bugsnag.Tests/MiddlewareTests.cs b/tests/Bugsnag.Tests/MiddlewareTests.cs index bd875d5..3dbfca8 100644 --- a/tests/Bugsnag.Tests/MiddlewareTests.cs +++ b/tests/Bugsnag.Tests/MiddlewareTests.cs @@ -58,8 +58,14 @@ public void ProjectRootStrippingTests(string[] projectRoots, string fileName, st public static IEnumerable ProjectRootTestData() { + // Tests for Windows-based paths yield return new object[] { new string[] { @"C:\app" }, @"C:\app\Class.cs", "Class.cs" }; yield return new object[] { new string[] { @"C:\app\" }, @"C:\app\Class.cs", "Class.cs" }; + + // Tests for Unix-based paths + yield return new object[] { new string[] { @"/app" }, @"/app/Class.cs", "Class.cs" }; + yield return new object[] { new string[] { @"/app/" }, @"/app/Class.cs", "Class.cs" }; + // for this scenario we should only strip the file path once, here we // have a setup where the first prefix will then also cause the second // prefix to match. This should only strip the first prefix