Skip to content

23.3.6

Compare
Choose a tag to compare
@raman-m raman-m released this 31 Oct 17:29
· 12 commits to main since this release
db930d4

🔥 Hot fixing v23.3.4 (version 23.3.6) aka October'24 release

Read the Docs: Ocelot 23.3
Hot fixed version: 23.3.4
Milestone: October'24

❤️ A heartfelt "Thank You" to Nikolai Masson (@Niksson) and Nikolay Kuksov (@kick2nick) for their contributions!

ℹ️ About

This release provides minor bug fixes from the previous 23.3.4 release. All bugs have been addressed in the October'24 milestone.

📓 For projects utilizing the Service Discovery feature, it is recommended to update to this version to benefit from the unstable release 23.3.4, which includes fixes for both Consul and Kube discovery providers.

🧑‍💻 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 providers:

  • The 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>() methods. Therefore, the DefaultConsulServiceBuilder should also be a scoped service, with HttpContext injected to meet your development requirements.
  • The 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 lifetime. Acceptance tests passed because scope validation was disabled, and the KubeClient was replaced with a singleton. This inconsistency was identified and reproduced by the old 977 issue. As a temporary solution, the IKubeApiClient was registered as a singleton.
    Looking ahead, our team intends to redesign the Kubernetes provider to have a default service builder that is scoped, similar to the Consul provider.

❗ Breaking Changes

Upgrading from 23.3.4 to 23.3.6 introduces no breaking changes. However, upgrading from 23.3.0 or earlier versions may result in some incompatibilities. For further information, please refer to the release notes of v23.3.4.

Starring ⭐ aka Release Influencers :bowtie:

⭐⭐ Raman Maksimchuk, @raman-m
⭐ Henrique Holtz, @henriqueholtz
⭐ Nikolay, @kick2nick
⭐ Nikolai Masson, @Niksson
⭐ Emmanuel Ferdman, @emmanuel-ferdman
⭐ dependabot[bot], @dependabot

What's Changed

New Contributors

Full Changelog: 23.3.5...23.3.6