gitlabci-bundle-update-mr 5.0.2 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4415f0c023d0f8b003ecca1125cb7af21c1755b1871d3e072cb23645ec37992c
4
- data.tar.gz: 993d777b563c5a379bde8cc1dac59e818f086d8f6cbaad3779b0402a23ae4541
3
+ metadata.gz: 8aca5941da45bdd58c50b8b80f042f54c9938ecf9b9a707bea62e1b0ba616e25
4
+ data.tar.gz: 57e30cfb698a4f082d9043017c909c41a37b5c4af44ec3787c33ffd94bda8a31
5
5
  SHA512:
6
- metadata.gz: d36e5b53edc35e796d7636973af834b110e066b83848753f7ff295f14638441f5f9f67bb9ddf44576ad8b86ad6b6382365685e7e28ac94edb0d2ec5f75195c93
7
- data.tar.gz: '052809f3b7d3a51ec98a6435e65e2855f7406e0718f13b73e6610bc3142006a481eb1193b1788bed8282c8b55d63e91864999aa665f4674280888ee8393080e6'
6
+ metadata.gz: 1fc7f885f8874d20526d1160b931a924cced137c5295df85c957422ebe158b3c0c3bf2bd121c5347caacaad3dc0618d2efad554c14d09637562c78c419d1a037
7
+ data.tar.gz: 2e75381611d70e064194d319186cd4a7882deee2c8bc30a498c1b5295f465e3529461ced7fa56f5a6806ef6c7a8266b8e94f530de95716ffef7e7d7b5fb5a468
data/.gitlab-ci.yml CHANGED
@@ -3,21 +3,16 @@ stages:
3
3
  - deploy
4
4
 
5
5
  include:
6
- - local: "/gitlabci-templates/continuous_bundle_update.yml"
6
+ - local: gitlabci-components/continuous_bundle_update.yml
7
+ inputs:
8
+ merge_when_pipeline_succeeds: true
9
+ job_stage: build
10
+ assignees: sue445
7
11
 
8
- continuous_bundle_update:
9
- stage: build
10
-
11
- variables:
12
- CACHE_VERSION: "v2"
13
- GIT_EMAIL: "gitlabci@example.com"
14
- GIT_USER: "GitLab CI"
15
- OPTIONS: "--merge-when-pipeline-succeeds"
16
- ASSIGNEES: "sue445"
17
-
18
- before_script:
19
- # Set timezone to Asia/Tokyo
20
- - cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
12
+ job_before_script:
13
+ - set -xe # TODO: debug
14
+ # Set timezone to Asia/Tokyo
15
+ - cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
21
16
 
22
17
  .default:
23
18
  cache:
@@ -79,6 +74,8 @@ pages:
79
74
  paths:
80
75
  - public
81
76
  rules:
77
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
78
+ when: never
82
79
  - if: '$CI_COMMIT_BRANCH == "master"'
83
80
 
84
81
  gitlab_awesome_release:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## Unreleased
