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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69b7126c1aca9a96bb04c081db7e50c0609a78990d792f55eb1c8cfdc4688d5c
4
- data.tar.gz: 1033a6b4d36af3ae5e31568b0d88ead48eabc4a38fc40947b29ea249c67c0771
3
+ metadata.gz: 6de841c4b12ce12ed5b0d7324278798fe4177f4e7860118b2b176a4121e339f3
4
+ data.tar.gz: 7f6bb8105457e098a9d875522e6be1daf93f81d4ece33eb4a3ddccaf68b387ad
5
5
  SHA512:
6
- metadata.gz: 5a4d2b7496f4fc07530d91325c4c2134f24040f811ee52f757fee8833434be323e800a578ff55bc677a902ffe35d213fe91decf9382c5fe479e8b3ab898ab2ec
7
- data.tar.gz: 69d575164e5fed8d72a39b5d0308e359cb8a9dd98cfe0987b6f7646634100821e6c62e38d01cbdea72dd0cc933274a5905870d21f49d13049211b0890c06ebd8
6
+ metadata.gz: 8faf002ea5e45facaebf255b61aea94ab130334f7135c91e9ee4521e7bd99926810d8c37db0a6e04fe3345d6f92e7425e3289fd0c11a9e935dd5cfd07e8c17f9
7
+ data.tar.gz: 9c6ca29b8bd2e8dce4c7160231cd6c118a3465d78135e41ec560c5f059ac4fb3010c55db5d6f38b31069311326a333f2901ab8cc950b839f00a863037a9e01c5
@@ -2,6 +2,8 @@ name: test
2
2
 
3
3
  on:
4
4
  push:
5
+ branches:
6
+ - master
5
7
  pull_request:
6
8
  types:
7
9
  - opened
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
- [full changelog](http://github.com/sue445/gitlab_mr_release/compare/v1.1.0...master)
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"
@@ -9,14 +9,11 @@ require "gitlab_mr_release"
9
9
  require "dotenv"
10
10
  Dotenv.load(".env.gitlab", "~/.env.gitlab")
11
11
 
12
- clean_room = Object.new
13
- clean_room.instance_eval do
14
- @project = GitlabMrRelease::Project.new(
15
- api_endpoint: ENV["GITLAB_API_ENDPOINT"],
16
- private_token: ENV["GITLAB_API_PRIVATE_TOKEN"],
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 "pry"
22
- Pry.start(clean_room)
18
+ require "irb"
19
+ IRB.start
@@ -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
@@ -1,3 +1,3 @@
1
1
  module GitlabMrRelease
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  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.0
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-12 00:00:00.000000000 Z
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