Skip to content

Commit 696fa07

Browse files
committed
Release 23.3 Artifacts | +semver: minor (#2089)
* Release notes * Update docs * Twilight Texas codename * Ocelot Core team members should not be in Top 3 Chart
1 parent 8c1c61e commit 696fa07

File tree

8 files changed

+230
-81
lines changed

8 files changed

+230
-81
lines changed

Diff for: ReleaseNotes.md

+77-24
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,84 @@
1-
## Hotfix release (version {0}) for #2031 issue
2-
> Route path template placeholders and their validation rules
1+
## Spring 2024 (version {0}) aka [Twilight Texas](https://www.timeanddate.com/eclipse/solar/2024-april-8) release
2+
> Codenamed: **[Twilight Texas](https://www.timeanddate.com/eclipse/solar/2024-april-8)**
3+
> Read the Docs: [Ocelot 23.3](https://ocelot.readthedocs.io/en/{0}/)
34
4-
Special thanks to **[Guillaume Gnaegi](https://github.com/ggnaegi)** and [Fabrizio Mancin](https://github.com/Fabman08)!
5+
### What's new?
56

6-
### About
7-
The bug is related to the [Placeholders](https://ocelot.readthedocs.io/en/latest/features/routing.html#placeholders) feature in [Configuration](https://ocelot.readthedocs.io/en/latest/features/configuration.html) and [Routing](https://ocelot.readthedocs.io/en/latest/features/routing.html).
8-
The bug was introduced in version [23.2.0](https://github.com/ThreeMammals/Ocelot/releases/tag/23.2.0) as a part of PR #1927.
7+
- **[Service Discovery](https://github.com/ThreeMammals/Ocelot/blob/main/docs/features/servicediscovery.rst)**: Introducing a new feature for "[Customization of services creation](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/servicediscovery.rst#consul-service-builder-3)" in two primary service discovery providers: [Consul](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/servicediscovery.rst#consul-service-builder-3) and [Kubernetes](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/kubernetes.rst#downstream-scheme-vs-port-names-3), developed by @raman-m.
8+
The customization for both `Consul` and `Kube` providers in service creation is achieved through the overriding of virtual methods in default implementations. The recommendation was to separate the provider's logic and introduce `public virtual` and `protected virtual` methods in concrete classes, enabling:
9+
- The use of `public virtual` methods as dictated by interface definitions.
10+
- The application of `protected virtual` methods to allow developers to customize atomic operations through inheritance from existing concrete classes.
11+
- The injection of new interface objects into the provider's constructor.
12+
- The overriding of the default behavior of classes.
913

10-
### Breaking Change
11-
The new [validation rules](https://github.com/ThreeMammals/Ocelot/blob/23.2.0/src/Ocelot/Configuration/Validator/FileConfigurationFluentValidator.cs#L45-L50) of the `FileConfigurationFluentValidator` class do not allow the Ocelot app to start when implicit [placeholders](https://ocelot.readthedocs.io/en/latest/features/routing.html#placeholders) are defined in custom implementations, such as middlewares, delegating handlers, and replaced services in the dependency injection (DI) container.
12-
These new rules are capable of validating explicit [placeholders](https://ocelot.readthedocs.io/en/latest/features/routing.html#placeholders) only within the `UpstreamPathTemplate` and `DownstreamPathTemplate` properties. Unfortunately, they cannot oversee implicit placeholders in custom implementations, and they do not validate early during the Ocelot app startup process.
14+
Ultimately, customization relies on the virtual methods within the default implementation classes, providing developers the flexibility to override them as necessary for highly tailored Consul/K8s configurations in their specific environments.
15+
For further details, refer to the respective pull requests for both providers:
16+
- `Kube` → PR #2052
17+
- `Consul` → PR #2067
1318

14-
Ensure that you avoid using version [23.2.0](https://github.com/ThreeMammals/Ocelot/releases/tag/23.2.0). If you are currently on that version, upgrade to version [{0}](https://github.com/ThreeMammals/Ocelot/releases/tag/{0}) by applying this hotfix patch.
19+
- **[Routing](https://github.com/ThreeMammals/Ocelot/blob/main/docs/features/routing.rst)**: Introducing the new "[Routing based on Request Header](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/routing.rst#upstream-headers-3)" feature by @jlukawska.
20+
In addition to routing via `UpstreamPathTemplate`, you can now define an `UpstreamHeaderTemplates` options dictionary. For a route to match, all headers specified in this section are required to be present in the request headers.
21+
For more details, see PR #1312.
1522

16-
### Technical info
17-
With version [23.2.0](https://github.com/ThreeMammals/Ocelot/releases/tag/23.2.0), particularly if you have overridden certain service classes or implemented custom logic that manipulates placeholders, you may encounter Ocelot app crashes accompanied by the following errors in the log:
18-
```
19-
One or more errors occurred. (Unable to start Ocelot, errors are: XXX)
20-
```
21-
where `XXX` are the following validation error messages:
22-
- `UpstreamPathTemplate 'UUU' doesn't contain the same placeholders in DownstreamPathTemplate 'DDD'`
23-
- `DownstreamPathTemplate 'DDD' doesn't contain the same placeholders in UpstreamPathTemplate 'UUU'`
23+
- **[Configuration](https://github.com/ThreeMammals/Ocelot/blob/main/docs/features/configuration.rst)**: Introducing the "[Custom Default Version Policy](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/configuration.rst#downstreamhttpversionpolicy-3)" feature by @ibnuda.
24+
The configurable `HttpRequestMessage.VersionPolicy` helps avoid HTTP protocol connection errors and stabilizes connections to downstream services, especially when you're not developing those services, documentation is scarce, or the deployed HTTP protocol version is uncertain.
25+
For developers of downstream services, it's possible to `ConfigureKestrel` server and its endpoints with new protocol settings. However, attention to version policy is also required, and this feature provides precise version settings for HTTP connections.
26+
Essentially, this feature promotes the use of HTTP protocols beyond 1.0/1.1, such as HTTP/2 or even HTTP/3.
27+
For additional details, refer to PR #1673.
2428

25-
**Finally**, the [validation rules](https://github.com/ThreeMammals/Ocelot/blob/23.2.0/src/Ocelot/Configuration/Validator/FileConfigurationFluentValidator.cs#L45-L50) resulted from the incorrect assumption that placeholders are always explicit and can be validated early. Therefore, custom implementations and feature services in the dependency injection (DI) container, which rely on or manipulate placeholders, should validate the configuration JSON and appropriate options later, directly within their service implementations.
29+
- **[Configuration](https://github.com/ThreeMammals/Ocelot/blob/main/docs/features/configuration.rst)**: Introducing the new "[Route Metadata](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/configuration.rst#route-metadata)" feature by @vantm. Undoubtedly, this is the standout feature of the release! :star:
30+
Route metadata enables Ocelot developers to incorporate custom functions that address specific needs or to create their own plugins/extensions.
31+
In versions of Ocelot prior to [{0}](https://github.com/ThreeMammals/Ocelot/releases/tag/{0}), the configuration was limited to predefined values that Ocelot used internally. This was sufficient for official extensions, but posed challenges for third-party developers who needed to implement configurations not included in the standard `FileConfiguration`. Applying an option to a specific route required knowledge of the array index and other details that might not be readily accessible using the standard `IConfiguration` or `IOptions<FileConfiguration>` models from ASP.NET. Now, metadata can be directly accessed in the `DownstreamRoute` object. Furthermore, metadata can also be retrieved from the global JSON section via the `FileConfiguration.GlobalConfiguration` property.
32+
For more information, see the details in PR #1843 on this remarkable feature.
2633

27-
### Bug Artifacts
28-
- Released in version: [23.2.0](https://github.com/ThreeMammals/Ocelot/releases/tag/23.2.0)
29-
- Introduced in: PR #1927
30-
- Reported bug: #2031 by @ggnaegi and tested by @Fabman08
31-
- Hotfix PR: #2032 by @raman-m
34+
### Focus On
35+
36+
<details>
37+
<summary><b>Updates of the features</b>: Configuration, Service Discovery, Routing and Quality of Service</summary>
38+
39+
- [Configuration](https://github.com/ThreeMammals/Ocelot/blob/main/docs/features/configuration.rst): New features are "[Custom Default Version Policy](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/configuration.rst#downstreamhttpversionpolicy-3)" by @ibnuda and "[Route Metadata](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/configuration.rst#route-metadata)" by @vantm.
40+
41+
- [Service Discovery](https://github.com/ThreeMammals/Ocelot/blob/main/docs/features/servicediscovery.rst): New feature is "[Customization of services creation](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/servicediscovery.rst#consul-service-builder-3)" by @raman-m.
42+
43+
- [Routing](https://github.com/ThreeMammals/Ocelot/blob/main/docs/features/routing.rst): New feature is "[Routing based on Request Header](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/routing.rst#upstream-headers-3)" by @jlukawska.
44+
45+
- [Quality of Service](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/qualityofservice.rst): The team has decided to remove the Polly V7 policies logic and the corresponding Ocelot `AddPollyV7` extensions (referenced in PR #2079). Furthermore, the Polly V8 Circuit Breaker has been mandated as the primary strategy (as per PR #2086).
46+
See more detaild below in "**Ocelot extra packages**" paragraph.
47+
</details>
48+
49+
<details>
50+
<summary><b>Ocelot extra packages</b></summary>
51+
52+
- **[Ocelot.Provider.Polly](https://www.nuget.org/packages/Ocelot.Provider.Polly)**
53+
54+
- Our team has resolved to eliminate the Polly V7 policies logic and the corresponding Ocelot `AddPollyV7` extensions entirely (refer to the "[Polly v7 vs v8](https://github.com/ThreeMammals/Ocelot/blob/23.2.0/docs/features/qualityofservice.rst#polly-v7-vs-v8)" documentation). In the previous [23.2](https://github.com/ThreeMammals/Ocelot/releases/tag/23.2.0) release, named [Lunar Eclipse](https://github.com/ThreeMammals/Ocelot/releases/tag/23.2.0), we included these to maintain the legacy Polly behavior, allowing development teams to transition or retain the old Polly V7 functionality. We are now confident that it is time to progress alongside Polly, shifting our focus to the new Polly V8 [resilience pipelines](https://www.pollydocs.org/pipelines/). For more details, see PR #2079.
55+
56+
- Additionally, we have implemented Polly v8 Circuit Breaker as the primary strategy. Our Quality of Service (QoS) relies on two main strategies: [Circuit Breaker](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/qualityofservice.rst#circuit-breaker-strategy) and [Timeout](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/qualityofservice.rst#timeout-strategy). If both Circuit Breaker and Timeout are [configured](https://github.com/ThreeMammals/Ocelot/blob/{0}/docs/features/qualityofservice.rst#configuration) with their respective properties in the `QoSOptions` of the route JSON, then the Circuit Breaker strategy will take precedence in the constructed resilience pipeline. For more details, refer to PR #2086.
57+
</details>
58+
59+
<details>
60+
<summary><b>Stabilization</b> aka bug fixing</summary>
61+
62+
- Fixed #2034 in PR #2045 by @raman-m
63+
- Fixed #2039 in PR #2050 by @PaulARoy
64+
- Fixed #1590 in PR #1592 by @sergio-str
65+
- Fixed #2054 #2059 in PR #2058 by @thiagoloureiro
66+
- Fixed #954 #957 #1026 in PR #2067 by @raman-m
67+
- Fixed #2002 in PR #2003 by @bbenameur
68+
- Fixed #2085 in PR #2086 by @RaynaldM
69+
- See [all bugs](https://github.com/ThreeMammals/Ocelot/issues?q=is%3Aissue+milestone%3ASpring%2724+is%3Aclosed+label%3Abug) of the [Spring'24](https://github.com/ThreeMammals/Ocelot/milestone/6) milestone
70+
</details>
71+
72+
<details>
73+
<summary><b>Documentation</b> for version <a href="https://ocelot.readthedocs.io/en/{0}/">{0}</a></summary>
74+
75+
- [Caching](https://ocelot.readthedocs.io/en/{0}/features/caching.html): New [EnableContentHashing option](https://ocelot.readthedocs.io/en/{0}/features/caching.html#enablecontenthashing-option) and [Global Configuration](https://ocelot.readthedocs.io/en/{0}/features/caching.html#global-configuration) sections
76+
- [Configuration](https://ocelot.readthedocs.io/en/{0}/features/configuration.html): New [DownstreamHttpVersionPolicy](https://ocelot.readthedocs.io/en/{0}/features/configuration.html#downstreamhttpversionpolicy-3) and [Route Metadata](https://ocelot.readthedocs.io/en/{0}/features/configuration.html#route-metadata)
77+
- [Kubernetes](https://ocelot.readthedocs.io/en/{0}/features/kubernetes.html): New [Downstream Scheme vs Port Names](https://ocelot.readthedocs.io/en/{0}/features/kubernetes.html#downstream-scheme-vs-port-names-3) section
78+
- [Metadata](https://ocelot.readthedocs.io/en/{0}/features/metadata.html): This is new chapter for [Route Metadata](https://ocelot.readthedocs.io/en/{0}/features/configuration.html#route-metadata) feature.
79+
- [Quality of Service](https://ocelot.readthedocs.io/en/{0}/features/qualityofservice.html)
80+
- [Rate Limiting](https://ocelot.readthedocs.io/en/{0}/features/ratelimiting.html)
81+
- [Request Aggregation](https://ocelot.readthedocs.io/en/{0}/features/requestaggregation.html)
82+
- [Routing](https://ocelot.readthedocs.io/en/{0}/features/routing.html): New [Upstream Headers](https://ocelot.readthedocs.io/en/{0}/features/routing.html#upstream-headers-3) section
83+
- [Service Discovery](https://ocelot.readthedocs.io/en/{0}/features/servicediscovery.html): New [Consul Service Builder](https://ocelot.readthedocs.io/en/{0}/features/servicediscovery.html#consul-service-builder-3) section
84+
</details>

Diff for: build.cake

+16-9
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,18 @@ Task("CreateReleaseNotes")
174174
return;
175175
}
176176

177-
var shortlogSummary = GitHelper($"shortlog --no-merges --numbered --summary {lastRelease}..HEAD")
177+
var debugUserEmail = false;
178+
var shortlogSummary = GitHelper($"shortlog --no-merges --numbered --summary --email {lastRelease}..HEAD")
178179
.ToList();
179-
var re = new Regex(@"^[\s\t]*(?'commits'\d+)[\s\t]+(?'author'.*)$");
180+
var re = new Regex(@"^[\s\t]*(?'commits'\d+)[\s\t]+(?'author'.*)[\s\t]+<(?'email'.*)>.*$");
180181
var summary = shortlogSummary
181182
.Where(x => re.IsMatch(x))
182183
.Select(x => re.Match(x))
183184
.Select(m => new
184185
{
185186
commits = int.Parse(m.Groups["commits"]?.Value ?? "0"),
186187
author = m.Groups["author"]?.Value?.Trim() ?? string.Empty,
188+
email = m.Groups["email"]?.Value?.Trim() ?? string.Empty,
187189
})
188190
.ToList();
189191

@@ -192,13 +194,18 @@ Task("CreateReleaseNotes")
192194
foreach (var contributor in summary)
193195
{
194196
var stars = string.Join(string.Empty, Enumerable.Repeat(":star:", contributor.commits));
195-
starring.Add($"{stars} {contributor.author}");
197+
var emailInfo = debugUserEmail ? ", " + contributor.email : string.Empty;
198+
starring.Add($"{stars} {contributor.author}{emailInfo}");
196199
}
197200

198201
// Honoring aka Top Contributors
199202
const int top3 = 3; // going to create Top 3
200203
var topContributors = new List<string>();
204+
// Ocelot Core team members should not be in Top 3 Chart
205+
var coreTeamNames = new List<string> { "Raman Maksimchuk", "Raynald Messié", "Guillaume Gnaegi" };
206+
var coreTeamEmails = new List<string> { "[email protected]", "[email protected]", "[email protected]" };
201207
var commitsGrouping = summary
208+
.Where(x => !coreTeamNames.Contains(x.author) && !coreTeamEmails.Contains(x.email)) // filter out Ocelot Core team members
202209
.GroupBy(x => x.commits)
203210
.Select(g => new
204211
{
@@ -210,7 +217,7 @@ Task("CreateReleaseNotes")
210217
.ToList();
211218

212219
// local helpers
213-
string[] places = new[] { "1st", "2nd", "3rd" };
220+
string[] places = new[] { "1st", "2nd", "3rd", "4", "5", "6", "7", "8", "9", "10", "11" };
214221
static string Plural(int n) => n == 1 ? "" : "s";
215222
static string Honor(string place, string author, int commits, string suffix = null)
216223
=> $"{place[0]}<sup>{place[1..]}</sup> :{place}_place_medal: goes to **{author}** for delivering **{commits}** feature{Plural(commits)} {suffix ?? ""}";
@@ -312,11 +319,11 @@ Task("CreateReleaseNotes")
312319
}
313320
} // END of Top 3
314321

315-
// releaseNotes.Add("### Honoring :medal_sports: aka Top Contributors :clap:");
316-
// releaseNotes.AddRange(topContributors);
317-
// releaseNotes.Add("");
318-
// releaseNotes.Add("### Starring :star: aka Release Influencers :bowtie:");
319-
// releaseNotes.AddRange(starring);
322+
releaseNotes.Add("### Honoring :medal_sports: aka Top Contributors :clap:");
323+
releaseNotes.AddRange(topContributors);
324+
releaseNotes.Add("");
325+
releaseNotes.Add("### Starring :star: aka Release Influencers :bowtie:");
326+
releaseNotes.AddRange(starring);
320327
releaseNotes.Add("");
321328
releaseNotes.Add($"### Features in Release {releaseVersion}");
322329
var commitsHistory = GitHelper($"log --no-merges --date=format:\"%A, %B %d at %H:%M\" --pretty=format:\"<sub>%h by **%aN** on %ad &rarr;</sub>%n%s\" {lastRelease}..HEAD");

Diff for: docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
project = 'Ocelot'
1010
copyright = ' 2016-2024 ThreeMammals Ocelot team'
1111
author = 'Tom Pallister, Raman Maksimchuk and Ocelot Core team at ThreeMammals'
12-
release = '23.2'
12+
release = '23.3'
1313

1414
# -- General configuration ---------------------------------------------------
1515
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

Diff for: docs/features/caching.rst

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ The **Region** represents a region of caching.
4949
Additionally, if a header name is defined in the **Header** property, that header value is looked up by the key (header name) in the ``HttpRequest`` headers,
5050
and if the header is found, its value will be included in caching key. This causes the cache to become invalid due to the header value changing.
5151

52+
.. _cch-enablecontenthashing-option:
53+
5254
``EnableContentHashing`` option
5355
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5456

Diff for: docs/features/configuration.rst

+2
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ You can utilize these methods in the ``ConfigureAppConfiguration`` method (locat
447447
448448
You can find additional details in the dedicated :ref:`di-configuration-overview` section and in subsequent sections related to the :doc:`../features/dependencyinjection` chapter.
449449

450+
.. _config-route-metadata:
451+
450452
Route Metadata
451453
--------------
452454

Diff for: docs/features/kubernetes.rst

+2
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ If your downstream service resides in a different namespace, you can override th
117117
}
118118
]
119119
120+
.. _k8s-downstream-scheme-vs-port-names:
121+
120122
Downstream Scheme vs Port Names [#f3]_
121123
--------------------------------------
122124

Diff for: docs/features/qualityofservice.rst

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Next, within your ``ConfigureServices`` method, to incorporate `Polly`_ services
2323
services.AddOcelot()
2424
.AddPolly();
2525
26+
.. _qos-configuration:
27+
2628
Configuration
2729
-------------
2830

@@ -40,6 +42,8 @@ Then add the following section to a Route configuration:
4042
- ``DurationOfBreak`` means the circuit breaker will stay open for 1 second after it is tripped.
4143
- ``TimeoutValue`` means if a request takes more than 5 seconds, it will automatically be timed out.
4244

45+
.. _qos-circuit-breaker-strategy:
46+
4347
Circuit Breaker strategy
4448
------------------------
4549

@@ -62,6 +66,8 @@ Alternatively, you may omit ``DurationOfBreak`` to default to the implicit 5 sec
6266
6367
This setup activates only the `Circuit breaker <https://www.pollydocs.org/strategies/circuit-breaker.html>`_ strategy.
6468

69+
.. _qos-timeout-strategy:
70+
6571
Timeout strategy
6672
----------------
6773

0 commit comments

Comments
 (0)