geerlingguy / ansible-role-gitlab

Ansible Role - GitLab

Home Page:https://galaxy.ansible.com/geerlingguy/gitlab/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitLab reconfiguration task fails when Ruby deprecation warnings are observed

AdamGoldsmith opened this issue · comments

I must state that this is NOT an issue with this role, however I have observed a situation where the final GitLab reconfiguration task can result in a failure when deprecated Ruby warnings are reported in stderr. Please see this link for more details:

Empact/roxml#71

The warnings produced in stderr_lines are:

stderr_lines:
  - "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-15.17.4/lib/chef/provider/remote_file/local_file.rb:43: warning: URI.unescape is obsolete"
  - "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/chef-15.17.4/lib/chef/provider/remote_file/local_file.rb:43: warning: URI.escape is obsolete"

As I automatically clone this ansible role as part of my GitLab deployment, I see this error consistently with each execution.

I have written a workaround for the reconfiguration handler to prevent the task failing when these ruby deprecation warnings are observed, which I will submit in a PR. I realise that this role should not have to cater for these warnings, but it doesn't hurt to write in some error mitigation. I have expanded on the previous addition of the gitlab_restart_handler_failed_when variable defined in the defaults/main.yml file:

gitlab_restart_handler_failed_when: "{{ (gitlab_restart.rc != 0) or
  (None in (gitlab_restart.stderr_lines | default([]) | map('regex_search', 'URI\\.(?:un)?escape is obsolete'))) }}"

UPDATE

I didn't realise at the time of raising this issue that I had pinned the clone to version 2.5.3 of the role. When I clone the latest version of this role (3.2.0 at time of writing), this issue is no longer seen.
I am unsure what the best course of action to take here is, but I suppose this issue can now be closed?

Closing as this only seems to affect older versions of this role.