gitlab_mr_release 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -0
- data/CHANGELOG.md +7 -1
- data/Gemfile +0 -7
- data/bin/console +7 -10
- data/gitlab_mr_release.gemspec +0 -1
- data/lib/gitlab_mr_release/project.rb +15 -1
- data/lib/gitlab_mr_release/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6de841c4b12ce12ed5b0d7324278798fe4177f4e7860118b2b176a4121e339f3
|
4
|
+
data.tar.gz: 7f6bb8105457e098a9d875522e6be1daf93f81d4ece33eb4a3ddccaf68b387ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8faf002ea5e45facaebf255b61aea94ab130334f7135c91e9ee4521e7bd99926810d8c37db0a6e04fe3345d6f92e7425e3289fd0c11a9e935dd5cfd07e8c17f9
|
7
|
+
data.tar.gz: 9c6ca29b8bd2e8dce4c7160231cd6c118a3465d78135e41ec560c5f059ac4fb3010c55db5d6f38b31069311326a333f2901ab8cc950b839f00a863037a9e01c5
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## Unreleased
|
2
|
-
[full changelog](http://github.com/sue445/gitlab_mr_release/compare/v1.1.
|
2
|
+
[full changelog](http://github.com/sue445/gitlab_mr_release/compare/v1.1.1...master)
|
3
|
+
|
4
|
+
## v1.1.1
|
5
|
+
[full changelog](http://github.com/sue445/gitlab_mr_release/compare/v1.1.0...v1.1.1)
|
6
|
+
|
7
|
+
* Preserve checkbox statuses on update
|
8
|
+
* https://github.com/sue445/gitlab_mr_release/pull/45
|
3
9
|
|
4
10
|
## v1.1.0
|
5
11
|
[full changelog](http://github.com/sue445/gitlab_mr_release/compare/v1.0.1...v1.1.0)
|
data/Gemfile
CHANGED
@@ -10,13 +10,6 @@ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.2")
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.0")
|
14
|
-
group :development do
|
15
|
-
# NOTE: byebug 9.1.0+ requires ruby 2.2.0+
|
16
|
-
gem "byebug", "< 9.1.0", group: :test
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
13
|
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.5.0")
|
21
14
|
# NOTE: unparser v0.3.0+ requires Ruby 2.5+
|
22
15
|
gem "unparser", "< 0.3.0"
|
data/bin/console
CHANGED
@@ -9,14 +9,11 @@ require "gitlab_mr_release"
|
|
9
9
|
require "dotenv"
|
10
10
|
Dotenv.load(".env.gitlab", "~/.env.gitlab")
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
project_name: ENV["GITLAB_PROJECT_NAME"],
|
18
|
-
)
|
19
|
-
end
|
12
|
+
@project = GitlabMrRelease::Project.new(
|
13
|
+
api_endpoint: ENV["GITLAB_API_ENDPOINT"],
|
14
|
+
private_token: ENV["GITLAB_API_PRIVATE_TOKEN"],
|
15
|
+
project_name: ENV["GITLAB_PROJECT_NAME"],
|
16
|
+
)
|
20
17
|
|
21
|
-
require "
|
22
|
-
|
18
|
+
require "irb"
|
19
|
+
IRB.start
|
data/gitlab_mr_release.gemspec
CHANGED
@@ -26,7 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency "activesupport"
|
27
27
|
spec.add_development_dependency "bundler", ">= 1.10"
|
28
28
|
spec.add_development_dependency "coveralls"
|
29
|
-
spec.add_development_dependency "pry-byebug"
|
30
29
|
spec.add_development_dependency "rake"
|
31
30
|
spec.add_development_dependency "rspec"
|
32
31
|
spec.add_development_dependency "rspec-parameterized"
|
@@ -56,7 +56,7 @@ module GitlabMrRelease
|
|
56
56
|
else
|
57
57
|
options = {
|
58
58
|
title: title,
|
59
|
-
description: description
|
59
|
+
description: apply_checkbox_statuses(description, mr.description)
|
60
60
|
}
|
61
61
|
Gitlab.update_merge_request(@project_name, mr.iid, options)
|
62
62
|
end
|
@@ -68,5 +68,19 @@ module GitlabMrRelease
|
|
68
68
|
mr.source_branch == source_branch && mr.target_branch == target_branch
|
69
69
|
end
|
70
70
|
end
|
71
|
+
|
72
|
+
def apply_checkbox_statuses(new_desc, old_desc)
|
73
|
+
checked_iids = old_desc.split("\n").select{ |line| line.include?("[x]") }.map{ |line| /\!\d+/.match(line).to_a.first }.compact
|
74
|
+
|
75
|
+
applied_lines = new_desc.split("\n").map do |line|
|
76
|
+
iid = /\!\d+/.match(line).to_a.first
|
77
|
+
if !iid.nil? && checked_iids.include?(iid)
|
78
|
+
line.gsub(/^( *)(\d+?\.|-|\*) \[ \]/) { "#{$1}#{$2} [x]" }
|
79
|
+
else
|
80
|
+
line
|
81
|
+
end
|
82
|
+
end
|
83
|
+
applied_lines.join("\n")
|
84
|
+
end
|
71
85
|
end
|
72
86
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab_mr_release
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -94,20 +94,6 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: pry-byebug
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: rake
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|