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

Bump Ruby to v3.1.4 #808

Merged
merged 9 commits into from
Jun 25, 2024
Merged

Conversation

aaronskiba
Copy link
Collaborator

Changes proposed in this PR:

  • Bump Ruby from v3.0 to v3.1:

    • The upcoming 4.1.1+portage-4.1.0 release bumped Ruby from version 2.7.6 to v3.0.
      • All of the other UAlberta Libraries Projects are currently using Ruby v3.1.
      • Although this bump puts DMP Assistant out of alignment with DMP Roadmap, it does put it in alignment with all of the other UAlberta libraries projects. Also, the build process was experiencing difficulties when set to Ruby v3.0.
  • Set .github/workflows to execute using Ruby v3.1.

    • Some of the workflows were failing after merely setting ruby-version: '3.1.4' within them. Errors would occur due to conflicting ruby versions (possibly because our codebase doesn't include a .ruby-version file). Further changes were made to these workflows/ files to address these errors.
  • Disable some "Style-Cops" within .rubocop.yml (see below). Although, this PR does not change the version of rubocop that we're using, the Ruby bump does result in new offences. This PR suppresses those offences to avoid DMP Assistant and DMP Roadmap's codebases from being too misaligned with one another:

    • Style/HashSyntax:
      Enabled: false
      
      Style/ArrayIntersect:
      Enabled: false
      

Here we can see changes to `ffi` within Gemfile.lock. These same changes were initially made by the `Bump listen from 3.8.0 to 3.9.0` Dependabot PR (commit e296003). However, running `bundle install` with the prior Ruby version (3.0.5) made it simply switch to `ffi (1.17.0)`.
This commit updates the copy/paste commit (aa0508a) to make this file compatible with DMP Assistant.
The changes implemented via this commit address the following GitHub workflow error:

```
Run gem install bundler -v 2.4
Successfully installed bundler-2.4.0
1 gem installed
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'pgsql rollbar aws'`, and stop using this flag
Your Ruby version is 3.1.6, but your Gemfile specified 3.1.4
Error: Process completed with exit code 18.
```
Prior to this commit, the Rubocop-related GitHub action was failing with the following (https://github.com/portagenetwork/roadmap/actions/runs/9618541179/job/26532655790):
```
577 files inspected, 805 offenses detected, 805 offenses autocorrectable
Error: Process completed with exit code 1.
```

These offences are due to the bump from Ruby 3.0 to Ruby 3.1.
This commit disables the Cops corresponding to these offences. (Note: They are all "Style"-type offences)
These changes were mostly implemented by copy/pasting `.github/workflows/postgres.yml` over to `.github/workflows/ruby.yml`. Prior to this commit the following error was encountered during the "Bundle Install" step:

```
Run gem install bundler -v 2.4
Successfully installed bundler-2.4.0
1 gem installed
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'mysql rollbar aws'`, and stop using this flag
Your Ruby version is 3.1.6, but your Gemfile specified 3.1.4
```
Copy link
Collaborator

@lagoan lagoan left a comment

Choose a reason for hiding this comment

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

LGTM

@aaronskiba
Copy link
Collaborator Author

aaronskiba commented Jun 25, 2024

The following explains how some of the changes to .github/workflows/danger.yml, .github/workflows/postgres.yml, and .github/workflows/ruby.yml are possible:

https://github.com/ruby/setup-ruby?tab=readme-ov-file#caching-bundle-install-automatically

Caching bundle install automatically
This action provides a way to automatically run bundle install and cache the result:

    - uses: ruby/setup-ruby@v1
      with:
        bundler-cache: true

Note that any step doing bundle install (for the root Gemfile) or gem install bundler can be removed with bundler-cache: true.

@aaronskiba aaronskiba merged commit b024eb4 into deployment-portage Jun 25, 2024
14 checks passed
@aaronskiba aaronskiba deleted the aaron/bump-ruby-to-3.1.4 branch June 25, 2024 19:01
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