From 22bc5b692a6428bde31045a496251f7a9e4dba6d Mon Sep 17 00:00:00 2001 From: raman-m Date: Mon, 27 Nov 2023 22:05:44 +0300 Subject: [PATCH 1/2] Release 22.0 | +semver: breaking --- ReleaseNotes.md | 44 ++++++++++++++++++++++++++------------- build.cake | 11 +++++----- docs/conf.py | 2 +- docs/features/logging.rst | 8 +++++-- docs/index.rst | 2 +- 5 files changed, 44 insertions(+), 23 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 1193d5db1..e3df12c17 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,17 +1,33 @@ -## Upgrade to .NET 8 (version {0}) aka [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) release -> Read article: [Announcing .NET 8](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8/) by Gaurav Seth, on November 14th, 2023 +## October 2023 (version {0}) aka [Swiss Locomotive](https://en.wikipedia.org/wiki/SBB-CFF-FFS_Ae_6/6) release +> Codenamed as **[Swiss Locomotive](https://www.google.com/search?q=swiss+locomotive)** -### About -We are pleased to announce to you that we can now offer the support of [.NET 8](https://dotnet.microsoft.com/en-us/download). -But that is not all, in this release, we are adopting support of several versions of the .NET framework through [multitargeting](https://learn.microsoft.com/en-us/dotnet/standard/frameworks). -The Ocelot distribution is now compatible with .NET **6**, **7** and **8**. :tada: +### Focused On +
+ Logging feature. Performance review, redesign and improvements with new best practices to log -In the future, we will try to ensure the support of the [.NET SDKs](https://dotnet.microsoft.com/en-us/download/dotnet) that are still actively maintained by the .NET team and community. -Current .NET versions in support are the following: [6, 7, 8](https://dotnet.microsoft.com/en-us/download/dotnet). + - Proposing a centralized `WriteLog` method for the `OcelotLogger` + - Factory methods for computed strings such as `string.Format` or interpolated strings + - Using `ILogger.IsEnabled` before calling the native `WriteLog` implementation and invoking string factory method +
+
+ Quality of Service feature. Redesign and stabilization, and it produces less log records now. + + - Fixing issue with [Polly](https://www.thepollyproject.org/) Circuit Breaker not opening after max number of retries reached + - Removing useless log calls that could have an impact on performance + - Polly [lib](https://www.nuget.org/packages/Polly#versions-body-tab) reference updating to latest `8.2.0` with some code improvements +
+
+ Documentation for Logging, Request ID, Routing and Websockets + + - [Logging](https://ocelot.readthedocs.io/en/latest/features/logging.html) + - [Request ID](https://ocelot.readthedocs.io/en/latest/features/requestid.html) + - [Routing](https://ocelot.readthedocs.io/en/latest/features/routing.html) + - [Websockets](https://ocelot.readthedocs.io/en/latest/features/websockets.html) +
+
+ Testing improvements and stabilization aka bug fixing -### Technical info -As an ASP.NET Core app, now Ocelot targets `net6.0`, `net7.0` and `net8.0` frameworks. - -Starting with **v{0}**, the solution's code base supports [Multitargeting](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-multitargeting-overview) as SDK-style projects. -It should be easier for teams to move between (migrate to) .NET 6, 7 and 8 frameworks. Also, new features will be available for all .NET SDKs which we support via multitargeting. -Find out more here: [Target frameworks in SDK-style projects](https://learn.microsoft.com/en-us/dotnet/standard/frameworks) + - [Routing](https://ocelot.readthedocs.io/en/latest/features/routing.html) bug fixing: query string placeholders including **CatchAll** one aka `{{everything}}` and query string duplicates removal + - [QoS](https://ocelot.readthedocs.io/en/latest/features/qualityofservice.html) bug fixing: Polly circuit breaker exceptions + - Testing bug fixing: rare failed builds because of unstable Polly tests. Acceptance common logic for ports +
diff --git a/build.cake b/build.cake index 75f30a755..5047c5acc 100644 --- a/build.cake +++ b/build.cake @@ -161,7 +161,8 @@ Task("CreateReleaseNotes") var releaseHeader = string.Format(System.IO.File.ReadAllText("./ReleaseNotes.md"), releaseVersion, lastRelease); releaseNotes = new List { releaseHeader }; - var shortlogSummary = GitHelper($"shortlog --no-merges --numbered --summary {lastRelease}..HEAD"); + var shortlogSummary = GitHelper($"shortlog --no-merges --numbered --summary {lastRelease}..HEAD") + .ToList(); var re = new Regex(@"^[\s\t]*(?'commits'\d+)[\s\t]+(?'author'.*)$"); var summary = shortlogSummary .Where(x => re.IsMatch(x)) @@ -207,7 +208,6 @@ Task("CreateReleaseNotes") static string HonorForDeletions(string place, string author, int commits, int files, int insertions, int deletions) => HonorForInsertions(place, author, commits, files, insertions, $"and **{deletions}** deletion{Plural(deletions)}"); - var statistics = new List<(string Contributor, int Files, int Insertions, int Deletions)>(); foreach (var group in commitsGrouping) { if (topContributors.Count >= top3) break; @@ -220,6 +220,7 @@ Task("CreateReleaseNotes") } else // multiple candidates with the same number of commits, so, group by files changed { + var statistics = new List<(string Contributor, int Files, int Insertions, int Deletions)>(); var shortstatRegex = new Regex(@"^\s*(?'files'\d+)\s+files?\s+changed(?'ins',\s+(?'insertions'\d+)\s+insertions?\(\+\))?(?'del',\s+(?'deletions'\d+)\s+deletions?\(\-\))?\s*$"); // Collect statistics from git log & shortlog foreach (var author in group.authors) @@ -315,15 +316,15 @@ private void WriteReleaseNotes() Information($"RUN {nameof(WriteReleaseNotes)} ..."); EnsureDirectoryExists(packagesDir); - System.IO.File.WriteAllLines(releaseNotesFile, releaseNotes); + System.IO.File.WriteAllLines(releaseNotesFile, releaseNotes, Encoding.UTF8); - var content = System.IO.File.ReadAllText(releaseNotesFile); + var content = System.IO.File.ReadAllText(releaseNotesFile, Encoding.UTF8); if (string.IsNullOrEmpty(content)) { System.IO.File.WriteAllText(releaseNotesFile, "No commits since last release"); } - Information($"Release notes are >>>\n{content}<<<"); + Information("Release notes are >>>\n{0}<<<", content); Information($"EXITED {nameof(WriteReleaseNotes)}"); } diff --git a/docs/conf.py b/docs/conf.py index 8bd28ecbf..dca77bb40 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,7 @@ project = 'Ocelot' copyright = ' 2023 ThreeMammals Ocelot team' author = 'Tom Pallister, Ocelot Core team at ThreeMammals' -release = '21.0' +release = '22.0' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/docs/features/logging.rst b/docs/features/logging.rst index a8bc91336..037502db3 100644 --- a/docs/features/logging.rst +++ b/docs/features/logging.rst @@ -24,6 +24,8 @@ Every log record has these 2 properties: As an ``IOcelotLogger`` interface object being injected to constructors of service classes, current default Ocelot logger (``OcelotLogger`` class) reads these 2 properties from the ``IRequestScopedDataRepository`` interface object. Find out more about these properties and other details on the *Request ID* logging feature in the :doc:`../features/requestid` chapter. +.. _logging-warning: + Warning ------- @@ -34,7 +36,9 @@ The team has had so many issues about performance issues with Ocelot and it is a * Use ``Error`` and ``Critical`` levels in production environment! * Use ``Warning`` level in testing & staging environments! -These and other recommendations are below in the `Best Practices <#best-practices>`_ section. +These and other recommendations are below in the :ref:`logging-best-practices` section. + +.. _logging-best-practices: Best Practices -------------- @@ -88,7 +92,7 @@ Second ^^^^^^ Ensure proper usage of minimum logging level for each environment: development, testing, production, etc. -So, once again, read important notes of the `Warning <#warning>`_ section! +So, once again, read important notes of the :ref:`logging-warning` section! Third ^^^^^ diff --git a/docs/index.rst b/docs/index.rst index 3ec283703..87d0afa5f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -Welcome to Ocelot 21.0 +Welcome to Ocelot 22.0 ====================== Thanks for taking a look at the Ocelot documentation! Please use the left hand navigation to get around. From 349825f92c8c51fd8973aa20448643ae3d049220 Mon Sep 17 00:00:00 2001 From: raman-m Date: Tue, 28 Nov 2023 15:45:28 +0300 Subject: [PATCH 2/2] Switch off the PublishToNuget task --- build.cake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build.cake b/build.cake index 5047c5acc..1e8f4a032 100644 --- a/build.cake +++ b/build.cake @@ -511,10 +511,11 @@ Task("PublishToNuget") .IsDependentOn("DownloadGitHubReleaseArtifacts") .Does(() => { - if (IsRunningOnCircleCI()) - { - PublishPackages(packagesDir, artifactsFile, nugetFeedStableKey, nugetFeedStableUploadUrl, nugetFeedStableSymbolsUploadUrl); - } + Information("Skipping of publishing to NuGet..."); + // if (IsRunningOnCircleCI()) + // { + // PublishPackages(packagesDir, artifactsFile, nugetFeedStableKey, nugetFeedStableUploadUrl, nugetFeedStableSymbolsUploadUrl); + // } }); RunTarget(target);