Skip to content

Fix: fix bundle config path issue for JH

related to JH Issue

failed job example on Jihu

fixed job example on Jihu

What does this MR do and why?

TO UNDERSTAND THIS MR,YOU SHOULD KNOW

  1. "Bundler with a path fails to find openssl 2.2.0"
  2. move bundle config set path "$(pwd)/vendor" under bundle config set --local gemfile 'jh/Gemfile'

The db:backup_and_restore is failed in JH due to this bug "Bundler with a path fails to find openssl 2.2.0" of RubyGems.

From the log of db:backup_and_restore on Jihu Pipeline, we can see bundle_install_script in prepare_build.sh was executed twice. The path of bundle was empty at first, and then it was set to "/builds/gitlab-org-forks/gitlab/vendor", that's how the debug happened.

The output of bundle config at first time

$ source scripts/prepare_build.sh
3.1.6
Successfully installed bundler-2.3.15
1 gem installed
Bundler version 2.3.15
production:development
Settings are listed in order of priority. The top value will be used.
frozen
Set via BUNDLE_FROZEN: true
gemfile
Set via BUNDLE_GEMFILE: "/builds/gitlab-org-forks/gitlab/jh/Gemfile"
install_flags
Set via BUNDLE_INSTALL_FLAGS: "--jobs=$(nproc) --retry=3 --quiet"
without
Set via BUNDLE_WITHOUT: [:production, :development]

The output of bundle config at second time

$ . scripts/prepare_build.sh
3.1.6
Bundler version 2.3.15
production:development
Settings are listed in order of priority. The top value will be used.
clean
Set for your local app (/builds/gitlab-org-forks/gitlab/jh/.bundle/config): true
frozen
Set via BUNDLE_FROZEN: true
gemfile
Set for your local app (/builds/gitlab-org-forks/gitlab/jh/.bundle/config): "jh/Gemfile"
Set via BUNDLE_GEMFILE: "/builds/gitlab-org-forks/gitlab/jh/Gemfile"
install_flags
Set via BUNDLE_INSTALL_FLAGS: "--jobs=$(nproc) --retry=3 --quiet"
jobs
Set for your local app (/builds/gitlab-org-forks/gitlab/jh/.bundle/config): 2
path
Set for your local app (/builds/gitlab-org-forks/gitlab/jh/.bundle/config): "/builds/gitlab-org-forks/gitlab/vendor"
retry
Set for your local app (/builds/gitlab-org-forks/gitlab/jh/.bundle/config): 3
without
Set via BUNDLE_WITHOUT: [:production, :development]

Proposal

  • Print RubyGems version
  • move bundle config set path "$(pwd)/vendor" under bundle config set --local gemfile 'jh/Gemfile'

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

  1. Goto Jihu repo and create a MR
  2. Make a change under lib/backup/
  3. Commit and check the pipeline
  4. You should see the job db:backup_and_restore
  5. You should see the outputs of bundle config under $ source scripts/prepare_build.sh and $ . scripts/prepare_build.sh are the same
  6. You should see the job is passed

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

/cc @prajnamas

Edited by ARCHIVED - Martin Tan

Merge request reports

Loading