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

Failures using marshal_dump with v1.3.0 #79

Closed
agrare opened this issue Oct 3, 2024 · 5 comments
Closed

Failures using marshal_dump with v1.3.0 #79

agrare opened this issue Oct 3, 2024 · 5 comments

Comments

@agrare
Copy link

agrare commented Oct 3, 2024

We started hitting failures related to RecursiveOpenStruct#marshal_dump that appear to be introduced by #72
The return value is different causing callers that assume the same API contract, specifically something like ros.marshal_dump.each { |key, val| ... } now fails because it is iterating over an array of the ostruct and the options.

Example code that fails: https://github.com/fog/fog-kubevirt/blob/master/lib/fog/kubevirt/compute/compute.rb#L94-L97
Related Issue: fog/fog-kubevirt#161

Since this changes the return format IMO this was a breaking change and should have been a major version release.

@Fryguy
Copy link

Fryguy commented Oct 3, 2024

Note that marshal_dump and marshal_load were inherited from ostruct with this implementation: https://github.com/ruby/ostruct/blob/cc4f81133b87c1f274078f7bed1e170c5430cdbc/lib/ostruct.rb#L217-L227, and the new interface in #72 changes that contract.

@aetherknight
Copy link
Owner

Apologies, I didn’t consider how this might’ve been a breaking change when I merged #72 .

I’ll push a patch release later today to revert the marshal_dump change, and will move the marshal_dump change to a new major release.

@aetherknight
Copy link
Owner

I pushed 1.3.1, which reverts the marshalling changes

@aetherknight
Copy link
Owner

And restored #72 and released as major version 2.0.0

@agrare
Copy link
Author

agrare commented Oct 4, 2024

🙇 thanks for the quick fix @aetherknight !

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

3 participants