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

[#153119909] Upgrade Ruby to 2.5 #164

Merged
merged 7 commits into from
May 31, 2018
Merged

[#153119909] Upgrade Ruby to 2.5 #164

merged 7 commits into from
May 31, 2018

Conversation

bandesz
Copy link
Contributor

@bandesz bandesz commented May 23, 2018

What

Update Ruby version to 2.5

We decided to use the same (latest) Ruby version everywhere. We still used 2.2 in multiple places which reached EOL on 2018-03-31 [1], so we decided to migrate to the latest stable version.

We had to upgrade govuk-lint as older versions didn't support Ruby 2.5. Thanks to the upgrade we've got new style check violations but we decided to ignore them (at least for now), as this would unnecessarily blow up the story and increase the risk.

[1] https://www.ruby-lang.org/en/downloads/branches/

How to review

  1. Create a BOSH+Concourse env from this branch:

    BRANCH=upgrade_ruby_153119909 SELF_UPDATE_PIPELINE=false ENABLE_DATADOG=true make dev deployer-concourse bootstrap
    
  2. Review [#153119909] Upgrade Ruby to 2.5 paas-cf#1366

  3. Run the create-bosh-concourse pipeline again on this env or on your existing env.

  4. Test DEPLOY_ENV=... make dev bosh-cli

  5. Test DEPLOY_ENV=... AWS_ACCOUNT=dev ./scripts/bosh vms

  6. Destroy the env

How to merge

❗️ The PR contains a WIP commit which needs to be updated with the final Docker image tags.

Who can review

Not me.

@bandesz bandesz changed the title [WIP] [#153119909] Upgrade Ruby to 2.5 [#153119909] Upgrade Ruby to 2.5 May 23, 2018
@henrytk henrytk assigned henrytk and unassigned henrytk May 24, 2018
bandesz added 7 commits May 31, 2018 11:57
Ruby 2.2 reached EOL on 2018-03-31 (#1), so we decided to migrate to the latest
stable version.
Ruby 2.2 reached EOL on 2018-03-31 (#1), so we decided to migrate to the latest
stable version.
We want to set the Ruby version for rvm so people using it will be
automatically switched to the right Ruby version.
Ruby 2.2 reached EOL on 2018-03-31 (#1), so we decided to migrate to the latest
stable version.
We have to upgrade govuk-lint as older versions didn't support Ruby 2.5.

Thanks to the upgrade we now got new style check violations but we decided to
ignore them (at least for now).

The errors were:

```
Offenses:

vagrant/Vagrantfile:28:1: W: Lint/MissingCopEnableDirective: Re-enable Metrics/BlockLength cop with # rubocop:enable after disabling it.
^
manifests/runtime-config/spec/support/manifest_helpers.rb:77:14: C: Performance/HashEachMethods: Use each_value instead of each. (https://github.com/bbatsov/ruby-style-guide#hash-each)
      object.each { |_k, v| deep_freeze(v) }
             ^^^^
manifests/concourse-manifest/spec/support/manifest_helpers.rb:75:14: C: Performance/HashEachMethods: Use each_value instead of each. (https://github.com/bbatsov/ruby-style-guide#hash-each)
      object.each { |_k, v| deep_freeze(v) }
             ^^^^
manifests/shared/spec/secret_generator_spec.rb:40:56: C: Performance/RegexpMatch: Use match? instead of =~ when MatchData is not used.
      skip "No sha support in crypt(3) on Mac OS X" if RUBY_PLATFORM =~ /darwin/
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^
manifests/shared/lib/secret_generator.rb:108:10: C: Style/NumericPredicate: Use val.negative? instead of val < 0. (https://github.com/bbatsov/ruby-style-guide#predicate-methods)
      if val < 0
         ^^^^^^^
manifests/shared/lib/secret_generator.rb:111:13: C: Style/NumericPredicate: Use first_byte.negative? instead of first_byte < 0. (https://github.com/bbatsov/ruby-style-guide#predicate-methods)
      elsif first_byte < 0
            ^^^^^^^^^^^^^^
manifests/bosh-manifest/spec/support/manifest_helpers.rb:86:14: C: Performance/HashEachMethods: Use each_value instead of each. (https://github.com/bbatsov/ruby-style-guide#hash-each)
      object.each { |_k, v| deep_freeze(v) }
             ^^^^
```

We added a matching rubocop:enable to the vagrant/Vagrantfile as we don't want
to disable Lint/MissingCopEnableDirective.
We decided to use the same (latest) Ruby version everywhere.

We update the following Docker images to the latest builds which now use Ruby 2.5:
- bosh-cli-v2
- bosh-shell
- bosh
- self-update-pipelines
The mentioned PR and the FIXME comment was merged, so we don't need this custom
config anymore.
@samcrang samcrang force-pushed the upgrade_ruby_153119909 branch from d57e768 to 83a90dc Compare May 31, 2018 10:57
@samcrang
Copy link
Contributor

I've updated the commit with real docker images.

@samcrang samcrang merged commit 83a90dc into master May 31, 2018
samcrang added a commit that referenced this pull request May 31, 2018
@samcrang samcrang deleted the upgrade_ruby_153119909 branch May 31, 2018 11:46
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.

3 participants