gitlab-housekeeper 0.1.0.codechallenge.3c718d.pre → 0.1.0.codechallenge.4eada1e.pre
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 +4 -4
- data/bin/gitlab-housekeeper +0 -4
- data/lib/gitlab/housekeeper/runner.rb +5 -6
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 020c21d5518ddc149e309829db1620ca0714e6b95f111d8f704b6854c6d6fa76
|
|
4
|
+
data.tar.gz: 597930e33694bef637116a8bbe547c8ff31f46380c12e9d064c5f77a787296c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 662890ec680ec7df000f3389d13df32f709713a5e96a8d14b7bcf30b72de9e6dabf2c42e7eab1175ed48b7261a6b593044f53de0c626418ccf9486d4c42a8d73
|
|
7
|
+
data.tar.gz: fa9337b123899e797e35da8e7457a4b1d5ee97c89b402e03a69100d6fd57cceec12cff1b48374cde412cd40878a0172230cd865c36d50d0c5f2bf60006fdbea9
|
data/bin/gitlab-housekeeper
CHANGED
|
@@ -8,10 +8,6 @@ options = {}
|
|
|
8
8
|
OptionParser.new do |opts|
|
|
9
9
|
opts.banner = 'Creates merge requests that can be inferred from the current state of the codebase'
|
|
10
10
|
|
|
11
|
-
opts.on('-b=BRANCH', '--target-branch=BRANCH', String, 'Target branch to use. Defaults to master.') do |branch|
|
|
12
|
-
options[:target_branch] = branch
|
|
13
|
-
end
|
|
14
|
-
|
|
15
11
|
opts.on('-m=M', '--max-mrs=M', Integer, 'Limit of MRs to create. Defaults to 1.') do |m|
|
|
16
12
|
options[:max_mrs] = m
|
|
17
13
|
end
|
|
@@ -15,11 +15,10 @@ require 'digest'
|
|
|
15
15
|
module Gitlab
|
|
16
16
|
module Housekeeper
|
|
17
17
|
class Runner
|
|
18
|
-
def initialize(max_mrs: 1, dry_run: false, keeps: nil, filter_identifiers: []
|
|
18
|
+
def initialize(max_mrs: 1, dry_run: false, keeps: nil, filter_identifiers: [])
|
|
19
19
|
@max_mrs = max_mrs
|
|
20
20
|
@dry_run = dry_run
|
|
21
21
|
@logger = Logger.new($stdout)
|
|
22
|
-
@target_branch = target_branch
|
|
23
22
|
require_keeps
|
|
24
23
|
|
|
25
24
|
@keeps = if keeps
|
|
@@ -127,7 +126,7 @@ module Gitlab
|
|
|
127
126
|
end
|
|
128
127
|
|
|
129
128
|
puts '=> Diff:'
|
|
130
|
-
puts Shell.execute('git', '--no-pager', 'diff', '--color=always',
|
|
129
|
+
puts Shell.execute('git', '--no-pager', 'diff', '--color=always', 'master', branch_name, '--',
|
|
131
130
|
*change.changed_files)
|
|
132
131
|
puts
|
|
133
132
|
end
|
|
@@ -136,7 +135,7 @@ module Gitlab
|
|
|
136
135
|
non_housekeeper_changes = gitlab_client.non_housekeeper_changes(
|
|
137
136
|
source_project_id: housekeeper_fork_project_id,
|
|
138
137
|
source_branch: branch_name,
|
|
139
|
-
target_branch:
|
|
138
|
+
target_branch: 'master',
|
|
140
139
|
target_project_id: housekeeper_target_project_id
|
|
141
140
|
)
|
|
142
141
|
|
|
@@ -148,7 +147,7 @@ module Gitlab
|
|
|
148
147
|
change: change,
|
|
149
148
|
source_project_id: housekeeper_fork_project_id,
|
|
150
149
|
source_branch: branch_name,
|
|
151
|
-
target_branch:
|
|
150
|
+
target_branch: 'master',
|
|
152
151
|
target_project_id: housekeeper_target_project_id,
|
|
153
152
|
update_title: !non_housekeeper_changes.include?(:title),
|
|
154
153
|
update_description: !non_housekeeper_changes.include?(:description),
|
|
@@ -161,7 +160,7 @@ module Gitlab
|
|
|
161
160
|
gitlab_client.get_existing_merge_request(
|
|
162
161
|
source_project_id: housekeeper_fork_project_id,
|
|
163
162
|
source_branch: branch_name,
|
|
164
|
-
target_branch:
|
|
163
|
+
target_branch: 'master',
|
|
165
164
|
target_project_id: housekeeper_target_project_id
|
|
166
165
|
)
|
|
167
166
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab-housekeeper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.0.codechallenge.
|
|
4
|
+
version: 0.1.0.codechallenge.4eada1e.pre
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- group::tenant-scale
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-03-
|
|
11
|
+
date: 2024-03-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|