Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync 'develop' to 'release/22.0' #1809

Merged
merged 3 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 30 additions & 14 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -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
<details>
<summary><b>Logging feature</b>. Performance review, redesign and improvements with new best practices to log</summary>

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
</details>
<details>
<summary><b>Quality of Service feature</b>. Redesign and stabilization, and it produces less log records now.</summary>

- 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
</details>
<details>
<summary>Documentation for <b>Logging</b>, <b>Request ID</b>, <b>Routing</b> and <b>Websockets</b></summary>

- [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)
</details>
<details>
<summary>Testing improvements and stabilization aka <b>bug fixing</b></summary>

### 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
</details>
20 changes: 11 additions & 9 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ Task("CreateReleaseNotes")
var releaseHeader = string.Format(System.IO.File.ReadAllText("./ReleaseNotes.md"), releaseVersion, lastRelease);
releaseNotes = new List<string> { 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))
Expand Down Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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)}");
}

Expand Down Expand Up @@ -510,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);
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions docs/features/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------

Expand All @@ -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
--------------
Expand Down Expand Up @@ -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
^^^^^
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -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.
Expand Down