From f2330bee2b8cff9e761b2a0600d75649f7c105dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 15 Aug 2021 19:57:28 +0200 Subject: [PATCH 1/3] Upgrade Ruby to version 2.7.4 Note this version includes Bundler 2, so we can finally upgrade. --- .gitlab-ci.yml | 4 ++-- .ruby-version | 2 +- Dockerfile | 2 +- Gemfile.lock | 2 +- README.md | 2 +- README_ES.md | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd052c819..76071ff92 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: - lint tests: - image: "ruby:2.6.8" + image: "ruby:2.7.4" stage: test services: - postgres:10.10 @@ -34,7 +34,7 @@ tests: # PRONTO_GITLAB_API_PRIVATE_TOKEN to your repository CI/CD settings # giving it the value of the Personal Access Token linters: - image: "ruby:2.6.8" + image: "ruby:2.7.4" stage: lint cache: key: consul diff --git a/.ruby-version b/.ruby-version index 743af5e12..a4dd9dba4 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.8 +2.7.4 diff --git a/Dockerfile b/Dockerfile index 6274055fd..6bcdab13c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.6.8-buster +FROM ruby:2.7.4-buster ENV DEBIAN_FRONTEND noninteractive diff --git a/Gemfile.lock b/Gemfile.lock index cd9f7cdd8..fdb96a2f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -795,4 +795,4 @@ DEPENDENCIES wkhtmltopdf-binary (~> 0.12.6) BUNDLED WITH - 1.17.2 + 2.1.4 diff --git a/README.md b/README.md index 06689b681..101fb333c 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ You can access the main website of the project at [http://consulproject.org](htt **NOTE**: For more detailed instructions check the [docs](https://docs.consulproject.org) -Prerequisites: install git, Ruby 2.6.8, CMake, pkg-config, shared-mime-info, Node.js and PostgreSQL (>=9.5). +Prerequisites: install git, Ruby 2.7.4, CMake, pkg-config, shared-mime-info, Node.js and PostgreSQL (>=9.5). ```bash git clone https://github.com/consul/consul.git diff --git a/README_ES.md b/README_ES.md index dbef26e87..afbae802d 100644 --- a/README_ES.md +++ b/README_ES.md @@ -36,7 +36,7 @@ Puedes acceder a la página principal del proyecto en [http://consulproject.org] **NOTA**: para unas instrucciones más detalladas consulta la [documentación](https://docs.consulproject.org) -Prerequisitos: tener instalado git, Ruby 2.6.8, CMake, pkg-config, shared-mime-info, Node.js y PostgreSQL (9.5 o superior). +Prerequisitos: tener instalado git, Ruby 2.7.4, CMake, pkg-config, shared-mime-info, Node.js y PostgreSQL (9.5 o superior). ```bash git clone https://github.com/consul/consul.git From 4f4f8f61801b1042a799c7c91d0a1361461f21a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 15 Aug 2021 21:17:40 +0200 Subject: [PATCH 2/3] Supress warnings in Paperclip::UrlGenerator We were getting hundreds of "warning: URI.escape is obsolete" messages. So we're using `URI::DEFAULT_PARSER.escape` instead. IMHO it's OK to add this monkey-patch because we're replacing Paperclip with Active Storage, and when we finish with that we'll delete this file. --- config/initializers/paperclip.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 config/initializers/paperclip.rb diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb new file mode 100644 index 000000000..97a4079d9 --- /dev/null +++ b/config/initializers/paperclip.rb @@ -0,0 +1,13 @@ +class Paperclip::UrlGenerator + private + + # Code copied from the paperclip gem, only replacing + # `URI.escape` with `URI::DEFAULT_PARSER.escape` + def escape_url(url) + if url.respond_to?(:escape) + url.escape + else + URI::DEFAULT_PARSER.escape(url).gsub(escape_regex) { |m| "%#{m.ord.to_s(16).upcase}" } + end + end +end From f087d6f1ea8023026276e9a74b47931cee45c69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 7 Sep 2021 20:45:40 +0200 Subject: [PATCH 3/3] Remove step to install Bundler in Dockerfile I think we could have already done so when upgrading Ruby to version 2.6.x (which also included the Bundler gem), but since we didn't, now that we've upgraded to Bundler 2.x it's probably a good moment. --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6bcdab13c..9fc8d5e51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,9 +34,6 @@ COPY Gemfile.lock Gemfile.lock COPY Gemfile_custom Gemfile_custom -# Prevent bundler warnings; ensure that the bundler version executed is >= that which created Gemfile.lock -RUN gem install bundler - # Finish establishing our Ruby environment RUN bundle install --full-index