2
- [full changelog](https://gitlab.com/sue445/gitlabci-bundle-update-mr/compare/v5.0.2...master)
2
+ [full changelog](https://gitlab.com/sue445/gitlabci-bundle-update-mr/compare/v5.1.0...master)
3
+
4
+ ## v5.1.0
5
+ [full changelog](https://gitlab.com/sue445/gitlabci-bundle-update-mr/compare/v5.0.2...v5.1.0)
6
+
7
+ * Pass both `merge_when_pipeline_succeeds` and `auto_merge` to Merge a merge request API
8
+ * https://gitlab.com/sue445/gitlabci-bundle-update-mr/-/merge_requests/368
9
+ * Add gitlabci-components/continuous_bundle_update.yml
10
+ * https://gitlab.com/sue445/gitlabci-bundle-update-mr/-/merge_requests/364
11
+ * Tweak cli description
12
+ * https://gitlab.com/sue445/gitlabci-bundle-update-mr/-/merge_requests/370
3
13
 
4
14
  ## v5.0.2
5
15
  [full changelog](https://gitlab.com/sue445/gitlabci-bundle-update-mr/compare/v5.0.1...v5.0.2)
data/Gemfile CHANGED
@@ -6,6 +6,3 @@ gemspec
6
6
 
7
7
  # FIXME: following gems are often downgraded when `bundle update`
8
8
  gem "sawyer", ">= 0.8.1"
9
-
10
- # octokit 5.0.0+ requires Ruby 2.7.0+
11
- gem "octokit", "< 5.0.0"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlabci-bundle-update-mr (5.0.2)
4
+ gitlabci-bundle-update-mr (5.1.0)
5
5
  bundler
6
6
  compare_linker (>= 1.4.11)
7
7
  git (= 1.7.0)
@@ -13,9 +13,9 @@ GEM
13
13
  specs:
14
14
  addressable (2.8.7)
15
15
  public_suffix (>= 2.0.2, < 7.0)
16
- ast (2.4.2)
16
+ ast (2.4.3)
17
17
  base64 (0.2.0)
18
- bigdecimal (3.1.9)
18
+ bigdecimal (3.2.3)
19
19
  compare_linker (1.4.11)
20
20
  base64
21
21
  httpclient
@@ -24,19 +24,19 @@ GEM
24
24
  crack (1.0.0)
25
25
  bigdecimal
26
26
  rexml
27
- csv (3.3.2)
28
- diff-lcs (1.6.0)
27
+ csv (3.3.5)
28
+ diff-lcs (1.6.2)
29
29
  docile (1.4.1)
30
- dotenv (3.1.7)
31
- faraday (2.12.2)
30
+ dotenv (3.1.8)
31
+ faraday (2.14.0)
32
32
  faraday-net_http (>= 2.0, < 3.5)
33
33
  json
34
34
  logger
35
- faraday-net_http (3.4.0)
35
+ faraday-net_http (3.4.1)
36
36
  net-http (>= 0.5.0)
37
37
  git (1.7.0)
38
38
  rchardet (~> 1.8)
39
- gitlab (5.1.0)
39
+ gitlab (6.0.0)
40
40
  base64 (~> 0.2.0)
41
41
  httparty (~> 0.20)
42
42
  terminal-table (>= 1.5.1)
@@ -45,19 +45,19 @@ GEM
45
45
  gitlab (>= 4.0.0)
46
46
  logger
47
47
  thor
48
- hashdiff (1.1.2)
49
- httparty (0.22.0)
48
+ hashdiff (1.2.1)
49
+ httparty (0.23.1)
50
50
  csv
51
51
  mini_mime (>= 1.0.0)
52
52
  multi_xml (>= 0.5.2)
53
53
  httpclient (2.9.0)
54
54
  mutex_m
55
- json (2.10.1)
56
- language_server-protocol (3.17.0.4)
55
+ json (2.15.0)
56
+ language_server-protocol (3.17.0.5)
57
57
  lint_roller (1.1.0)
58
- logger (1.6.6)
58
+ logger (1.7.0)
59
59
  mini_mime (1.1.5)
60
- multi_xml (0.7.1)
60
+ multi_xml (0.7.2)
61
61
  bigdecimal (~> 3.1)
62
62
  mutex_m (0.3.0)
63
63
  net-http (0.6.0)
@@ -68,40 +68,41 @@ GEM
68
68
  onkcop (1.0.0.0)
69
69
  rubocop (>= 0.80.0)
70
70
  rubocop-rspec (>= 1.34.0)
71
- ostruct (0.6.1)
72
- parallel (1.26.3)
73
- parser (3.3.7.1)
71
+ ostruct (0.6.3)
72
+ parallel (1.27.0)
73
+ parser (3.3.9.0)
74
74
  ast (~> 2.4.1)
75
75
  racc
76
- public_suffix (6.0.1)
76
+ prism (1.5.1)
77
+ public_suffix (6.0.2)
77
78
  racc (1.8.1)
78
79
  rainbow (3.1.1)
79
- rake (13.2.1)
80
- rchardet (1.9.0)
81
- regexp_parser (2.10.0)
80
+ rake (13.3.0)
81
+ rchardet (1.10.0)
82
+ regexp_parser (2.11.3)
82
83
  restore_bundled_with (1.0.0)
83
84
  git
84
85
  thor
85
- rexml (3.4.1)
86
- rspec (3.13.0)
86
+ rexml (3.4.4)
87
+ rspec (3.13.1)
87
88
  rspec-core (~> 3.13.0)
88
89
  rspec-expectations (~> 3.13.0)
89
90
  rspec-mocks (~> 3.13.0)
90
- rspec-core (3.13.3)
91
+ rspec-core (3.13.5)
91
92
  rspec-support (~> 3.13.0)
92
- rspec-expectations (3.13.3)
93
+ rspec-expectations (3.13.5)
93
94
  diff-lcs (>= 1.2.0, < 2.0)
94
95
  rspec-support (~> 3.13.0)
95
96
  rspec-its (2.0.0)
96
97
  rspec-core (>= 3.13.0)
97
98
  rspec-expectations (>= 3.13.0)
98
- rspec-mocks (3.13.2)
99
+ rspec-mocks (3.13.5)
99
100
  diff-lcs (>= 1.2.0, < 2.0)
100
101
  rspec-support (~> 3.13.0)
101
- rspec-support (3.13.2)
102
+ rspec-support (3.13.6)
102
103
  rspec-temp_dir (1.1.1)
103
104
  rspec (>= 3.0)
104
- rubocop (1.72.2)
105
+ rubocop (1.81.1)
105
106
  json (~> 2.3)
106
107
  language_server-protocol (~> 3.17.0.2)
107
108
  lint_roller (~> 1.1.0)
@@ -109,16 +110,17 @@ GEM
109
110
  parser (>= 3.3.0.2)
110
111
  rainbow (>= 2.2.2, < 4.0)
111
112
  regexp_parser (>= 2.9.3, < 3.0)
112
- rubocop-ast (>= 1.38.0, < 2.0)
113
+ rubocop-ast (>= 1.47.1, < 2.0)
113
114
  ruby-progressbar (~> 1.7)
114
115
  unicode-display_width (>= 2.4.0, < 4.0)
115
- rubocop-ast (1.38.0)
116
- parser (>= 3.3.1.0)
117
- rubocop-performance (1.24.0)
116
+ rubocop-ast (1.47.1)
117
+ parser (>= 3.3.7.2)
118
+ prism (~> 1.4)
119
+ rubocop-performance (1.26.0)
118
120
  lint_roller (~> 1.1)
119
- rubocop (>= 1.72.1, < 2.0)
120
- rubocop-ast (>= 1.38.0, < 2.0)
121
- rubocop-rspec (3.5.0)
121
+ rubocop (>= 1.75.0, < 2.0)
122
+ rubocop-ast (>= 1.44.0, < 2.0)
123
+ rubocop-rspec (3.7.0)
122
124
  lint_roller (~> 1.1)
123
125
  rubocop (~> 1.72, >= 1.72.1)
124
126
  rubocop_auto_corrector (0.5.0)
@@ -131,19 +133,19 @@ GEM
131
133
  docile (~> 1.1)
132
134
  simplecov-html (~> 0.11)
133
135
  simplecov_json_formatter (~> 0.1)
134
- simplecov-cobertura (2.1.0)
136
+ simplecov-cobertura (3.1.0)
135
137
  rexml
136
138
  simplecov (~> 0.19)
137
- simplecov-html (0.13.1)
139
+ simplecov-html (0.13.2)
138
140
  simplecov_json_formatter (0.1.4)
139
141
  terminal-table (4.0.0)
140
142
  unicode-display_width (>= 1.1.1, < 4)
141
- thor (1.3.2)
142
- unicode-display_width (3.1.4)
143
- unicode-emoji (~> 4.0, >= 4.0.4)
144
- unicode-emoji (4.0.4)
145
- uri (1.0.2)
146
- webmock (3.25.0)
143
+ thor (1.4.0)
144
+ unicode-display_width (3.2.0)
145
+ unicode-emoji (~> 4.1)
146
+ unicode-emoji (4.1.0)
147
+ uri (1.0.3)
148
+ webmock (3.25.1)
147
149
  addressable (>= 2.8.0)
148
150
  crack (>= 0.3.2)
149
151
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -156,7 +158,6 @@ DEPENDENCIES
156
158
  dotenv
157
159
  gitlab_awesome_release
158
160
  gitlabci-bundle-update-mr!
159
- octokit (< 5.0.0)
160
161
  onkcop (>= 1.0.0.0)
161
162
  rake (>= 10.0)
162
163
  rspec (~> 3.0)
data/README.md CHANGED
@@ -86,8 +86,8 @@ continuous_bundle_update:
86
86
  - schedules
87
87
  ```
88
88
 
89
- ### Step 1-B. Using `include`
90
- `include` is available in one of the following versions.
89
+ ### Step 1-B. Using `include` template (Deprecated)
90
+ `include` template is available in one of the following versions.
91
91
 
92
92
  * GitLab Core 11.4+
93
93
  * GitLab Premium 10.5+
@@ -119,6 +119,38 @@ continuous_bundle_update:
119
119
  - cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
120
120
  ```
121
121
 
122
+ ### Step 1-C. Using `include` component
123
+ [CI/CD components](https://docs.gitlab.com/ci/components/) is available since GitLab 17.0+
124
+
125
+ example (minimum)
126
+
127
+ ```yml
128
+ include:
129
+ - remote: https://gitlab.com/sue445/gitlabci-bundle-update-mr/-/raw/master/gitlabci-components/continuous_bundle_update.yml
130
+ ```
131
+
132
+ example (custom)
133
+
134
+ ```yml
135
+ include:
136
+ - remote: https://gitlab.com/sue445/gitlabci-bundle-update-mr/-/raw/master/gitlabci-components/continuous_bundle_update.yml
137
+ inputs:
138
+ merge_when_pipeline_succeeds: true
139
+ job_stage: build
140
+
141
+ job_before_script:
142
+ - cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
143
+
144
+ job_rules:
145
+ - if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_PIPELINE_SCHEDULE_DESCRIPTION == "continuous_bundle_update"'
146
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
147
+ when: never
148
+ ```
149
+
150
+ full options are following.
151
+
152
+ [gitlabci-components/continuous_bundle_update.yml](gitlabci-components/continuous_bundle_update.yml)
153
+
122
154
  ### Step 2. Register scheduler
123
155
  And register scheduler to `https://YOUR-GITLAB/YOUR-NAME/REPO-NAME/pipeline_schedules`
124
156
 
@@ -134,7 +166,7 @@ Usage: gitlabci-bundle-update-mr [options]
134
166
  -l, --labels 'In Review, Update' Add labels to the MR
135
167
  --update-bundled-with Whether to update `BUNDLED WITH` section in Gemfie.lock (default. false)
136
168
  --merge-when-pipeline-succeeds
137
- Whether to set 'Merge when pipeline succeeds' (default. false)
169
+ Whether to set 'Auto-merge' (formerly 'Merge when pipeline succeeds') (default. false)
138
170
  --assignees 'foo, bar' Add assignees to the MR
139
171
  ```
140
172
 
@@ -18,7 +18,11 @@ opt.on("--user USER", "git username (default. `git config user.name`)") {|v| aut
18
18
  opt.on("-d", "--duplicate", "Make MR even if it has already existed (default. false)") {|v| allow_dup_mr = v }
19
19
  opt.on("-l", "--labels 'In Review, Update'", Array, "Add labels to the MR") {|v| mr_labels = v.map(&:strip) }
20
20
  opt.on("--update-bundled-with", "Whether to update `BUNDLED WITH` section in Gemfie.lock (default. false)") {|v| update_bundled_with = v }
21
- opt.on("--merge-when-pipeline-succeeds", "Whether to set 'Merge when pipeline succeeds' (default. false)") {|v| merge_when_pipeline_succeeds = v }
21
+
22
+ opt.on("--merge-when-pipeline-succeeds", "Whether to set 'Auto-merge' (formerly 'Merge when pipeline succeeds') (default. false)") do |v|
23
+ merge_when_pipeline_succeeds = v
24
+ end
25
+
22
26
  opt.on("--assignees 'foo, bar'", Array, "Add assignees to the MR") {|v| assignees = v.map(&:strip) }
23
27
 
24
28
  opt.parse!(ARGV)
@@ -0,0 +1,115 @@
1
+ spec:
2
+ inputs:
3
+ job_name:
4
+ default: continuous_bundle_update
5
+
6
+ job_stage:
7
+ default: test
8
+
9
+ job_image:
10
+ default: ruby
11
+
12
+ job_before_script:
13
+ type: array
14
+ default: []
15
+
16
+ job_rules:
17
+ type: array
18
+ default:
19
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
20
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
21
+ when: never
22
+
23
+ cache_key:
24
+ default: "v1-$CI_JOB_NAME_SLUG"
25
+
26
+ git_email:
27
+ default: "gitlabci@example.com"
28
+
29
+ git_user:
30
+ default: "GitLab CI"
31
+
32
+ gem_version:
33
+ default: ""
34
+ description: "gitlabci-bundle-update-mr version (default: latest)"
35
+
36
+ gem_install_options:
37
+ default: "--no-doc"
38
+ description: "Passed to 'gem install gitlabci-bundle-update-mr'"
39
+
40
+ labels:
41
+ default: "bundle update"
42
+ description: "Add labels to the MR (e.g. 'In Review, Update')"
43
+
44
+ assignees:
45
+ default: ""
46
+ description: "Add assignees to the MR (e.g. 'foo, bar')"
47
+
48
+ duplicate:
49
+ type: boolean
50
+ default: false
51
+ description: "Make MR even if it has already existed"
52
+
53
+ update_bundled_with:
54
+ type: boolean
55
+ default: false
56
+ description: "Whether to update `BUNDLED WITH` section in Gemfile.lock"
57
+
58
+ merge_when_pipeline_succeeds:
59
+ type: boolean
60
+ default: false
61
+ description: "Whether to set 'Merge when pipeline succeeds'"
62
+
63
+ ---
64
+
65
+ $[[ inputs.job_name ]]:
66
+ image: $[[ inputs.job_image ]]
67
+
68
+ stage: $[[ inputs.job_stage ]]
69
+
70
+ variables:
71
+ GIT_EMAIL: $[[ inputs.git_email ]]
72
+ GIT_USER: $[[ inputs.git_user ]]
73
+ GEM_VERSION: $[[ inputs.gem_version ]]
74
+ GEM_INSTALL_OPTIONS: $[[ inputs.gem_install_options ]]
75
+ LABELS: $[[ inputs.labels ]]
76
+ ASSIGNEES: $[[ inputs.assignees ]]
77
+ DUPLICATE: $[[ inputs.duplicate ]]
78
+ UPDATE_BUNDLED_WITH: $[[ inputs.update_bundled_with ]]
79
+ MERGE_WHEN_PIPELINE_SUCCEEDS: $[[ inputs.merge_when_pipeline_succeeds ]]
80
+
81
+ cache:
82
+ key: $[[ inputs.cache_key ]]
83
+ paths:
84
+ - vendor/bundle/
85
+
86
+ before_script: $[[ inputs.job_before_script ]]
87
+
88
+ script:
89
+ - bundle config --local path 'vendor/bundle'
90
+ - bundle install --retry=3 --jobs=$(nproc)
91
+ - bundle clean
92
+ - |
93
+ if [ -n "$GEM_VERSION" ]; then
94
+ GEM_INSTALL_OPTIONS="--version $GEM_VERSION $GEM_INSTALL_OPTIONS"
95
+ fi
96
+ - gem install gitlabci-bundle-update-mr $GEM_INSTALL_OPTIONS
97
+
98
+ - |
99
+ OPTIONS=""
100
+ if [ -n "$ASSIGNEES" ]; then
101
+ OPTIONS="$OPTIONS --assignees $ASSIGNEES"
102
+ fi
103
+ if $DUPLICATE; then
104
+ OPTIONS="$OPTIONS --duplicate"
105
+ fi
106
+ if $UPDATE_BUNDLED_WITH; then
107
+ OPTIONS="$OPTIONS --update-bundled-with"
108
+ fi
109
+ if $MERGE_WHEN_PIPELINE_SUCCEEDS; then
110
+ OPTIONS="$OPTIONS --merge-when-pipeline-succeeds"
111
+ fi
112
+
113
+ - gitlabci-bundle-update-mr --user="$GIT_USER" --email="$GIT_EMAIL" --labels="$LABELS" $OPTIONS
114
+
115
+ rules: $[[ inputs.job_rules ]]
@@ -208,7 +208,7 @@ module Gitlabci
208
208
 
209
209
  def accept_merge_request(mr_id)
210
210
  with_retry do
211
- @gitlab.accept_merge_request(@project_name, mr_id, merge_when_pipeline_succeeds: true, should_remove_source_branch: true)
211
+ @gitlab.accept_merge_request(@project_name, mr_id, merge_when_pipeline_succeeds: true, auto_merge: true, should_remove_source_branch: true)
212
212
  end
213
213
  end
214
214
 
@@ -2,7 +2,7 @@ module Gitlabci
2
2
  module Bundle
3
3
  module Update
4
4
  module Mr
5
- VERSION = "5.0.2".freeze
5
+ VERSION = "5.1.0".freeze
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlabci-bundle-update-mr
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.2
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-02-22 00:00:00.000000000 Z
10
+ date: 2025-10-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bundler
@@ -329,6 +329,7 @@ files:
329
329
  - bin/setup
330
330
  - exe/gitlabci-bundle-update-mr
331
331
  - gitlabci-bundle-update-mr.gemspec
332
+ - gitlabci-components/continuous_bundle_update.yml
332
333
  - gitlabci-templates/continuous_bundle_update.yml
333
334
  - lib/gitlabci/bundle/update/mr.rb
334
335
  - lib/gitlabci/bundle/update/mr/client.rb