danger 8.3.1 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/danger/ci_source/azure_pipelines.rb +5 -1
- data/lib/danger/ci_source/xcode_cloud.rb +38 -0
- data/lib/danger/danger_core/plugins/dangerfile_gitlab_plugin.rb +8 -0
- data/lib/danger/helpers/comments_helper.rb +1 -1
- data/lib/danger/request_sources/gitlab.rb +6 -0
- data/lib/danger/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffff51d2ba87391b59163fab3e28e65c45c6bd4bbdcd00055aaebbe00e409937
|
4
|
+
data.tar.gz: 03da4383110a4a4342e007da66df17de7fc658a5b0490e669c969f5d92827cb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/danger/version.rb
CHANGED
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.
|
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-
|
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.
|
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: []
|