gitlab-housekeeper 0.1.0.codechallenge.f84720.pre → 0.1.0.pre.code.pre.challenge.pre.f0dc6c.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/gitlab-housekeeper +0 -4
- data/lib/gitlab/housekeeper/runner.rb +7 -9
- 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: cd6805b38ad05a71627181fe194b47da9608acbbb7c8712a39dea2f37a59b17e
|
4
|
+
data.tar.gz: 1186229f242b4d59a70732beaa9379c8c4462a776fcdc4bcf7a912fd4329dfe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d15af919460aa575b5ca61d64c46a288bb5469ba65d569d6e0879d6e34eac38262c8341b3d9a92aee5d4ca706fb99073176e5d306f301dd9a9893187f39e187
|
7
|
+
data.tar.gz: d6b484163ae9bc9571b813c2a3006951f5b2b0c22c3bc4e1c38b6ae4fa274a1bde91684d562cb6d22476e6610028cf4265de2e4e2bd7e9dd7badb81a362c2804
|
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
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'active_support'
|
4
|
-
require 'active_support/core_ext'
|
3
|
+
require 'active_support/core_ext/string'
|
5
4
|
require 'gitlab/housekeeper/keep'
|
6
5
|
require 'gitlab/housekeeper/keeps/rubocop_fixer'
|
7
6
|
require 'gitlab/housekeeper/keeps/upgrade_dependency'
|
@@ -15,11 +14,10 @@ require 'digest'
|
|
15
14
|
module Gitlab
|
16
15
|
module Housekeeper
|
17
16
|
class Runner
|
18
|
-
def initialize(max_mrs: 1, dry_run: false, keeps: nil, filter_identifiers: []
|
17
|
+
def initialize(max_mrs: 1, dry_run: false, keeps: nil, filter_identifiers: [])
|
19
18
|
@max_mrs = max_mrs
|
20
19
|
@dry_run = dry_run
|
21
20
|
@logger = Logger.new($stdout)
|
22
|
-
@target_branch = target_branch
|
23
21
|
require_keeps
|
24
22
|
|
25
23
|
@keeps = if keeps
|
@@ -98,7 +96,7 @@ module Gitlab
|
|
98
96
|
end
|
99
97
|
|
100
98
|
def git
|
101
|
-
@git ||= ::Gitlab::Housekeeper::Git.new(logger: @logger
|
99
|
+
@git ||= ::Gitlab::Housekeeper::Git.new(logger: @logger)
|
102
100
|
end
|
103
101
|
|
104
102
|
def require_keeps
|
@@ -127,7 +125,7 @@ module Gitlab
|
|
127
125
|
end
|
128
126
|
|
129
127
|
puts '=> Diff:'
|
130
|
-
puts Shell.execute('git', '--no-pager', 'diff', '--color=always',
|
128
|
+
puts Shell.execute('git', '--no-pager', 'diff', '--color=always', 'master', branch_name, '--',
|
131
129
|
*change.changed_files)
|
132
130
|
puts
|
133
131
|
end
|
@@ -136,7 +134,7 @@ module Gitlab
|
|
136
134
|
non_housekeeper_changes = gitlab_client.non_housekeeper_changes(
|
137
135
|
source_project_id: housekeeper_fork_project_id,
|
138
136
|
source_branch: branch_name,
|
139
|
-
target_branch:
|
137
|
+
target_branch: 'master',
|
140
138
|
target_project_id: housekeeper_target_project_id
|
141
139
|
)
|
142
140
|
|
@@ -148,7 +146,7 @@ module Gitlab
|
|
148
146
|
change: change,
|
149
147
|
source_project_id: housekeeper_fork_project_id,
|
150
148
|
source_branch: branch_name,
|
151
|
-
target_branch:
|
149
|
+
target_branch: 'master',
|
152
150
|
target_project_id: housekeeper_target_project_id,
|
153
151
|
update_title: !non_housekeeper_changes.include?(:title),
|
154
152
|
update_description: !non_housekeeper_changes.include?(:description),
|
@@ -161,7 +159,7 @@ module Gitlab
|
|
161
159
|
gitlab_client.get_existing_merge_request(
|
162
160
|
source_project_id: housekeeper_fork_project_id,
|
163
161
|
source_branch: branch_name,
|
164
|
-
target_branch:
|
162
|
+
target_branch: 'master',
|
165
163
|
target_project_id: housekeeper_target_project_id
|
166
164
|
)
|
167
165
|
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.
|
4
|
+
version: 0.1.0.pre.code.pre.challenge.pre.f0dc6c.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
|