danger 8.3.1 → 8.4.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: 78727e10312d96889e8e0fe3dcf38c1ec9137932972eb2538f9d39e0c114ef1c
4
- data.tar.gz: 57bbfff9bf004e91e3e900b87a80d34c3aebb749cc473e3a9496be8fd61652b2
3
+ metadata.gz: ffff51d2ba87391b59163fab3e28e65c45c6bd4bbdcd00055aaebbe00e409937
4
+ data.tar.gz: 03da4383110a4a4342e007da66df17de7fc658a5b0490e669c969f5d92827cb5
5
5
  SHA512:
6
- metadata.gz: 7be9c56ed729037d9b2c557e9a349e4ba091226c2ff4caa2b37c8432bdf2c515f7343ce9cf744797d79681b8cbdf50e03584d91551da03aa82509884f151c461
7
- data.tar.gz: dcfd5b78ad9d722a040737f7b0c64718d55297821ebf1d0bb3e78bddb46939d9331bc772b2cd398b00cadf33daff49e69001d1618fb2ece3e167185282e3a379
6
+ metadata.gz: bee965c2c6bd5eebc756894c1eb6cfbb750c2b9a50e4b81f54af83fc2ac8916d4b76c49b98a95153c2f9e6a4447a4943ca195f4d3d555fde098d93cd3fb3899d
7
+ data.tar.gz: dec6c9a3b90fbc27d6389795d1836ea1b4d2c25428dd4b467f18879b550158754195fc068ce90ab400f9e8865033efa175d89629196d8572a405bafedf8ce5b4
@@ -19,7 +19,11 @@ module Danger
19
19
  #
20
20
  class AzurePipelines < CI
21
21
  def self.validates_as_ci?(env)
22
- env.key?("AGENT_ID") && env["BUILD_REPOSITORY_PROVIDER"] != "TfsGit"
22
+ # AGENT_ID is being used by AppCenter as well, so checking here to make sure AppCenter CI doesn't get a false positive for AzurePipelines
23
+ # Anyone working with AzurePipelines could provide a better/truly unique env key to avoid checking for AppCenter
24
+ !Danger::Appcenter::validates_as_ci?(env) &&
25
+ env.key?("AGENT_ID") &&
26
+ env["BUILD_REPOSITORY_PROVIDER"] != "TfsGit"
23
27
  end
24
28
 
25
29
  def self.validates_as_pr?(env)
@@ -0,0 +1,38 @@
1
+ module Danger
2
+ # ### CI Setup
3
+ #
4
+ # In order to work with Xcode Cloud and Danger, you will need to add `bundle exec danger` to
5
+ # the `ci_scripts/ci_post_xcodebuild.sh` (Xcode Cloud's expected filename for a post-action build script).
6
+ # More details and documentation on Xcode Cloud configuration can be found [here](https://developer.apple.com/documentation/xcode/writing-custom-build-scripts).
7
+ #
8
+ # ### Token Setup
9
+ #
10
+ # You will need to add the `DANGER_GITHUB_API_TOKEN` to your build environment.
11
+ # If running on GitHub Enterprise, make sure you also set the expected values for
12
+ # both `DANGER_GITHUB_API_HOST` and `DANGER_GITHUB_HOST`.
13
+ #
14
+ class XcodeCloud < CI
15
+ def self.validates_as_ci?(env)
16
+ env.key? "CI_XCODEBUILD_ACTION"
17
+ end
18
+
19
+ def self.validates_as_pr?(env)
20
+ env.key? "CI_PULL_REQUEST_NUMBER"
21
+ end
22
+
23
+ def supported_request_sources
24
+ @supported_request_sources ||= [
25
+ Danger::RequestSources::GitHub,
26
+ Danger::RequestSources::GitLab,
27
+ Danger::RequestSources::BitbucketCloud,
28
+ Danger::RequestSources::BitbucketServer
29
+ ]
30
+ end
31
+
32
+ def initialize(env)
33
+ self.repo_slug = env["CI_PULL_REQUEST_SOURCE_REPO"]
34
+ self.pull_request_id = env["CI_PULL_REQUEST_NUMBER"]
35
+ self.repo_url = env["CI_PULL_REQUEST_HTML_URL"]
36
+ end
37
+ end
38
+ end
@@ -139,6 +139,14 @@ module Danger
139
139
  @gitlab.mr_changes.changes
140
140
  end
141
141
 
142
+ # @!group MR Closes issues
143
+ # The array of issues that this MR closes
144
+ # @return [Array<Gitlab::ObjectifiedHash>]
145
+ #
146
+ def mr_closes_issues
147
+ @gitlab.mr_closes_issues
148
+ end
149
+
142
150
  # @!group MR Commit Metadata
143
151
  # The branch to which the MR is going to be merged into
144
152
  # @deprecated Please use {#branch_for_base} instead
@@ -148,7 +148,7 @@ module Danger
148
148
  def generate_description(warnings: nil, errors: nil, template: "github")
149
149
  emoji_mapper = EmojiMapper.new(template)
150
150
  if errors.empty? && warnings.empty?
151
- return "All green. #{random_compliment}"
151
+ return ENV['DANGER_SUCCESS_MESSAGE'] || "All green. #{random_compliment}"
152
152
  else
153
153
  message = "#{emoji_mapper.map('warning')} "
154
154
  message += "#{'Error'.danger_pluralize(errors.count)}. " unless errors.empty?
@@ -130,6 +130,12 @@ module Danger
130
130
  end
131
131
  end
132
132
 
133
+ def mr_closes_issues
134
+ @mr_closes_issues ||= begin
135
+ client.merge_request_closes_issues(ci_source.repo_slug, ci_source.pull_request_id)
136
+ end
137
+ end
138
+
133
139
  def setup_danger_branches
134
140
  # we can use a GitLab specific feature here:
135
141
  base_branch = self.mr_json.source_branch
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "8.3.1".freeze
2
+ VERSION = "8.4.0".freeze
3
3
  DESCRIPTION = "Like Unit Tests, but for your Team Culture.".freeze
4
4
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.3.1
4
+ version: 8.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox
8
8
  - Juanito Fatas
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-01 00:00:00.000000000 Z
12
+ date: 2021-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide
@@ -244,6 +244,7 @@ files:
244
244
  - lib/danger/ci_source/teamcity.rb
245
245
  - lib/danger/ci_source/travis.rb
246
246
  - lib/danger/ci_source/vsts.rb
247
+ - lib/danger/ci_source/xcode_cloud.rb
247
248
  - lib/danger/ci_source/xcode_server.rb
248
249
  - lib/danger/clients/rubygems_client.rb
249
250
  - lib/danger/commands/dangerfile/gem.rb
@@ -326,7 +327,7 @@ homepage: https://github.com/danger/danger
326
327
  licenses:
327
328
  - MIT
328
329
  metadata: {}
329
- post_install_message:
330
+ post_install_message:
330
331
  rdoc_options: []
331
332
  require_paths:
332
333
  - lib
@@ -341,8 +342,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
342
  - !ruby/object:Gem::Version
342
343
  version: '0'
343
344
  requirements: []
344
- rubygems_version: 3.1.2
345
- signing_key:
345
+ rubygems_version: 3.1.4
346
+ signing_key:
346
347
  specification_version: 4
347
348
  summary: Like Unit Tests, but for your Team Culture.
348
349
  test_files: []