gitlab-dangerfiles 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gitlab-dangerfiles.gemspec +2 -1
- data/lib/danger/plugins/helper.rb +1 -1
- data/lib/danger/plugins/roulette.rb +1 -1
- data/lib/danger/rules/commit_messages/Dangerfile +3 -4
- data/lib/gitlab/dangerfiles.rb +1 -0
- data/lib/gitlab/dangerfiles/commit_linter.rb +2 -1
- data/lib/gitlab/dangerfiles/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f9d4db82aaf60ca573623de5e99c72f5518baef3181d8c854b52131ab4abf60
|
4
|
+
data.tar.gz: 06bb46e9c0c500cfa1d9e3aef672d529d99f70283ed66fd87291c66117205a96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57da7c2b5d0bb5c47fff3b663d9fa9d3465b7eec5d343423148b11f78079224c5d8682692863ec9736fdccbd42cccf3e3127a7b85ce3f2973baa8108421e6ed0
|
7
|
+
data.tar.gz: be63b6430ab6bf1e4cfab3ee6849355331ccedb340a1fcdf1a4347c254a6c52c1feea88a3f9e67d2c2d3bd1aa734f22b59fca852558e788a5e4353b8f4456572
|
data/gitlab-dangerfiles.gemspec
CHANGED
@@ -27,7 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.add_dependency "danger-gitlab"
|
30
|
+
spec.add_dependency "danger-gitlab", ">= 8.0.0"
|
31
|
+
spec.add_dependency "danger", ">= 8.3.1"
|
31
32
|
|
32
33
|
spec.add_development_dependency "rspec", "~> 3.0"
|
33
34
|
spec.add_development_dependency "rspec-parameterized"
|
@@ -416,7 +416,7 @@ module Danger
|
|
416
416
|
return nil unless ci?
|
417
417
|
return nil if defined?(@force_changes_from_git)
|
418
418
|
|
419
|
-
@changes_from_api ||= gitlab_helper.mr_changes
|
419
|
+
@changes_from_api ||= gitlab_helper.mr_changes
|
420
420
|
rescue
|
421
421
|
# Fallback to the Git strategy in any case
|
422
422
|
@force_changes_from_git = true
|
@@ -34,7 +34,7 @@ module Danger
|
|
34
34
|
#
|
35
35
|
# @return [Array<Spin>]
|
36
36
|
def spin(project, categories = [nil], timezone_experiment: false)
|
37
|
-
spins = categories.
|
37
|
+
spins = categories.sort_by(&:to_s).map do |category|
|
38
38
|
including_timezone = INCLUDE_TIMEZONE_FOR_CATEGORY.fetch(category, timezone_experiment)
|
39
39
|
|
40
40
|
spin_for_category(project, category, timezone_experiment: including_timezone)
|
@@ -6,6 +6,7 @@ require_relative "../../../gitlab/dangerfiles/merge_request_linter"
|
|
6
6
|
COMMIT_MESSAGE_GUIDELINES = "https://docs.gitlab.com/ee/development/contributing/merge_request_workflow.html#commit-messages-guidelines"
|
7
7
|
MORE_INFO = "For more information, take a look at our [Commit message guidelines](#{COMMIT_MESSAGE_GUIDELINES})."
|
8
8
|
THE_DANGER_JOB_TEXT = "the `%<job_name>` job"
|
9
|
+
MAX_COMMITS_COUNT = helper.config.max_commits_count
|
9
10
|
MAX_COMMITS_COUNT_EXCEEDED_MESSAGE = <<~MSG
|
10
11
|
This merge request includes more than %<max_commits_count>d commits. Each commit should meet the following criteria:
|
11
12
|
|
@@ -17,8 +18,6 @@ This merge request includes more than %<max_commits_count>d commits. Each commit
|
|
17
18
|
If this merge request contains commits that do not meet this criteria and/or contains intermediate work, please rebase these commits into a smaller number of commits or split this merge request into multiple smaller merge requests.
|
18
19
|
MSG
|
19
20
|
|
20
|
-
max_commits_count = helper.config.max_commits_count
|
21
|
-
|
22
21
|
def fail_commit(commit, message, more_info: true)
|
23
22
|
self.fail(build_message(commit, message, more_info: more_info))
|
24
23
|
end
|
@@ -104,8 +103,8 @@ def lint_commits(commits)
|
|
104
103
|
end
|
105
104
|
end
|
106
105
|
else
|
107
|
-
if count_non_fixup_commits(commit_linters) >
|
108
|
-
self.warn(format(MAX_COMMITS_COUNT_EXCEEDED_MESSAGE, max_commits_count:
|
106
|
+
if count_non_fixup_commits(commit_linters) > MAX_COMMITS_COUNT
|
107
|
+
self.warn(format(MAX_COMMITS_COUNT_EXCEEDED_MESSAGE, max_commits_count: MAX_COMMITS_COUNT))
|
109
108
|
end
|
110
109
|
end
|
111
110
|
|
data/lib/gitlab/dangerfiles.rb
CHANGED
@@ -12,6 +12,7 @@ module Gitlab
|
|
12
12
|
SHORT_REFERENCE_REGEX = %r{([\w\-\/]+)?(?<!`)(#|!|&)\d+(?<!`)}.freeze
|
13
13
|
# Milestone
|
14
14
|
MS_SHORT_REFERENCE_REGEX = %r{([\w\-\/]+)?(?<!`)%"?\d{1,3}\.\d{1,3}"?(?<!`)}.freeze
|
15
|
+
SUGGESTIONS_APPLIED_COMMIT_REGEX = /Apply \d+ suggestion\(s\) to \d+ file\(s\)/.freeze
|
15
16
|
|
16
17
|
def self.problems_mapping
|
17
18
|
super.merge(
|
@@ -41,7 +42,7 @@ module Gitlab
|
|
41
42
|
end
|
42
43
|
|
43
44
|
def suggestion?
|
44
|
-
commit.message
|
45
|
+
SUGGESTIONS_APPLIED_COMMIT_REGEX.match?(commit.message)
|
45
46
|
end
|
46
47
|
|
47
48
|
def merge?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-dangerfiles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06
|
11
|
+
date: 2021-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-gitlab
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 8.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 8.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: danger
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 8.3.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 8.3.1
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|