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

Update bulletin board to 0.24 for Ruby 3.1 compatibility #9766

Merged
merged 37 commits into from Nov 18, 2022

Conversation

ahukkanen
Copy link
Contributor

@ahukkanen ahukkanen commented Aug 27, 2022

🎩 What? Why?

After the Ruby 3.1 upgrade (#9449) the decidim-elections gem is broken under some OSes because bulletin board does not support OpenSSL 3.0 as explained at #9626.

The underlying reason was the jwt dependency which just released a new version 2.5.0 with OpenSSL 3.0 support. This is shipped with bulletin board 0.24.0. And problems fixed with 0.24.1.

📌 Related Issues

Testing

See #9626.

@ahukkanen ahukkanen added dependencies Pull requests that update a dependency file or issues that talk about updating dependencies module: elections type: fix PRs that implement a fix for a bug type: change PRs that implement a change for an existing feature and removed type: fix PRs that implement a fix for a bug labels Aug 27, 2022
Requiring bundler can cause the following errors:
`uninitialized constant Gem::BundlerVersionFinder (NameError)`

To avoid this, do not require bundler in the generators classes.
@ahukkanen
Copy link
Contributor Author

ahukkanen commented Aug 29, 2022

I had a many problems updating bundler to 2.3.x and/or rubygems to 3.3.x, so I decided to perform a "conservative" upgrade with the old currently locked bundler version by running:

$ gem install bundler -v 2.2.31
$ bundle update --conservative decidim-bulletin_board voting_schemes-dummy voting_schemes-electionguard jwt

This is the only way I got the build to pass both locally and in the CI.

I tried many things for updating bundler and the "system" gems at the CI running gem update --system but all my attempts failed and the CI just could not get the generator tests to pass. Locally running the same specs I had no problems running with SIMPLECOV=true or without that, both worked locally but not in CI.

I believe either bundler 2.3.x or rubygems 3.3.x have some bugs that are causing the gem installations to fail.


For search engines and for further inspection, the errors that I encountered had the following kind of error messages:

  • uninitialized constant Gem::BundlerVersionFinder (NameError)
    • This happens after running gem update --system && gem cleanup before running bundle install in the CI
    • There are several references found searching online that this should be fixed by running gem update --system && gem cleanup before bundle install but this was exactly what I was doing and this error still persisted
  • undefined method `doc_dir' for nil:NilClass while the spec installation was trying to run gem install *.gem at the root of the repo (this worked when running it manually outside of the spec but running it within the spec did not work)
    • This happens after running the "conservative" gem updates + gem update --system && gem cleanup before running bundle install in the CI
    • Further inspection showed that installing decidim, decidim-accountability and decidim-admin worked but it failed when installing decidim-api because it was trying to install rack which was already installed during the previous gem installations (and therefore doc generation fails because the spec variable is nil for already installed gems)

For further information, both of these issues happened under RubyGems 3.3.21 + Bundler 2.3.21.

@ahukkanen
Copy link
Contributor Author

Another note is that I found this issue still running Bulletin Board under OpenSSL 3.0:
decidim/decidim-bulletin-board#294

This still needs to be merged and released before we can get the ruby client working under OpenSSL 3 that Decidim is depending on.

Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏽
Do you think we should merge with develop just to be sure @ahukkanen, as this PR wasn't updated on the last month?

Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind my last comment. I've just seen that we have conflicts to resolve, can you do that @ahukkanen?

@andreslucena andreslucena self-requested a review November 16, 2022 10:10
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it locally as a final check and it doesn't give the SSL error anymore.
LGTM 👍🏽

@andreslucena andreslucena merged commit 7d84bd2 into decidim:develop Nov 18, 2022
alecslupu pushed a commit to tremend-cofe/decidim that referenced this pull request Nov 18, 2022
* Update bulletin board to 0.24

* Update the target bundler version in the Gemfile.lock

* Update bundler in the Gemfile.lock to the latest

* Try to update system gems for the generators workflow

* Experiment with gem cleanup in the failing CI

* Update the bundler development dependencies

* Update the bundler in Dockerfile.design

* Try clearing bundle cache at the CI

* Revert "Try clearing bundle cache at the CI"

This reverts commit 96326e0.

* Try re-generating Gemfile.locks

* Try defining bundler in the Gemfile as a requirement

* Add bundler version as a debug output when running the decidim exe

* Require bundler in the decidim exe

* Remove the bundler version debug from decidim exe

* Add debug information for Rubygems version and load path in the exe

* Revert "Add debug information for Rubygems version and load path in the exe"

This reverts commit 464b684.

* Do not require bundler to avoid runtime issues at CI

Requiring bundler can cause the following errors:
`uninitialized constant Gem::BundlerVersionFinder (NameError)`

To avoid this, do not require bundler in the generators classes.

* Revert "Do not require bundler to avoid runtime issues at CI"

This reverts commit 2eb3e45.

* Revert "Try defining bundler in the Gemfile as a requirement"

This reverts commit db39025.

* Revert "Do not require bundler to avoid runtime issues at CI"

This reverts commit 2eb3e45.

* Add ruby to the Gemfile.lock platforms

* Remove x86_64-linux from the Gemfile.lock platforms

* Revery Gemfile.locks and try conservative update of gems

* Revert "Update the bundler in Dockerfile.design"

This reverts commit 00b2fd3.

* Revert "Update the bundler development dependencies"

This reverts commit 9890b60.

* Update design app Gemfile.lock

* Update bundler in the Gemfile.locks

* Remove the --no-document flag from the gem update --system call

* Downgrade bundler

* Remove system gems update from the generators CI

* Update bulletin board and votng schemes to 0.24.1

* Update to bulletin board 0.24.1 in CI

* Make elections CI run under Ubuntu 22.04

* Revert Gemfile locks

* Concervative update for bulletin board, voting schemes and jwt
@ahukkanen ahukkanen deleted the fix/9626-bulletin-board-ruby-3.1 branch November 22, 2022 14:15
Quentinchampenois pushed a commit to Quentinchampenois/decidim that referenced this pull request Nov 23, 2022
* Update bulletin board to 0.24

* Update the target bundler version in the Gemfile.lock

* Update bundler in the Gemfile.lock to the latest

* Try to update system gems for the generators workflow

* Experiment with gem cleanup in the failing CI

* Update the bundler development dependencies

* Update the bundler in Dockerfile.design

* Try clearing bundle cache at the CI

* Revert "Try clearing bundle cache at the CI"

This reverts commit 96326e0.

* Try re-generating Gemfile.locks

* Try defining bundler in the Gemfile as a requirement

* Add bundler version as a debug output when running the decidim exe

* Require bundler in the decidim exe

* Remove the bundler version debug from decidim exe

* Add debug information for Rubygems version and load path in the exe

* Revert "Add debug information for Rubygems version and load path in the exe"

This reverts commit 464b684.

* Do not require bundler to avoid runtime issues at CI

Requiring bundler can cause the following errors:
`uninitialized constant Gem::BundlerVersionFinder (NameError)`

To avoid this, do not require bundler in the generators classes.

* Revert "Do not require bundler to avoid runtime issues at CI"

This reverts commit 2eb3e45.

* Revert "Try defining bundler in the Gemfile as a requirement"

This reverts commit db39025.

* Revert "Do not require bundler to avoid runtime issues at CI"

This reverts commit 2eb3e45.

* Add ruby to the Gemfile.lock platforms

* Remove x86_64-linux from the Gemfile.lock platforms

* Revery Gemfile.locks and try conservative update of gems

* Revert "Update the bundler in Dockerfile.design"

This reverts commit 00b2fd3.

* Revert "Update the bundler development dependencies"

This reverts commit 9890b60.

* Update design app Gemfile.lock

* Update bundler in the Gemfile.locks

* Remove the --no-document flag from the gem update --system call

* Downgrade bundler

* Remove system gems update from the generators CI

* Update bulletin board and votng schemes to 0.24.1

* Update to bulletin board 0.24.1 in CI

* Make elections CI run under Ubuntu 22.04

* Revert Gemfile locks

* Concervative update for bulletin board, voting schemes and jwt
entantoencuanto added a commit that referenced this pull request Nov 28, 2022
* develop:
  Redesign: verifications (#9759)
  Fix machine translations at the API (#9652)
  Add title and description to the attachment API type (#10114)
  Correct the "voted for this" string in the budgets component (#10113)
  Fix filter URL not updated with the text search input (#9618)
  Improve README design and contents (#10065)
  Update bulletin board to 0.24 for Ruby 3.1 compatibility (#9766)
  Fix some oversights in the release notes for the next release (#10078)
  Fix bug regarding user group moderation action logs (#10085)
  Fix wrong capitalization in i18n values and add missing keys (#10072)
  Enhance templates engine (#10015)
  Add slash in PR linter configuration (#10074)
  Allow blocking a UserGroup (#10021)
  Enable newsletters for admin on seeds (#10073)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file or issues that talk about updating dependencies module: elections type: change PRs that implement a change for an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bulletin board incompatibility with ruby 3.1 and OpenSSL3.0
2 participants