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

fix: openstruct broken unless explicit require of ostruct #155

Merged
merged 2 commits into from
May 13, 2024

Conversation

YOU54F
Copy link
Member

@YOU54F YOU54F commented May 13, 2024

So as of the latest release of pact-ruby-cli, we had some errors reported

NameError - uninitialized constant Pactflow::Client::ProviderContracts::Publish::OpenStruct

pact-foundation/pact-ruby-cli#131

passing the following env var

-e RUBYOPT="-rostruct"

fixes it, temporarily for end users.

docker run -v $PWD:/home --rm -it -e PACT_BROKER_TOKEN -e PACT_BROKER_BASE_URL -e RUBYOPT="-rostruct" pactfoundation/pact-cli:latest pactflow publish-provider-contract /home/example/provider-contracts/oas.yml --provider foo --provider-app-version foo1 --content-type application/yaml 

Interesting, re-running our CI today, with no code changes other than adding in ruby 3.3 to the matrix, resulted in the same test failures.

https://github.com/pact-foundation/pact_broker-client/actions/runs/9066772247/job/24910431506

across Ruby 2.7 - Ruby 3.3

I wondered if it was because there was a new release of Rubies, on 2024-04-23 but that was only for Ruby 3.0.x and upwards, where we see failures today on Ruby 2.7, which we did not see 3 months ago.

Explicitly requiring 'ostruct' has resolved the test failures, but hasn't aided in reducing my confusion as to how this has suddenly manifested!

edit: to further muddy the water, I was able to successfully run the tests on my mac with ruby 3.2.4 without these changes 😅 (it also passes after) 🤷🏾‍♂️

YOU54F and others added 2 commits May 13, 2024 17:52
this will also trigger a build against ruby 3.2.4 now released since CI was previously run
@YOU54F YOU54F merged commit 32f06ea into master May 13, 2024
35 checks passed
@bethesque
Copy link
Member

I have absolutely no idea! The require clearly should have been there. It is a mystery to me why it ever worked.

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

Successfully merging this pull request may close these issues.

2 participants