gitlab-dangerfiles 2.10.0 → 2.11.0

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: 4a13e98277af51b86d8b4afca50ca70527b3b0ecba77e5a8123ce3a4b25466ee
4
- data.tar.gz: 36dcfa615dad06e9cf4648ce7654f872dc79a8b1ad6d32c90d4af70f6d655e9e
3
+ metadata.gz: 708f86af0c7d76e5df58d4ea85223461f39f1f7fb4248b3236d7baa92b626ccf
4
+ data.tar.gz: 22f2ee0d777dbc7ab95956f5bf2191c03449bc170baf9c9bacbd1e1e4a32ed69
5
5
  SHA512:
6
- metadata.gz: c16d35634b11646fc95c89f7868aa91541adbcc407ad923b4625dc2d55ed27a007ead9ce9f5cc1fdd1e3aecd473f566498955ffaa209b6e6d1cba93388ebdc00
7
- data.tar.gz: 7a20be61d0f2777804315d02343d666e917c996e94b61916330bf2f7ac602ec6e35158a6768f0b73e5f4f1d420af435bae397ce72681379ce7a1cc6274c3180f
6
+ metadata.gz: ad25c4c671fcde850a9c1740fb4e8dc847e4593cff3a55b4ef502bcb902cf84d5ddb4c7a0e64063371d252624f506b47047d32d292efa6ebee92f6db948162c5
7
+ data.tar.gz: '066975079aae0a2307c5b2a5734f4ff43d6556bd149c4dcdcac3586646e416c2abc1234ff3833359f24b4e5f19a1eece8af66c7c32b5b813df79cc5fb93bfbe6'
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020-2021 GitLab
3
+ Copyright (c) 2020-present GitLab
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -131,7 +131,17 @@ project. To use it in your project, perform the following steps:
131
131
 
132
132
  #### `type_label`
133
133
 
134
- This rule ensures the merge request has a proper [type label](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification) set..
134
+ This rule ensures the merge request has a proper [type label](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification) set.
135
+
136
+ If the `changelog` plugin is available, it also tries to infer a type label from the `Changelog` trailer of the MR.
137
+
138
+ #### `z_add_labels`
139
+
140
+ This rule adds labels set from other rules (via `helper.labels_to_add`), with a single API request.
141
+
142
+ #### `z_retry_link`
143
+
144
+ This rule adds a retry link to the job where Danger ran at the end of the Danger message, only if there's any other message to post.
135
145
 
136
146
  ### CI configuration
137
147
 
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
 
30
30
  spec.add_dependency "danger-gitlab", ">= 8.0.0"
31
- spec.add_dependency "danger", ">= 8.3.1"
31
+ spec.add_dependency "danger", ">= 8.4.5"
32
32
 
33
33
  spec.add_development_dependency "rspec", "~> 3.0"
34
34
  spec.add_development_dependency "rspec-parameterized"
@@ -4,9 +4,8 @@ module Danger
4
4
  # Contains method to check the presense and validity of changelogs.
5
5
  class Changelog < Danger::Plugin
6
6
  NO_CHANGELOG_LABELS = [
7
- "type::tooling",
8
- "tooling::pipelines",
9
- "tooling::workflow",
7
+ "maintenance::pipelines",
8
+ "maintenance::workflow",
10
9
  "ci-build",
11
10
  "meta",
12
11
  ].freeze
@@ -20,7 +20,7 @@ module Danger
20
20
  test: "~test ~Quality for `spec/features/*`",
21
21
  # Deprecated as of 2.3.0 in favor of tooling
22
22
  engineering_productivity: '~"Engineering Productivity" for CI, Danger',
23
- tooling: '~"type::tooling" for CI, Danger',
23
+ tooling: '~"maintenance::workflow" / ~"maintenance::pipelines" for CI, Danger',
24
24
  ci_template: '~"ci::templates"',
25
25
  product_intelligence: '~"product intelligence"',
26
26
  integrations_be: '~"group::integrations" (backend)',
@@ -120,7 +120,7 @@ module Danger
120
120
  # +modified_files+ might contain paths that already have been renamed,
121
121
  # so we need to remove them from the list.
122
122
  def all_changed_files
123
- changes.files - changes.renamed_before.files
123
+ changes.files - changes.deleted.files - changes.renamed_before.files
124
124
  end
125
125
 
126
126
  # @param filename [String] A file name for which we want the diff.
@@ -282,7 +282,7 @@ module Danger
282
282
  def mr_labels
283
283
  return [] unless ci?
284
284
 
285
- (gitlab_helper.mr_labels + labels_to_add.to_a).uniq
285
+ (gitlab_helper.mr_labels + labels_to_add).uniq
286
286
  end
287
287
 
288
288
  # @return [String] +`git rev-parse --abbrev-ref HEAD`+ when not in the CI context, and the MR source branch otherwise.
@@ -409,9 +409,9 @@ module Danger
409
409
  # itself. Without this method, the first rule wouldn't know that the label would be applied and would ask
410
410
  # for it anyway.
411
411
  #
412
- # @return [Set<String>] the list of labels that Danger will add
412
+ # @return [Array<String>] the list of labels that Danger will add
413
413
  def labels_to_add
414
- @labels_to_add ||= Set.new
414
+ @labels_to_add ||= []
415
415
  end
416
416
 
417
417
  private
@@ -4,7 +4,7 @@ require_relative "../../../gitlab/dangerfiles/type_label_guesser"
4
4
 
5
5
  if respond_to?(:changelog) && !helper.has_scoped_label_with_scope?("type")
6
6
  type_label_guesser = Gitlab::Dangerfiles::TypeLabelGuesser.new
7
- helper.labels_to_add.merge(type_label_guesser.labels_from_changelog_categories(changelog.categories))
7
+ helper.labels_to_add.concat(type_label_guesser.labels_from_changelog_categories(changelog.categories))
8
8
  end
9
9
 
10
10
  unless helper.has_scoped_label_with_scope?("type")
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module Dangerfiles
3
- VERSION = "2.10.0"
3
+ VERSION = "2.11.0"
4
4
  end
5
5
  end
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.10.0
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-28 00:00:00.000000000 Z
11
+ date: 2022-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-gitlab
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 8.3.1
33
+ version: 8.4.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 8.3.1
40
+ version: 8.4.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement