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

Support for YamlDotNet 16.0.0 #1573

Closed
toby-butchart-starfish opened this issue Jul 29, 2024 · 15 comments
Closed

Support for YamlDotNet 16.0.0 #1573

toby-butchart-starfish opened this issue Jul 29, 2024 · 15 comments
Assignees

Comments

@toby-butchart-starfish
Copy link

Describe the bug
Hi guys, I was wondering if there were plans to support YamlDotNet v 16.0.0? It looks like they have made some breaking changes in the latest release: https://github.com/aaubry/YamlDotNet/releases/tag/v16.0.0 specifically to ReadYaml and WriteYaml in IYamlTypeConverter.cs leaving any descendant in the KubernetesClient library broken (i.e., IntOrStringYamlConverter).

Let me know if you need any more information.

Dotnet Runtime Version
net8

To Reproduce

  • Install latest KubernetesClient
  • Install latest YamlDotNet
  • Initialise connection (i.e., KubernetesClientConfiguration.BuildConfigFromConfigFile(_configFile);)
  • Exception generated with the following message: TypeLoadException: Method 'ReadYaml' in type 'k8s.Models.IntOrStringYamlConverter' from assembly 'KubernetesClient, Version=14.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
    image

Expected behavior
Connection to succeed

Where do you run your app with Kubernetes SDK (please complete the following information):

  • OS: Ubuntu
  • Environment: container
  • Local
@tg123 tg123 self-assigned this Jul 29, 2024
@tg123
Copy link
Member

tg123 commented Jul 29, 2024

let me take a look

@aDisplayName
Copy link

Based on the error message, one possible solution is to provide both forms of implementations of IYamlTypeConverter, so host project can freely choose YamlDotNet 16.x or older version

@IvanJosipovic
Copy link
Contributor

I recently upgraded one of my projects to YamlDotNet 16, its quite easy, IvanJosipovic/YamlDotNet.System.Text.Json@fa5963f

I can do a PR for this if needed. Additionally, I don't see much value in making these converters backward compatible.

@tg123
Copy link
Member

tg123 commented Aug 7, 2024

thanks @IvanJosipovic, please. i was too busy recently

@mmgerald
Copy link

mmgerald commented Aug 12, 2024

Thanks to everyone. @tg123 Is it possible to trigger a release. Also https://github.com/buehler/dotnet-operator-sdk is broken if v16 of YamlDotNet is used.

See also buehler/dotnet-operator-sdk#797

@cdavernas
Copy link

Any news regarding the release? I'm facing the issue, too.

@tg123
Copy link
Member

tg123 commented Sep 4, 2024

will kick a release for 1.31 soon

@mmgerald
Copy link

mmgerald commented Sep 6, 2024

Thank you!

@IvanJosipovic
Copy link
Contributor

@cdavernas
Copy link

@IvanJosipovic apparently not, it's the version I'm using and it throws NotImplementedExceptions at startup

@IvanJosipovic
Copy link
Contributor

IvanJosipovic commented Sep 7, 2024

@IvanJosipovic apparently not, it's the version I'm using and it throws NotImplementedExceptions at startup

Check the references in nuget.org, you may have another dependency forcing the downgrade.
image

@cdavernas
Copy link

cdavernas commented Sep 7, 2024

you may have another dependency forcing the downgrade

@IvanJosipovic AFAIK I do not. All packages are up to latest version.

If you want, you can easily repro the issue by starting Synapse's API server on the following branch: https://github.com/serverlessworkflow/synapse/tree/feat-k8s-container-platform/src/api/Synapse.Api.Server

Removing the KubernetesClient package (and all related classes) from the solution "fixes" the issue.

@IvanJosipovic
Copy link
Contributor

IvanJosipovic commented Sep 7, 2024

you may have another dependency forcing the downgrade

@IvanJosipovic AFAIK I do not. All packages are up to latest version.

If you want, you can easily repro the issue by starting Synapse's API server on the following branch: https://github.com/serverlessworkflow/synapse/tree/feat-k8s-container-platform/src/api/Synapse.Api.Server

Removing the KubernetesClient package (and all related classes) from the solution "fixes" the issue.

Just launched your branch, the error is:

Unhandled exception. System.TypeInitializationException: The type initializer for 'Neuroglia.Serialization.Yaml.YamlSerializer' threw an exception.
 ---> System.TypeLoadException: Method 'ReadYaml' in type 'Neuroglia.Serialization.Yaml.JsonNodeTypeConverter' from assembly 'Neuroglia.Serialization.YamlDotNet, Version=4.15.3.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at Neuroglia.Serialization.Yaml.YamlSerializer.<>c.<.cctor>b__8_0(SerializerBuilder serializer)
   at Neuroglia.Serialization.Yaml.YamlSerializer..cctor() in /home/runner/work/framework/framework/src/Neuroglia.Serialization.YamlDotNet/Services/YamlSerializer.cs:line 90
   --- End of inner exception stack trace ---
   at Neuroglia.Serialization.IServiceCollectionExtensions.<>c.<AddYamlDotNetSerializer>b__0_0(IYamlSerializerBuilder builder) in /home/runner/work/framework/framework/src/Neuroglia.Serialization.YamlDotNet/Extensions/IServiceCollectionExtensions.cs:line 39
   at Neuroglia.Serialization.IServiceCollectionExtensions.AddYamlDotNetSerializer(IServiceCollection services, Action`1 setup, ServiceLifetime lifetime) in /home/runner/work/framework/framework/src/Neuroglia.Serialization.YamlDotNet/Extensions/IServiceCollectionExtensions.cs:line 42
   at Synapse.IServiceCollectionExtensions.AddSynapse(IServiceCollection services, IConfiguration configuration) in C:\Users\ivanj\Downloads\synapse-feat-k8s-container-platform\synapse-feat-k8s-container-platform\src\core\Synapse.Core.Infrastructure\Extensions\IServiceCollectionExtensions.cs:line 49
   at Program.<Main>$(String[] args) in C:\Users\ivanj\Downloads\synapse-feat-k8s-container-platform\synapse-feat-k8s-container-platform\src\api\Synapse.Api.Server\Program.cs:line 25
   at Program.<Main>(String[] args)

Looks like you have your own converter Neuroglia.Serialization.Yaml.JsonNodeTypeConverter which needs to be updated.

See here, https://github.com/neuroglia-io/framework/blob/main/src/Neuroglia.Serialization.YamlDotNet/Neuroglia.Serialization.YamlDotNet.csproj

@cdavernas
Copy link

@IvanJosipovic Sorry about that, in my dev setup I had manually updated the dependencies of the incriminated package. I'll properly update it, publish it and test it. I'll keep you posted!

In the meanwhile, thanks for both your patience and attention 🙏

@tg123 tg123 closed this as completed Sep 8, 2024
@cdavernas
Copy link

@IvanJosipovic I updated all packages and everything is working as expected!!! Many thanks ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants