diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-06-15 09:56:41 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-06-15 09:58:01 +0300 |
commit | d0b42b5ca77ad7b6cc6d25a7d4830e2dc428fe3c (patch) | |
tree | fc71ba1d8df287849be7819229407503668ced21 | |
parent | 2b20520bb58e3baeff6351e926a04b1edce4f9f2 (diff) |
ci: Fix Danger job being broken because of duplicate Gemfiles
Recently our Danger job has started failing with the following error
message:
```
[!] There was an error parsing `injected gems`: You cannot specify the same gem twice with different version requirements.
You specified: gitlab-dangerfiles (~> 3.1.0) and gitlab-dangerfiles (>= 0). Gem already added. Bundler cannot continue.
```
As it turns out, this breakage is caused by the upstream change 9e3eff4
(Don't require projects to contain Gemfile when using danger-review job,
2022-06-10) in the common pipeline configurations: if the CI job detects
that there is no Gemfile, it has now started to write one for us that
contains the `gitlab-dangerfiles` version. And because our Gemfile is
not contained in the root directory but instead in the `danger/` sub
directory we now end up with two Gemfiles.
Fix this issue by making use of the new feature: instead of carrying our
own Gemfile, we can now simply rely on the auto-generated Gemfile. While
this forces us to get rid of the Ruby cache which was keyed by our own
Gemfile, this is really not an issue at all: execution of the whole job
only takes about 40 seconds without the cache, which is fast enough.
-rw-r--r-- | .gitlab-ci.yml | 10 | ||||
-rw-r--r-- | danger/Gemfile | 3 | ||||
-rw-r--r-- | danger/Gemfile.lock | 101 |
3 files changed, 1 insertions, 113 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 916e6dfae..d969f49a7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -120,15 +120,7 @@ danger-review: stage: build allow_failure: true variables: - BUNDLE_GEMFILE: danger/Gemfile - cache: - key: - files: - - danger/Gemfile.lock - prefix: debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION} - paths: - - .ruby - policy: pull-push + GITLAB_DANGERFILES_VERSION: "3.1.0" build: needs: [] diff --git a/danger/Gemfile b/danger/Gemfile deleted file mode 100644 index 0d89eafbc..000000000 --- a/danger/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gem 'gitlab-dangerfiles', '~> 3.1.0', require: false diff --git a/danger/Gemfile.lock b/danger/Gemfile.lock deleted file mode 100644 index 6dc374878..000000000 --- a/danger/Gemfile.lock +++ /dev/null @@ -1,101 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - claide (1.1.0) - claide-plugins (0.9.2) - cork - nap - open4 (~> 1.3) - colored2 (3.1.2) - cork (0.3.0) - colored2 (~> 3.1) - danger (8.6.0) - claide (~> 1.0) - claide-plugins (>= 0.9.2) - colored2 (~> 3.1) - cork (~> 0.1) - faraday (>= 0.9.0, < 2.0) - faraday-http-cache (~> 2.0) - git (~> 1.7) - kramdown (~> 2.3) - kramdown-parser-gfm (~> 1.0) - no_proxy_fix - octokit (~> 4.7) - terminal-table (>= 1, < 4) - danger-gitlab (8.0.0) - danger - gitlab (~> 4.2, >= 4.2.0) - faraday (1.10.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-http-cache (2.2.0) - faraday (>= 0.8) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.3) - multipart-post (>= 1.2, < 3) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - git (1.11.0) - rchardet (~> 1.8) - gitlab (4.18.0) - httparty (~> 0.18) - terminal-table (>= 1.5.1) - gitlab-dangerfiles (3.1.0) - danger (>= 8.4.5) - danger-gitlab (>= 8.0.0) - rake - httparty (0.20.0) - mime-types (~> 3.0) - multi_xml (>= 0.5.2) - kramdown (2.3.2) - rexml - kramdown-parser-gfm (1.1.0) - kramdown (~> 2.0) - mime-types (3.4.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) - multi_xml (0.6.0) - multipart-post (2.1.1) - nap (1.1.0) - no_proxy_fix (0.1.2) - octokit (4.22.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - open4 (1.3.4) - public_suffix (4.0.7) - rake (13.0.6) - rchardet (1.8.0) - rexml (3.2.5) - ruby2_keywords (0.0.5) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - unicode-display_width (2.1.0) - -PLATFORMS - ruby - -DEPENDENCIES - gitlab-dangerfiles (~> 3.1.0) - -BUNDLED WITH - 2.2.33 |