From db930d4bd552af85dd1147ff249d5737f8d65e74 Mon Sep 17 00:00:00 2001 From: Raman Maksimchuk Date: Thu, 31 Oct 2024 19:58:14 +0300 Subject: [PATCH] Release 23.3.6 | v23.3.4 Hotfixes | October'24 release | +semver: patch (#2185) * Update authors for NuGet packs property * Update release notes * Review build.cake: sort starring by contribution statistics. Reuse iterators of Top Contributors as Starring iterators. * Update docs * Update build cake --- LICENSE.md | 2 +- ReleaseNotes.md | 26 +- build.cake | 476 +++++++++++------- docs/building/devprocess.rst | 134 ++--- docs/building/releaseprocess.rst | 57 ++- docs/features/kubernetes.rst | 28 +- docs/index.rst | 4 +- docs/releasenotes.rst | 4 +- .../Ocelot.Administration.csproj | 2 +- .../Ocelot.Cache.CacheManager.csproj | 2 +- .../Ocelot.Provider.Consul.csproj | 2 +- .../Ocelot.Provider.Eureka.csproj | 2 +- .../Ocelot.Provider.Kubernetes.csproj | 2 +- .../Ocelot.Provider.Polly.csproj | 2 +- .../Ocelot.Tracing.Butterfly.csproj | 2 +- .../Ocelot.Tracing.OpenTracing.csproj | 2 +- src/Ocelot/Ocelot.csproj | 2 +- 17 files changed, 437 insertions(+), 312 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index f81511d45..fe18de60a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,5 +1,5 @@ The MIT License (MIT) -Copyright (c) 2023 Tom Pallister, Ocelot Core team at ThreeMammals, and GitHub Ocelot community. +Copyright (c) 2024 Tom Pallister, Raman Maksimchuk and GitHub Ocelot community. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 431faf471..725946f5c 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,8 +1,26 @@ -## :package: Documentation patch (version {0}), technical release +## :fire: Hot fixing v[23.3.4](https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.4) (version {0}) aka [October'24](https://github.com/ThreeMammals/Ocelot/milestone/7) release > Read the Docs: [Ocelot 23.3](https://ocelot.readthedocs.io/en/{0}/) -> PDF Doc: [Ocelot 23.3](https://ocelot.readthedocs.io/_/downloads/en/{0}/pdf/) > Hot fixed version: [23.3.4](https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.4) +> Milestone: [October'24](https://github.com/ThreeMammals/Ocelot/milestone/7) + +:heart: A heartfelt "Thank You" to **[Nikolai Masson](https://github.com/Niksson)** (@Niksson) and **[Nikolay Kuksov](https://github.com/kick2nick)** (@kick2nick) for their contributions! ### :information_source: About -This documentation patch pertains to HTML and PDF document layouts. -No NuGet packages have been uploaded. +This release provides minor bug fixes from the previous [23.3.4](https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.4) release. All bugs have been addressed in the [October'24](https://github.com/ThreeMammals/Ocelot/milestone/7) milestone. + +:notebook: For projects utilizing the [Service Discovery](https://ocelot.readthedocs.io/en/latest/features/servicediscovery.html) feature, it is recommended to update to this version to benefit from the unstable release [23.3.4](https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.4), which includes fixes for both `Consul` and `Kube` discovery providers. + +### :technologist: Technical Information +The Ocelot solution encountered a significant issue with the disabled scope validation of services in the DI-container, affecting both testing projects and the core library. Initially, this was not problematic when services were designed as singletons by previous contributors and our team. However, with the introduction of more scoped services by the Ocelot team, it became clear that our testing projects could not adequately handle them. +This patch introduces scope validation across all domains: unit tests, acceptance tests, and the core library itself. We advise always enabling scope validation in your custom Ocelot solutions, especially when dealing with numerous C# overridden classes in the DI-container and any attached custom functionality. + +The patch enhances functionality for two primary [Service Discovery](https://github.com/ThreeMammals/Ocelot/blob/main/docs/features/servicediscovery.rst) providers: +- The [Ocelot.Provider.Consul](https://www.nuget.org/packages/Ocelot.Provider.Consul) provider. The addressed bug is issue #2178, reported on October 17, 2024. + The `System.InvalidOperationException` error stating _"Cannot resolve scoped service 'Ocelot.Provider.Consul.Interfaces.IConsulServiceBuilder' from root provider"_ has been resolved. + To clarify, the `IConsulServiceBuilder` service is a scoped service in DI, injected via the `AddConsul()` or [AddConsul<T>()](https://github.com/ThreeMammals/Ocelot/blob/main/docs/features/servicediscovery.rst#addconsult-method) methods. Therefore, the `DefaultConsulServiceBuilder` should also be a scoped service, with `HttpContext` injected to meet your development requirements. +- The [Ocelot.Provider.Kubernetes](https://www.nuget.org/packages/Ocelot.Provider.Kubernetes) provider had an issue reported as #977 on August 1, 2019. + It involved a `System.InvalidOperationException` with the message: _"Cannot resolve scoped service 'KubeClient.IKubeApiClient' from root provider."_ This "invalid scopes" error occurred only in development mode, as release mode DLLs do not validate scopes. However, the `KubeApiClient` is designed to have a [scoped](https://github.com/tintoy/dotnet-kube-client/blob/84b055c885a2afe00781559ea400c0bd8cdfce6d/src/KubeClient.Extensions.DependencyInjection/ClientRegistrationExtensions.cs#L42-L43) lifetime. Acceptance tests passed because scope validation was disabled, and the `KubeClient` was [replaced](https://github.com/ThreeMammals/Ocelot/blob/414f63439d32ed9a3c09a77c86f035ed9c34aa56/test/Ocelot.AcceptanceTests/ServiceDiscovery/KubernetesServiceDiscoveryTests.cs#L315) with a singleton. This inconsistency was identified and reproduced by the old [977 issue](https://github.com/ThreeMammals/Ocelot/issues/977). As a temporary solution, the `IKubeApiClient` was [registered as a singleton](https://github.com/ThreeMammals/Ocelot/blob/e4bc9ff59d9defc385996a09be85fbb845e06af9/src/Ocelot.Provider.Kubernetes/OcelotBuilderExtensions.cs#L16). + Looking ahead, our team intends to redesign the Kubernetes provider to have a default service builder that is scoped, similar to the Consul provider. + +### :exclamation: Breaking Changes +Upgrading from [23.3.4](https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.4) to [{0}](https://github.com/ThreeMammals/Ocelot/releases/tag/{0}) introduces **no breaking changes**. However, upgrading from [23.3.0](https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.0) or earlier versions may result in some incompatibilities. For further information, please refer to the release notes of v[23.3.4](https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.4). diff --git a/build.cake b/build.cake index d288d3efb..6635f8693 100644 --- a/build.cake +++ b/build.cake @@ -1,4 +1,4 @@ -#tool dotnet:?package=GitVersion.Tool&version=5.12.0 // 6.0.0-beta.7 supports .NET 8, 7, 6 +#tool dotnet:?package=GitVersion.Tool&version=5.12.0 // 6.0.0-beta.7 supports .NET 8, 7, 6 #tool dotnet:?package=coveralls.net&version=4.0.1 #tool nuget:?package=ReportGenerator&version=5.2.4 #addin nuget:?package=Newtonsoft.Json&version=13.0.3 @@ -50,7 +50,7 @@ var releaseNotes = new List(); // internal build variables - don't change these. string committedVersion = "0.0.0-dev"; GitVersion versioning = null; -bool IsTechnicalRelease = true; +bool IsTechnicalRelease = false; var target = Argument("target", "Default"); var slnFile = (target == Release) ? $"./Ocelot.{Release}.sln" : "./Ocelot.sln"; @@ -135,198 +135,298 @@ Task("Version") } }); +Task("GitLogUniqContributors") + .Does(() => + { + Information("---==< Unique Contributors >==---"); + var command = "log --format=\"%aN|%aE\" "; + // command += IsRunningOnCircleCI() ? "| sort | uniq" : + // IsRunningInPowershell() ? "| Sort-Object -Unique" : "| sort | uniq"; + List output = GitHelper(command); + output.Sort(); + List contributors = output.Distinct().ToList(); + contributors.Sort(); + Information($"Detected {contributors.Count} unique contributors:"); + Information(string.Join(Environment.NewLine, contributors)); + // TODO Search example in bash: curl -L -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/search/users?q=Chris+Swinchatt" + Information(Environment.NewLine + "Unicode test: 1) Raynald Messié; 2) 彭伟 pengweiqhca"); + AnsiConsole.Markup("Unicode test: 1) Raynald Messié; 2) 彭伟 pengweiqhca" + Environment.NewLine); + // Powershell life hack: $OutputEncoding = [Console]::InputEncoding = [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding + // https://stackoverflow.com/questions/40098771/changing-powershells-default-output-encoding-to-utf-8 + // https://stackoverflow.com/questions/49476326/displaying-unicode-in-powershell/49481797#49481797 + // https://stackoverflow.com/questions/57131654/using-utf-8-encoding-chcp-65001-in-command-prompt-windows-powershell-window/57134096#57134096 + }); + Task("CreateReleaseNotes") .IsDependentOn("Version") + .IsDependentOn("GitLogUniqContributors") .Does(() => { - Information($"Generating release notes at {releaseNotesFile}"); - - // local helper function - Func> GitHelper = (command) => - { - IEnumerable output; - var exitCode = StartProcess( - "git", - new ProcessSettings { Arguments = command, RedirectStandardOutput = true }, - out output); - if (exitCode != 0) - throw new Exception("Failed to execute Git command: " + command); - return output; - }; - - var lastReleaseTags = GitHelper("describe --tags --abbrev=0 --exclude net*"); - var lastRelease = lastReleaseTags.First(t => !t.StartsWith("net")); // skip 'net*-vX.Y.Z' tag and take 'major.minor.build' - var releaseVersion = versioning.NuGetVersion; - - // Read main header from Git file, substitute version in header, and add content further... - Information("{0} New release tag is " + releaseVersion); - Information("{1} Last release tag is " + lastRelease); - var releaseHeader = string.Format(System.IO.File.ReadAllText("./ReleaseNotes.md"), releaseVersion, lastRelease); - releaseNotes = new List { releaseHeader }; - if (IsTechnicalRelease) - { - WriteReleaseNotes(); - return; - } - - var debugUserEmail = false; - var shortlogSummary = GitHelper($"shortlog --no-merges --numbered --summary --email {lastRelease}..HEAD") - .ToList(); - var re = new Regex(@"^[\s\t]*(?'commits'\d+)[\s\t]+(?'author'.*)[\s\t]+<(?'email'.*)>.*$"); - var summary = shortlogSummary - .Where(x => re.IsMatch(x)) - .Select(x => re.Match(x)) - .Select(m => new - { - commits = int.Parse(m.Groups["commits"]?.Value ?? "0"), - author = m.Groups["author"]?.Value?.Trim() ?? string.Empty, - email = m.Groups["email"]?.Value?.Trim() ?? string.Empty, - }) - .ToList(); - - // Starring aka Release Influencers - var starring = new List(); - foreach (var contributor in summary) - { - var stars = string.Join(string.Empty, Enumerable.Repeat(":star:", contributor.commits)); - var emailInfo = debugUserEmail ? ", " + contributor.email : string.Empty; - starring.Add($"{stars} {contributor.author}{emailInfo}"); - } - - // Honoring aka Top Contributors - const int top3 = 3; // going to create Top 3 - var topContributors = new List(); - // Ocelot Core team members should not be in Top 3 Chart - var coreTeamNames = new List { "Raman Maksimchuk", "Raynald Messié", "Guillaume Gnaegi" }; - var coreTeamEmails = new List { "dotnet044@gmail.com", "redbird_project@yahoo.fr", "58469901+ggnaegi@users.noreply.github.com" }; - var commitsGrouping = summary - .Where(x => !coreTeamNames.Contains(x.author) && !coreTeamEmails.Contains(x.email)) // filter out Ocelot Core team members - .GroupBy(x => x.commits) - .Select(g => new - { - commits = g.Key, - count = g.Count(), - authors = g.Select(x => x.author).ToList(), - }) - .OrderByDescending(x => x.commits) - .ToList(); - - // local helpers - string[] places = new[] { "1st", "2nd", "3rd", "4", "5", "6", "7", "8", "9", "10", "11" }; - static string Plural(int n) => n == 1 ? "" : "s"; - static string Honor(string place, string author, int commits, string suffix = null) - => $"{place[0]}{place[1..]} :{place}_place_medal: goes to **{author}** for delivering **{commits}** feature{Plural(commits)} {suffix ?? ""}"; - static string HonorForFiles(string place, string author, int commits, int files, string suffix = null) - => Honor(place, author, commits, $"in **{files}** file{Plural(files)} changed {suffix ?? ""}"); - static string HonorForInsertions(string place, string author, int commits, int files, int insertions, string suffix = null) - => HonorForFiles(place, author, commits, files, $"with **{insertions}** insertion{Plural(insertions)} {suffix ?? ""}"); - 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)}"); - - foreach (var group in commitsGrouping) - { - if (topContributors.Count >= top3) break; - if (group.count == 1) - { - var place = places[topContributors.Count]; - var author = group.authors.First(); - var honoring = Honor(place, author, group.commits); - topContributors.Add(honoring); - } - 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) - { - if (!statistics.Exists(s => s.Contributor == author)) - { - var shortstat = GitHelper($"log --no-merges --author=\"{author}\" --shortstat --pretty=oneline {lastRelease}..HEAD"); - var data = shortstat - .Where(x => shortstatRegex.IsMatch(x)) - .Select(x => shortstatRegex.Match(x)) - .Select(m => new - { - files = int.Parse(m.Groups["files"]?.Value ?? "0"), - insertions = int.Parse(m.Groups["insertions"]?.Value ?? "0"), - deletions = int.Parse(m.Groups["deletions"]?.Value ?? "0"), - }) - .ToList(); - statistics.Add((author, data.Sum(x => x.files), data.Sum(x => x.insertions), data.Sum(x => x.deletions))); - } - } - var filesGrouping = statistics - .GroupBy(x => x.Files) - .Select(g => new - { - files = g.Key, - count = g.Count(), - contributors = g.SelectMany(x => statistics.Where(s => s.Contributor==x.Contributor && s.Files==g.Key)).ToList(), - }) - .OrderByDescending(x => x.files) - .ToList(); - foreach (var fGroup in filesGrouping) - { - if (topContributors.Count >= top3) break; - if (fGroup.count == 1) - { - var place = places[topContributors.Count]; - var contributor = fGroup.contributors.First(); - var honoring = HonorForFiles(place, contributor.Contributor, group.commits, contributor.Files); - topContributors.Add(honoring); - } - else // multiple candidates with the same number of commits, with the same number of changed files, so, group by additions (insertions) - { - var insertionsGrouping = fGroup.contributors - .GroupBy(x => x.Insertions) - .Select(g => new - { - insertions = g.Key, - count = g.Count(), - contributors = g.SelectMany(x => fGroup.contributors.Where(s => s.Contributor == x.Contributor && s.Insertions == g.Key)).ToList(), - }) - .OrderByDescending(x => x.insertions) - .ToList(); - foreach (var insGroup in insertionsGrouping) - { - if (topContributors.Count >= top3) break; - if (insGroup.count == 1) - { - var place = places[topContributors.Count]; - var contributor = insGroup.contributors.First(); - var honoring = HonorForInsertions(place, contributor.Contributor, group.commits, contributor.Files, contributor.Insertions); - topContributors.Add(honoring); - } - else // multiple candidates with the same number of commits, with the same number of changed files, with the same number of insertions, so, order desc by deletions - { - foreach (var contributor in insGroup.contributors.OrderByDescending(x => x.Deletions)) - { - if (topContributors.Count >= top3) break; - var place = places[topContributors.Count]; - var honoring = HonorForDeletions(place, contributor.Contributor, group.commits, contributor.Files, contributor.Insertions, contributor.Deletions); - topContributors.Add(honoring); - } - } - } - } - } - } - } // END of Top 3 - - releaseNotes.Add("### Honoring :medal_sports: aka Top Contributors :clap:"); - releaseNotes.AddRange(topContributors); - releaseNotes.Add(""); - releaseNotes.Add("### Starring :star: aka Release Influencers :bowtie:"); - releaseNotes.AddRange(starring); - releaseNotes.Add(""); - releaseNotes.Add($"### Features in Release {releaseVersion}"); - var commitsHistory = GitHelper($"log --no-merges --date=format:\"%A, %B %d at %H:%M\" --pretty=format:\"%h by **%aN** on %ad →%n%s\" {lastRelease}..HEAD"); - releaseNotes.AddRange(commitsHistory); + Information($"Generating release notes at {releaseNotesFile}"); + var lastReleaseTags = GitHelper("describe --tags --abbrev=0 --exclude net*"); + var lastRelease = lastReleaseTags.First(t => !t.StartsWith("net")); // skip 'net*-vX.Y.Z' tag and take 'major.minor.build' + var releaseVersion = versioning.NuGetVersion; + + // Read main header from Git file, substitute version in header, and add content further... + Information("{0} New release tag is " + releaseVersion); + Information("{1} Last release tag is " + lastRelease); + var body = System.IO.File.ReadAllText("./ReleaseNotes.md"); + var releaseHeader = string.Format(body, releaseVersion, lastRelease); + releaseNotes = new List { releaseHeader }; + if (IsTechnicalRelease) + { + WriteReleaseNotes(); + return; + } - WriteReleaseNotes(); + const bool debugUserEmail = false; + var shortlogSummary = GitHelper($"shortlog --no-merges --numbered --summary --email {lastRelease}..HEAD") + .ToList(); + var re = new Regex(@"^[\s\t]*(?'commits'\d+)[\s\t]+(?'author'.*)[\s\t]+<(?'email'.*)>.*$"); + static SummaryItem CreateSummaryItem(System.Text.RegularExpressions.Match m) => new() + { + Commits = int.Parse(m.Groups["commits"]?.Value ?? "0"), + Author = m.Groups["author"]?.Value?.Trim() ?? string.Empty, + Email = m.Groups["email"]?.Value?.Trim() ?? string.Empty, + }; + var summary = shortlogSummary + .Where(x => re.IsMatch(x)) + .Select(x => re.Match(x)) + .Select(CreateSummaryItem) + .ToList(); + + // Starring aka Release Influencers + var starring = new List(); + string CreateStars(int count, string name) + { + var contributor = summary.Find(x => x.Author.Equals(name)); + var stars = string.Join(string.Empty, Enumerable.Repeat(":star:", count)); + var emailInfo = debugUserEmail ? ", " + contributor.Email : string.Empty; + return $"{stars} {contributor.Author}{emailInfo}"; + } + // foreach (var contributor in summary) + // { + // starring.Add(CreateStars(contributor.Commits, contributor.Author)); + // } + // Information("---==< Old Starring >==---"); + // Information(string.Join(Environment.NewLine, starring)); + var commitsGrouping = summary + .GroupBy(x => x.Commits) + .Select(CreateCommitsGroupingItem) + .OrderByDescending(x => x.Commits) + .ToList(); + starring = IterateCommits(commitsGrouping, + breaker: log => false, // don't break, so iterate all groups (summary) + byCommits: (log, group) => CreateStars(group.Commits, group.Authors.First()), + byFiles: (log, group, fGroup) => CreateStars(group.Commits, fGroup.Contributors.First().Contributor), + byInsertions: (log, group, fGroup, insGroup) => CreateStars(group.Commits, insGroup.Contributors.First().Contributor), + byDeletions: (log, group, fGroup, insGroup, contributor) => CreateStars(group.Commits, contributor.Contributor)); + Information("---==< Starring >==---"); + Information(string.Join(Environment.NewLine, starring)); + + // Honoring aka Top Contributors + var coreTeamNames = new List { "Raman Maksimchuk", "Raynald Messié", "Guillaume Gnaegi" }; // Ocelot Core team members should not be in Top 3 Chart + var coreTeamEmails = new List { "dotnet044@gmail.com", "redbird_project@yahoo.fr", "58469901+ggnaegi@users.noreply.github.com" }; + static CommitsGroupingItem CreateCommitsGroupingItem(IGrouping g) => new() + { + Commits = g.Key, + Count = g.Count(), + Authors = g.Select(x => x.Author).ToArray(), + }; + commitsGrouping = summary + .Where(x => !coreTeamNames.Contains(x.Author) && !coreTeamEmails.Contains(x.Email)) // filter out Ocelot Core team members + .GroupBy(x => x.Commits) + .Select(CreateCommitsGroupingItem) + .OrderByDescending(x => x.Commits) + .ToList(); + var topContributors = IterateCommits(commitsGrouping, + breaker: log => false, // (log.Count >= 3), // going to create Top 3 + byCommits: (log, group) => + { + var place = Place(log.Count); + var author = group.Authors.First(); + return Honor(place, author, group.Commits); + }, + byFiles: (log, group, fGroup) => + { + var place = Place(log.Count); + var contributor = fGroup.Contributors.First(); + return HonorForFiles(place, contributor.Contributor, group.Commits, contributor.Files); + }, + byInsertions: (log, group, fGroup, insGroup) => + { + var place = Place(log.Count); + var contributor = insGroup.Contributors.First(); + return HonorForInsertions(place, contributor.Contributor, group.Commits, contributor.Files, contributor.Insertions); + }, + byDeletions: (log, group, fGroup, insGroup, contributor) => + { + var place = Place(log.Count); + return HonorForDeletions(place, contributor.Contributor, group.Commits, contributor.Files, contributor.Insertions, contributor.Deletions); + }); + Information("---==< TOP Contributors >==---"); + Information(string.Join(Environment.NewLine, topContributors)); + + // local helpers + static string Place(int i) => ++i == 1 ? "1st" : i == 2 ? "2nd" : i == 3 ? "3rd" : $"{i}th"; + static string Plural(int n) => n == 1 ? "" : "s"; + static string Honor(string place, string author, int commits, string suffix = null) + => $"{place[0]}{place[1..]} :{place}_place_medal: goes to **{author}** for delivering **{commits}** feature{Plural(commits)} {suffix ?? ""}"; + static string HonorForFiles(string place, string author, int commits, int files, string suffix = null) + => Honor(place, author, commits, $"in **{files}** file{Plural(files)} changed {suffix ?? ""}"); + static string HonorForInsertions(string place, string author, int commits, int files, int insertions, string suffix = null) + => HonorForFiles(place, author, commits, files, $"with **{insertions}** insertion{Plural(insertions)} {suffix ?? ""}"); + 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)}"); + List IterateCommits(List commitsGrouping, Predicate> breaker, + Func, CommitsGroupingItem, string> byCommits, + Func, CommitsGroupingItem, FilesGroupingItem, string> byFiles, + Func, CommitsGroupingItem, FilesGroupingItem, InsertionsGroupingItem, string> byInsertions, + Func, CommitsGroupingItem, FilesGroupingItem, InsertionsGroupingItem, FilesChangedItem, string> byDeletions) + { + var log = new List(); + foreach (var group in commitsGrouping) + { + if (breaker.Invoke(log)) break; // (log.Count >= top3) + if (group.Count == 1) + { + log.Add(byCommits.Invoke(log, group)); + } + else // multiple candidates with the same number of commits, so, group by files changed + { + var statistics = new List(); + var shortstatRegex = new Regex(@"^\s*(?'files'\d+)\s+files?\s+changed(?'ins',\s+(?'insertions'\d+)\s+insertions?\(\+\))?(?'del',\s+(?'deletions'\d+)\s+deletions?\(\-\))?\s*$"); + static FilesChangedItem CreateFilesChangedItem(System.Text.RegularExpressions.Match m) => new() + { + Files = int.Parse(m.Groups["files"]?.Value ?? "0"), + Insertions = int.Parse(m.Groups["insertions"]?.Value ?? "0"), + Deletions = int.Parse(m.Groups["deletions"]?.Value ?? "0"), + }; + foreach (var author in group.Authors) // Collect statistics from git log & shortlog + { + if (!statistics.Exists(s => s.Contributor == author)) + { + var shortstat = GitHelper($"log --no-merges --author=\"{author}\" --shortstat --pretty=oneline {lastRelease}..HEAD"); + var data = shortstat + .Where(x => shortstatRegex.IsMatch(x)) + .Select(x => shortstatRegex.Match(x)) + .Select(CreateFilesChangedItem) + .ToList(); + statistics.Add(new FilesChangedItem(author, data.Sum(x => x.Files), data.Sum(x => x.Insertions), data.Sum(x => x.Deletions))); + } + } + var filesGrouping = statistics + .GroupBy(x => x.Files) + .Select(g => new FilesGroupingItem + { + Files = g.Key, + Count = g.Count(), + Contributors = g.SelectMany(x => statistics.Where(s => s.Contributor == x.Contributor && s.Files == g.Key)).ToArray(), + }) + .OrderByDescending(x => x.Files) + .ToList(); + foreach (var fGroup in filesGrouping) + { + if (breaker.Invoke(log)) break; + if (fGroup.Count == 1) + { + log.Add(byFiles.Invoke(log, group, fGroup)); + } + else // multiple candidates with the same number of commits, with the same number of changed files, so, group by additions (insertions) + { + var insertionsGrouping = fGroup.Contributors + .GroupBy(x => x.Insertions) + .Select(g => new InsertionsGroupingItem + { + Insertions = g.Key, + Count = g.Count(), + Contributors = g.SelectMany(x => fGroup.Contributors.Where(s => s.Contributor == x.Contributor && s.Insertions == g.Key)).ToArray(), + }) + .OrderByDescending(x => x.Insertions) + .ToList(); + foreach (var insGroup in insertionsGrouping) + { + if (breaker.Invoke(log)) break; + if (insGroup.Count == 1) + { + log.Add(byInsertions.Invoke(log, group, fGroup, insGroup)); + } + else // multiple candidates with the same number of commits, with the same number of changed files, with the same number of insertions, so, order desc by deletions + { + foreach (var contributor in insGroup.Contributors.OrderByDescending(x => x.Deletions)) + { + if (breaker.Invoke(log)) break; + log.Add(byDeletions.Invoke(log, group, fGroup, insGroup, contributor)); + } + } + } + } + } + } + } + return log; + } // END of IterateCommits + // releaseNotes.Add("### Honoring :medal_sports: aka Top Contributors :clap:"); + // releaseNotes.AddRange(topContributors.Take(3)); // Top 3 only, disabled 'breaker' logic + // releaseNotes.Add(""); + releaseNotes.Add("### Starring :star: aka Release Influencers :bowtie:"); + releaseNotes.AddRange(starring); + releaseNotes.Add(""); + // releaseNotes.Add($"### Features in Release {releaseVersion}"); + // var commitsHistory = GitHelper($"log --no-merges --date=format:\"%A, %B %d at %H:%M\" --pretty=format:\"%h by **%aN** on %ad →%n%s\" {lastRelease}..HEAD"); + // releaseNotes.AddRange(commitsHistory); + WriteReleaseNotes(); }); +struct SummaryItem +{ + public int Commits; + public string Author; + public string Email; +} +struct CommitsGroupingItem +{ + public int Commits; + public int Count; + public string[] Authors; +} +struct FilesChangedItem +{ + public string Contributor; + public int Files; + public int Insertions; + public int Deletions; + public FilesChangedItem(string author, int files, int insertions, int deletions) + { + Contributor = author; + Files = files; + Insertions = insertions; + Deletions = deletions; + } +} +struct FilesGroupingItem +{ + public int Files; + public int Count; + public FilesChangedItem[] Contributors; +} +struct InsertionsGroupingItem +{ + public int Insertions; + public int Count; + public FilesChangedItem[] Contributors; +} +private List GitHelper(string command) +{ + IEnumerable output; + var exitCode = StartProcess( + "git", + new ProcessSettings { Arguments = command, RedirectStandardOutput = true }, + out output); + if (exitCode != 0) + throw new Exception("Failed to execute Git command: " + command); + return output.ToList(); +} private void WriteReleaseNotes() { Information($"RUN {nameof(WriteReleaseNotes)} ..."); @@ -341,7 +441,7 @@ private void WriteReleaseNotes() } Information("Release notes are >>>\n{0}<<<", content); - Information($"EXITED {nameof(WriteReleaseNotes)}"); + //Information($"EXITED {nameof(WriteReleaseNotes)}"); } Task("RunUnitTests") diff --git a/docs/building/devprocess.rst b/docs/building/devprocess.rst index 0f2f5607a..59070eef0 100644 --- a/docs/building/devprocess.rst +++ b/docs/building/devprocess.rst @@ -1,107 +1,107 @@ Development Process =================== -* The development process works best with `Gitflow `_ branching. - Note, Ocelot team doesn't use `GitHub flow `_ which is faster but not efficient in Ocelot delivery. -* Contributors can do whatever they want on pull requests and feature branches to deliver a feature to **develop** branch. -* Maintainers can do whatever they want on pull requests and merges to **main** will result in packages being released to GitHub and NuGet. -* Finally, users follow :doc:`../building/devprocess`, but maintainers follow this :doc:`../building/releaseprocess`. +* The *development process* is optimized when using Gitflow branching, as detailed here: `Gitflow Workflow `_. + It's important to note that the Ocelot team does not utilize `GitHub Flow `_, which, despite being quicker, does not align with the efficiency required for Ocelot's delivery. +* Contributors are free to manage their pull requests and feature branches as they see fit to contribute to the `develop `_ branch. +* Maintainers have the autonomy to handle pull requests and merges. Any merges to the `main `_ branch will trigger the release of packages to GitHub and NuGet. +* In conclusion, while users should adhere to the guidelines in :doc:`../building/devprocess`, maintainers should follow the procedures outlined in :doc:`../building/releaseprocess`. -Ocelot uses the following process to accept work into a merged commit in develop. +Ocelot project follows this *development process* to integrate work into a merged commit in the `develop`_ branch: +1. Users either create a new issue or select an `existing issue `_ on GitHub. + Issues can also be generated from `discussion `_ topics when necessary and agreed upon. -1. User creates an issue or picks up an `existing issue `_ in GitHub. - An issue can be created by converting `discussion `_ topics if necessary and agreed upon. +2. Users should create `a fork `_ and branch off of it + (unless they are a core team member, in which case they can branch directly from the main/head/upstream repository), e.g., ``feature/xxx``, ``bug/xxx``, etc. + The "xxx" can be the issue number or a brief description. -2. User creates `a fork `_ and branches from this - (unless a member of core team, they can just create a branch on the head repo) e.g. ``feature/xxx``, ``bug/xxx`` etc. - It doesn't really matter what the "xxx" is. It might make sense to use the issue number and maybe a short description. +3. Once contributors are satisfied with their work, they can submit a pull request against the `develop`_ branch on GitHub with their changes. -3. When the contributor is happy with their work they can create a pull request against **develop** in GitHub with their changes. +4. The Ocelot team will review the pull request and, if satisfactory, merge it; otherwise, they will provide feedback for the contributor to address. + To expedite pull request approval, contributors should consider: -4. The Ocelot team will provide code review the PR and if all is good merge it, else they will suggest feedback that the user will need to act on. - In order to speed up getting a PR the contributor should think about the following: + - Ensuring all changes are covered by `unit `_ and `acceptance `_ tests. + - Updating any `documentation `_ affected by the changes. + - Verifying that the feature is necessary and does not duplicate existing Ocelot features. - - Have I covered all my changes with tests at unit and acceptance level? - - Have I updated any documentation that my changes may have affected? - - Does my feature make sense, have I checked all of Ocelot's other features to make sure it doesn't already exist? +5. A pull request must meet the following criteria before merging: - In order for a PR to be merged the following must have occured: + - All new code must be covered by `unit`_ tests. + - There must be at least one `acceptance`_ test for the happy path of the new code. + - Tests must pass locally, in Visual Studio Test Explorer or in terminal after performing ``dotnet test`` command. + - The build must have a green status on CircleCI as passed Checks of the pull request (aka Checks tab). + - The build's performance must not be significantly degraded on `CircleCI Ocelot project `_ main webpage. + - The main Ocelot package must not introduce any non-Microsoft dependencies. - - All new code is covered by unit tests. - - All new code has at least 1 acceptance test covering the happy path. - - Tests must have passed locally. - - Build must have green status. - - Build must not have slowed down dramatically. - - The main Ocelot package must not have taken on any non MS dependencies. - -6. After the PR is merged to **develop** the Ocelot NuGet packages will not be updated until a release is created! - The final step is to go back to GitHub and close any issues that are now fixed. - **Note**: All linked issues to the PR in **Development** settings (right side PR settings) will be closed automatically while merging the PR. - It is imperative that developer uses the "**Link an issue from this repository**" pop-up dialog of the **Development** settings! +6. Once the pull request is merged into the `develop`_ branch, the Ocelot NuGet packages will not be updated until a release is crafted. + The concluding step involves returning to GitHub to close any resolved issues. + **Note**: Issues linked to the PR within the **Development** settings (on the right sidebar of the PR settings) will automatically close upon merging. + It is crucial for developers to utilize the "**Link an issue from this repository**" feature in the **Development** settings. Notes ----- -All PR builds are done with CircleCI, see `Pipelines - ThreeMammals/Ocelot `_. -It is advisable to watch for build status, and if it is failed, trigger new build or ask online maintainers or code reviewers to make sure the current PR build is green. +All pull request builds are conducted with CircleCI. For details, refer to the `Pipelines - ThreeMammals/Ocelot `_ on CircleCI. +It's recommended to monitor the build status. If a build fails, initiate a new build or consult with online maintainers or code reviewers to ensure the current PR build is successful. -If anything is unclear or you get stuck in the process, please contact the `Ocelot Core Team `_ members or repository maintainers. +Should you encounter any confusion or obstacles, do not hesitate to reach out to the members of the 'Ocelot Core Team' or the repository maintainers. .. _dev-best-practices: Best Practices -------------- -* Ask for code review after Dev Complete stage, and resolve all issues in a provided feedback. Code is complete when solid code, appropriate unit and acceptance tests and docs update are written. -* Organize your development environment in Windows OS utilizing Visual Studio IDE. You can develop in Linux with other IDEs, but we don't recommend that. See more details in :ref:`dev-fun` subsection. -* Ensure you are always online after creation of the PR/issue, so maintainers will contact you as fastest as they can. - Note, if you will be offline for a days, weeks, months, then maintainers have a right to put your work in low priority. - Your intention to contribute should be high which means to be always online and proactive. +* Request a code review after reaching the "Development Complete" stage, and address all feedback issues. + Code is deemed complete when robust code, relevant `unit`_ and `acceptance`_ tests, and `documentation`_ updates are in place. +* Set up your development environment on Windows OS using Visual Studio IDE. + While development in Linux OS with alternative IDEs is possible, it is not recommended. For more details, refer to the :ref:`dev-fun` subsection. +* Remain online after submitting a pull request/issue to ensure maintainers can reach you promptly. + Note that if you are offline for extended periods, such as days, weeks, or months, maintainers may deprioritize your work. + A strong contribution ethic implies constant online presence and proactivity. .. _dev-fun: Dev Fun --------- +------- -This is a part of :ref:`dev-best-practices` but it is more funny D) +This section is part of the :ref:`dev-best-practices` and is written to be more amusing D) -Line-ending gotchas aka EOL fun +Line-Ending Gotchas aka EOL Fun ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - This issue has persisted since the project's inception in 2016! - Indeed, some lines end with the LF-character from the Linux OS. - Several of our contributors work on Linux and use IDEs like Visual Code, where the default newline character is LF. - Consequently, we have numerous files with inconsistent/mixed EOL characters. + Since the project's inception in 2016, this issue has been persistent. + Indeed, some lines end with the ``LF`` character, typical of the Linux OS. + Many of our contributors work on Linux and use IDEs like Visual Studio Code, which defaults to the ``LF`` as the newline character. + As a result, we have numerous files with inconsistent or mixed EOL characters. -This problem is related to well-known End-of-Line characters dillema in cross-OS development. -For Windows OS the EOL char is ``CRLF`` but for Linux it is ``LF``. -Modern IDEs and Git repos detect inconsistancy of mixed EOLs in source files following own strategies. -But GitHub "Files Changed" tool unfortunately detects a line change in these 2 scenarios: ``CRLF`` to ``LF`` and ``LF`` to ``CRLF`` changes, even there was no actual code change! -Such a pull requests with fictitious ("fake") changes are always hard to review because the focus of the reviwer should be paid to actual code changes. +This problem stems from the well-known dilemma of End-of-Line (EOL) characters in cross-OS development. +For the Windows OS, the EOL character is ``CRLF``, while for Linux, it is ``LF``. +Modern IDEs and Git repositories have their own strategies for detecting inconsistencies of mixed EOLs in source files. +However, the GitHub "Files Changed" tool unfortunately registers a line change in two scenarios: ``CRLF`` to ``LF`` and ``LF`` to ``CRLF``, even when there's no actual code change! +Reviewing such pull requests with fictitious ("fake") changes is always challenging because the reviewer's focus should be on actual code changes. - Please note, if the pull request is full of "fake" changes in **Files Changed** then code reviewer has a right not providing a code review marking PR as draft, or even closing it! + Please note, if a pull request is filled with "fake" changes in **Files Changed**, the code reviewer has the right to not provide a code review, mark the PR as a draft, or even close it. -It's our common practice not to alter end-of-line characters. -Additionally, we employ Visual Studio's specific `.editorconfig `_ IDE analyzer settings for EOL to circumvent these line ending issues. -These settings are exclusive to Visual Studio, which is why we advise rebasing a feature branch onto develop solely using Visual Studio. +Our standard practice is to maintain end-of-line characters as they are. +Moreover, we utilize Visual Studio's unique ``.editorconfig`` IDE analyzer settings for EOL to avoid issues with line endings. +These settings are specific to Visual Studio, hence we recommend rebasing a feature branch onto develop using Visual Studio exclusively. - Special EOL settings can be provided in ``.gitattributes`` file of the git repository. But we don't handle this currently. + Special EOL settings can be specified in the ``.gitattributes`` file of the git repository, although we do not currently manage this. -Our current recommendations for addressing the EOL issue are: +Our current recommendations for addressing the end-of-line (EOL) issue are as follows: -* It's preferable to resolve merge conflicts while honoring the changes in the develop branch. - It appears that changes are being collected from the feature branch, even when there are no substantial changes. - However, conflicts should be resolved by applying your changes onto the develop branch using a merging tool. +* Ideally, resolve merge conflicts by prioritizing the changes in the `develop`_ branch, then manually incorporate your changes in the merge tool dialog. + It appears that changes from the feature branch are being included, even if they are minor. + Conflicts should be addressed by manually applying your changes to the `develop`_ branch with a merge tool. -* If changes from the feature branch are prioritized (despite being insignificant), the merge tool will record them and apply CRLF end-of-line characters based on the rules specified in ``.editorconfig``. - This is where the issue arises. +* If changes from the feature branch are given priority (despite being minor), the merge tool will document them and apply ``CRLF`` end-of-line characters according to the rules specified in ``.editorconfig``. + This is the source of the issue. -* When you rename a method in IDE, for instance in Visual Studio, or use another auto-refactoring command, Visual Studio applies the command using the default styling rules in ``.editorconfig``, - which includes `CRLF settings `_. - Therefore, applying auto-refactoring commands implicitly changes the EOL characters! This is the source of "fake" changes in PRs. - Please note, Visual Studio analyzers (IDE, StyleCop, etc.) recommends auto-refactoring too which could be applied implicitly. - To maintain the original EOL characters, you must edit the code manually! - So, fictitious ("fake") changes are the result of auto-refactoring commands in IDEs such as Visual Studio, Visual Code, Rider, and others. +* Renaming a method in an IDE, such as Visual Studio, or using another auto-refactoring command, causes Visual Studio to apply the command using the default styling rules in ``.editorconfig``, which includes `CRLF settings `_. + Thus, applying auto-refactoring commands inadvertently alters the EOL characters, leading to "fake" changes in pull requests. + Note that Visual Studio analyzers (IDE, StyleCop, etc.) may also recommend auto-refactoring, which could be applied implicitly. + To preserve the original EOL characters, manual code editing is necessary. + Therefore, "fake" changes result from auto-refactoring commands in IDEs like Visual Studio, Visual Code, Rider, etc. -* **Our final recommendations: Boot into Windows, use Visual Studio Community (it's free), avoid using auto-refactoring commands, and EOLs should remain unchanged.** +* **Our final recommendation** is to boot into Windows, use Visual Studio Community (which is free), refrain from using auto-refactoring commands, and ensure that EOLs remain unchanged. diff --git a/docs/building/releaseprocess.rst b/docs/building/releaseprocess.rst index 314cf7b2f..aeb5d9ee1 100644 --- a/docs/building/releaseprocess.rst +++ b/docs/building/releaseprocess.rst @@ -1,49 +1,48 @@ Release Process =============== -* The release process works best with `Gitflow `_ branching. - Note, Ocelot team doesn't use `GitHub flow `_ which is faster but not efficient in Ocelot delivery. -* Contributors can do whatever they want on pull requests and feature branches to deliver a feature to **develop** branch. -* Maintainers can do whatever they want on pull requests and merges to **main** will result in packages being released to GitHub and NuGet. -* Finally, users follow :doc:`../building/devprocess`, but maintainers follow this :doc:`../building/releaseprocess`. +* The *release process* is optimized when using Gitflow branching, as detailed here: `Gitflow Workflow `_. + It's important to note that the Ocelot team does not utilize `GitHub Flow `_, which, despite being quicker, does not align with the efficiency required for Ocelot's delivery. +* Contributors are free to manage their pull requests and feature branches as they see fit to contribute to the `develop `_ branch. +* Maintainers have the autonomy to handle pull requests and merges. Any merges to the `main `_ branch will trigger the release of packages to GitHub and NuGet. +* In conclusion, while users should adhere to the guidelines in :doc:`../building/devprocess`, maintainers should follow the procedures outlined in :doc:`../building/releaseprocess`. -Ocelot uses the following process to accept work into the NuGet packages. +Ocelot project follows this *release process* to incorporate work into NuGet packages: -1. Maintainers provide code review of pull request and if all is good merge it, else they will suggest feedback that the user will need to act on. - Extra help to contributors is welcomed via constant Pair Programming sessions: multiple code reviews, fixing code review issues, any problem solving. +1. Maintainers review pull requests and, if satisfactory, merge them; otherwise, they provide feedback for the contributor to address. + Contributors are supported through continuous `Pair Programming `_ sessions, which include multiple code reviews, resolving code review issues, and problem-solving. -2. The maintainer must follow the `SemVer `_ support for this is provided by `GitVersion `_. - So if the maintainer needs to make breaking changes, be sure to use the correct commit message, so **GitVersion** uses the correct **SemVer** tags. - Do not manually tag the Ocelot repo: this will break things! +2. Maintainers must adhere to Semantic Versioning (`SemVer `_) supported by `GitVersion `_. + For breaking changes, maintainers should use the correct commit message to ensure **GitVersion** applies the appropriate **SemVer** tags. + Manual tagging of the Ocelot repository should be avoided to prevent disruptions. -3. After the PR is merged to **develop** the Ocelot NuGet packages will not be updated until a release is created. - And, when enough work has been completed to justify a new release, **develop** branch will be merged into **main** as ``release/X.Y.Z`` branch, - the release process will begin which builds the code, versions it, pushes artifacts to GitHub and NuGet packages to NuGet. +3. Once a pull request is merged into the `develop`_ branch, the `Ocelot NuGet packages `_ remain unchanged until a release is initiated. + When sufficient work warrants a new release, the `develop`_ branch is merged into `main`_ as a ``release/X.Y.Z`` branch, triggering the release process that builds the code, assigns versions, and pushes artifacts to GitHub and NuGet packages to NuGet. -4. Release engineer, the owner of integration tokens both on CircleCi and GitHub, automates each release build by the main building script aka ``build.cake``. - Release engineer is responsible for any DevOps at the organization, in any (sub)repositories, supporting the main building script. +4. The release engineer, who holds the integration tokens for both CircleCi and GitHub, automates each release build using the primary build script, ``build.cake``. + The release engineer is also responsible for DevOps within the organization, across all (sub)repositories, supporting the primary build script. -5. Release engineer writes `ReleaseNotes.md `_ notifying community about - important artifacts of the release such as new/updated features, fixed bugs, updated documentation, breaking changes, contributors info, version upgrade instructions, etc. +5. The release engineer drafts ``ReleaseNotes.md``, informing the community about key aspects of the release, including new or updated features, bug fixes, documentation updates, breaking changes, contributor acknowledgments, version upgrade guidelines, etc. -6. The final step is to go back to GitHub and close current milestone ensuring the following: +6. The final step involves returning to GitHub to close the current `milestone `_, ensuring that: - * all issues in the milestone should be closed, the rest of work of open issues should be moved to the next milestone. - * all pull requests of the milestone should be closed, or moved to the next upcoming release milestone. - * Release Notes should be published to GitHub releases, with extra checking the text. - * Published release must be marked as the latest, if appropriate Nuget packages were successfully uploaded to `NuGet Gallery | ThreeMammals `_ account. + * All issues within the `milestone`_ are closed; any remaining work from open issues should be transferred to the next `milestone`_. + * All pull requests associated with the `milestone`_ are either closed or reassigned to the upcoming release `milestone`_. + * Release Notes are published on GitHub `releases `_, with an additional review of the text. + * The published release is designated as the latest, provided the corresponding `Ocelot NuGet packages`_ have been successfully uploaded to the `ThreeMammals `_ account. -7. Optional support of the major version ``2X.Y.0`` should be provided in such cases as Microsoft official patches, critical Ocelot defects of the major version. - Maintainers release patched versions ``2X.Y.xxx`` as hot-fixing patch-versions. +7. Optional support for the major version ``X.Y.0`` should be available in instances such as Microsoft official patches and critical Ocelot defects of the major version. + Maintainers should release patched versions ``X.Y.1-z`` as hot-fix patch versions. Notes ----- -All NuGet package builds and releases are done with CircleCI, see `Pipelines - ThreeMammals/Ocelot `_. +All NuGet package builds and releases are conducted through CircleCI. +For details, refer to the `Pipelines - ThreeMammals/Ocelot `_ on CircleCI. -Only `Tom Pallister `_, `Raman Maksimchuk `_ (owners) and maintainers from `Ocelot Team `_ can merge releases into `main `_ at the moment. -This is to ensure there is a final :ref:`quality-gates` in place. -Maintainers are mainly looking for security issues on the final merge: see Step 7 in the process. +Currently, only `Tom Pallister `_, `Raman Maksimchuk `_, the owners, along with the `Ocelot Team `_ maintainers, have the authority to merge releases into the `main`_ branch of the Ocelot repository. +This policy is to ensure that a final :ref:`quality-gates` are in place. +The maintainers' primary focus during the final merge is to identify any security issues, as outlined in Step **7** of the process. .. _quality-gates: diff --git a/docs/features/kubernetes.rst b/docs/features/kubernetes.rst index 8bbdb1881..eeeccd592 100644 --- a/docs/features/kubernetes.rst +++ b/docs/features/kubernetes.rst @@ -1,19 +1,25 @@ -.. |K8s Logo| image:: https://kubernetes.io/images/favicon.png +.. |K8sLogo| image:: https://kubernetes.io/images/nav_logo2.svg :alt: K8s Logo - :width: 40 + :height: 50 + :target: https://kubernetes.io -|K8s Logo| Kubernetes [#f1]_ aka K8s -==================================== +.. |kubernetes| image:: https://kubernetes.io/images/nav_logo2.svg + :alt: kubernetes logo + :height: 17 + :target: https://kubernetes.io - A part of feature: :doc:`../features/servicediscovery` [#f2]_ +|K8sLogo| K8s [#f1]_ +==================== + + A part of feature: :doc:`../features/servicediscovery` Ocelot will call the `K8s `_ endpoints API in a given namespace to get all of the endpoints for a pod and then load balance across them. -Ocelot used to use the services API to send requests to the `K8s `__ service but this was changed in `PR 1134 `_ because the service did not load balance as expected. +Ocelot used to use the services API to send requests to the `K8s`_ service but this was changed in PR `1134 `_ because the service did not load balance as expected. Install ------- -The first thing you need to do is install the `NuGet package `_ that provides **Kubernetes** [#f1]_ support in Ocelot: +The first thing you need to do is install the `NuGet package `_ that provides |kubernetes| support in Ocelot [#f2]_: .. code-block:: powershell @@ -36,7 +42,7 @@ Default ``usePodServiceAccount = true``, which means that Service Account using } You can replicate a Permissive using RBAC role bindings (see `Permissive RBAC Permissions `_), -K8s API server and token will read from pod. +`K8s`_ API server and token will read from pod. .. code-block:: bash @@ -158,6 +164,6 @@ Consequently, if the port name is not designated, the default downstream scheme """" -.. [#f1] `Wikipedia `_ | `K8s Website `_ | `K8s Documentation `_ | `K8s GitHub `_ -.. [#f2] This feature was requested as part of `issue 345 `_ to add support for `Kubernetes `_ :doc:`../features/servicediscovery` provider. -.. [#f3] *"Downstream Scheme vs Port Names"* feature was requested as part of `issue 1967 `_ and released in version `23.3 `_ +.. [#f1] :doc:`../features/kubernetes` feature was requested as part of issue `345 `_ to add support for `Kubernetes `_ :doc:`../features/servicediscovery` provider, and released in version `13.4.1 `_ +.. [#f2] `Wikipedia `_ | `K8s Website `_ | `K8s Documentation `_ | `K8s GitHub `_ +.. [#f3] :ref:`k8s-downstream-scheme-vs-port-names` feature was requested as part of issue `1967 `_ and released in version `23.3 `_ diff --git a/docs/index.rst b/docs/index.rst index afb4f1194..645b9d704 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,7 +3,7 @@ .. _23.3.3: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.3 .. _23.3.4: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.4 .. _23.3.5: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.5 -.. _23.3: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.4 +.. _23.3: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.6 ############################ Ocelot `23.3`_ Documentation @@ -19,7 +19,7 @@ All **Features** are listed in alphabetical order. The primary features include :doc:`../features/configuration` and :doc:`../features/routing`. Additional tips for building Ocelot can be found in the **Building Ocelot** section. -We adhere to a :doc:`../building/devprocess` outlined in :doc:`../building/releaseprocess`. +We adhere to a :doc:`../building/devprocess` which is a part of :doc:`../building/releaseprocess`. .. admonition:: Table of Contents diff --git a/docs/releasenotes.rst b/docs/releasenotes.rst index dc32c7fdc..d6b828444 100644 --- a/docs/releasenotes.rst +++ b/docs/releasenotes.rst @@ -17,7 +17,8 @@ .. _23.3.3: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.3 .. _23.3.4: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.4 .. _23.3.5: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.5 -.. _23.3: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.4 +.. _23.3.6: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.6 +.. _23.3: https://github.com/ThreeMammals/Ocelot/releases/tag/23.3.6 .. _954: https://github.com/ThreeMammals/Ocelot/issues/954 .. _957: https://github.com/ThreeMammals/Ocelot/issues/957 @@ -69,6 +70,7 @@ The major version `23.3.0`_ includes several patches, the history of which is pr Be proud of Stephen Curry, "just give me a ball" boy, as an absolute rockstar, made `shot 1 `_, `shot 2 `_, `shot 3 `_ and final `shot 4 `_. - `23.3.5`_, on Oct 12, 2024. Documentation patch: Html and Pdf doc layouts. + - `23.3.6`_, on Oct 31, 2024. Version `23.3.4`_ patch: DI-scopes validation, :doc:`../features/servicediscovery` feature update. .. _release-notes: diff --git a/src/Ocelot.Administration/Ocelot.Administration.csproj b/src/Ocelot.Administration/Ocelot.Administration.csproj index 08e3c9938..7852a18ab 100644 --- a/src/Ocelot.Administration/Ocelot.Administration.csproj +++ b/src/Ocelot.Administration/Ocelot.Administration.csproj @@ -17,7 +17,7 @@ false True false - Tom Pallister + Tom Pallister, Raman Maksimchuk ..\..\codeanalysis.ruleset True 1591 diff --git a/src/Ocelot.Cache.CacheManager/Ocelot.Cache.CacheManager.csproj b/src/Ocelot.Cache.CacheManager/Ocelot.Cache.CacheManager.csproj index 92fdb9b7a..03580ae63 100644 --- a/src/Ocelot.Cache.CacheManager/Ocelot.Cache.CacheManager.csproj +++ b/src/Ocelot.Cache.CacheManager/Ocelot.Cache.CacheManager.csproj @@ -17,7 +17,7 @@ false True false - Tom Pallister + Tom Pallister, Raman Maksimchuk ..\..\codeanalysis.ruleset True 1591 diff --git a/src/Ocelot.Provider.Consul/Ocelot.Provider.Consul.csproj b/src/Ocelot.Provider.Consul/Ocelot.Provider.Consul.csproj index ce4f544bf..0d351c65c 100644 --- a/src/Ocelot.Provider.Consul/Ocelot.Provider.Consul.csproj +++ b/src/Ocelot.Provider.Consul/Ocelot.Provider.Consul.csproj @@ -17,7 +17,7 @@ false True false - Tom Pallister + Tom Pallister, Raman Maksimchuk ..\..\codeanalysis.ruleset True 1591 diff --git a/src/Ocelot.Provider.Eureka/Ocelot.Provider.Eureka.csproj b/src/Ocelot.Provider.Eureka/Ocelot.Provider.Eureka.csproj index cf9955a40..361082668 100644 --- a/src/Ocelot.Provider.Eureka/Ocelot.Provider.Eureka.csproj +++ b/src/Ocelot.Provider.Eureka/Ocelot.Provider.Eureka.csproj @@ -18,7 +18,7 @@ false True false - Tom Pallister + Tom Pallister, Raman Maksimchuk ..\..\codeanalysis.ruleset True 1591 diff --git a/src/Ocelot.Provider.Kubernetes/Ocelot.Provider.Kubernetes.csproj b/src/Ocelot.Provider.Kubernetes/Ocelot.Provider.Kubernetes.csproj index 4f16ca799..ba6d0b0b4 100644 --- a/src/Ocelot.Provider.Kubernetes/Ocelot.Provider.Kubernetes.csproj +++ b/src/Ocelot.Provider.Kubernetes/Ocelot.Provider.Kubernetes.csproj @@ -18,7 +18,7 @@ true false 0.0.0-dev - geffzhang + Tom Pallister, Raman Maksimchuk ..\..\codeanalysis.ruleset True diff --git a/src/Ocelot.Provider.Polly/Ocelot.Provider.Polly.csproj b/src/Ocelot.Provider.Polly/Ocelot.Provider.Polly.csproj index f39ebd8bd..fadfa376c 100644 --- a/src/Ocelot.Provider.Polly/Ocelot.Provider.Polly.csproj +++ b/src/Ocelot.Provider.Polly/Ocelot.Provider.Polly.csproj @@ -18,7 +18,7 @@ false True false - Tom Pallister + Tom Pallister, Raman Maksimchuk ..\..\codeanalysis.ruleset True 1591 diff --git a/src/Ocelot.Tracing.Butterfly/Ocelot.Tracing.Butterfly.csproj b/src/Ocelot.Tracing.Butterfly/Ocelot.Tracing.Butterfly.csproj index 03a57aec8..aee28bb3a 100644 --- a/src/Ocelot.Tracing.Butterfly/Ocelot.Tracing.Butterfly.csproj +++ b/src/Ocelot.Tracing.Butterfly/Ocelot.Tracing.Butterfly.csproj @@ -17,7 +17,7 @@ false True false - Tom Pallister + Tom Pallister, Raman Maksimchuk ..\..\codeanalysis.ruleset Ocelot.Tracing.Butterfly True diff --git a/src/Ocelot.Tracing.OpenTracing/Ocelot.Tracing.OpenTracing.csproj b/src/Ocelot.Tracing.OpenTracing/Ocelot.Tracing.OpenTracing.csproj index 14ee22ae9..8c46e1480 100644 --- a/src/Ocelot.Tracing.OpenTracing/Ocelot.Tracing.OpenTracing.csproj +++ b/src/Ocelot.Tracing.OpenTracing/Ocelot.Tracing.OpenTracing.csproj @@ -4,7 +4,7 @@ disable disable 0.0.0-dev - Kjell-Åke Gafvelin + Tom Pallister, Raman Maksimchuk This package provides OpenTracing support to Ocelot. https://github.com/ThreeMammals/Ocelot ocelot_logo.png diff --git a/src/Ocelot/Ocelot.csproj b/src/Ocelot/Ocelot.csproj index 82bfb452f..61857af82 100644 --- a/src/Ocelot/Ocelot.csproj +++ b/src/Ocelot/Ocelot.csproj @@ -18,7 +18,7 @@ false True false - Tom Pallister + Tom Pallister, Raman Maksimchuk ..\..\codeanalysis.ruleset True 1591