danger 8.2.0 → 8.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/danger/ci_source/appcenter.rb +1 -1
- data/lib/danger/ci_source/appveyor.rb +3 -0
- data/lib/danger/ci_source/azure_pipelines.rb +1 -1
- data/lib/danger/ci_source/bitbucket_pipelines.rb +1 -0
- data/lib/danger/ci_source/buildkite.rb +1 -1
- data/lib/danger/ci_source/circle.rb +1 -1
- data/lib/danger/ci_source/concourse.rb +1 -1
- data/lib/danger/ci_source/drone.rb +2 -2
- data/lib/danger/ci_source/github_actions.rb +1 -1
- data/lib/danger/ci_source/gitlab_ci.rb +2 -0
- data/lib/danger/ci_source/screwdriver.rb +2 -1
- data/lib/danger/ci_source/teamcity.rb +2 -0
- data/lib/danger/commands/dry_run.rb +1 -1
- data/lib/danger/commands/init.rb +1 -1
- data/lib/danger/commands/local.rb +1 -1
- data/lib/danger/commands/local_helpers/pry_setup.rb +4 -4
- data/lib/danger/commands/pr.rb +1 -1
- data/lib/danger/commands/staging.rb +1 -1
- data/lib/danger/danger_core/plugins/dangerfile_bitbucket_cloud_plugin.rb +1 -1
- data/lib/danger/danger_core/plugins/dangerfile_danger_plugin.rb +21 -1
- data/lib/danger/request_sources/bitbucket_cloud_api.rb +2 -1
- data/lib/danger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3930680bc519ec86948df5375ea6ffad444929619c7faf3190e204eee827767b
|
4
|
+
data.tar.gz: 6ca8c826a895e9d0ef6bf66343e70110026a8a77fafddc6e72f26b129c37801d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0267983777b8a27f5d90f6221655d18657a0c4ed6276e475631e4984eabbe2f5329ec8df774100052dfd1e6368082b9865fd1bd87956b538fa032042f1e1538d'
|
7
|
+
data.tar.gz: 700097f2571dd5cb9cac5b9f74d034a53a00e73f747d3aa489cb9cae83b86b85908281a3c910bec25a2299fd828449c9eb82f796d8865f84a0742a46488d2dd3
|
data/README.md
CHANGED
@@ -3,6 +3,7 @@ module Danger
|
|
3
3
|
# ### CI Setup
|
4
4
|
#
|
5
5
|
# Install dependencies and add a danger step to your `appveyor.yml`.
|
6
|
+
#
|
6
7
|
# ```yaml
|
7
8
|
# install:
|
8
9
|
# - cmd: >-
|
@@ -19,6 +20,7 @@ module Danger
|
|
19
20
|
# For public repositories, add your plain token to environment variables in `appveyor.yml`.
|
20
21
|
# Encrypted environment variables will not be decrypted on PR builds.
|
21
22
|
# see here: https://www.appveyor.com/docs/build-configuration/#secure-variables
|
23
|
+
#
|
22
24
|
# ```yaml
|
23
25
|
# environment:
|
24
26
|
# DANGER_GITHUB_API_TOKEN: <YOUR_TOKEN_HERE>
|
@@ -26,6 +28,7 @@ module Danger
|
|
26
28
|
#
|
27
29
|
# For private repositories, enter your token in `Settings>Environment>Environment variables>Add variable` and turn on `variable encryption`.
|
28
30
|
# You will see encrypted variable text in `Settings>Export YAML` so just copy to your `appveyor.yml`.
|
31
|
+
#
|
29
32
|
# ```yaml
|
30
33
|
# environment:
|
31
34
|
# DANGER_GITHUB_API_TOKEN:
|
@@ -9,7 +9,7 @@ module Danger
|
|
9
9
|
# With BuildKite you run the server yourself, so you will want to run it as a part of your build process.
|
10
10
|
# It is common to have build steps, so we would recommend adding this to your scrip:
|
11
11
|
#
|
12
|
-
# ```
|
12
|
+
# ```shell
|
13
13
|
# echo "--- Running Danger"
|
14
14
|
# bundle exec danger
|
15
15
|
# ```
|
@@ -8,7 +8,7 @@ module Danger
|
|
8
8
|
# With Drone you run the docker images yourself, so you will want to add `bundle exec danger` at the end of
|
9
9
|
# your `.drone.yml`.
|
10
10
|
#
|
11
|
-
# ```
|
11
|
+
# ```shell
|
12
12
|
# build:
|
13
13
|
# image: golang
|
14
14
|
# commands:
|
@@ -24,7 +24,7 @@ module Danger
|
|
24
24
|
# Drone secrets: http://readme.drone.io/usage/secret-guide/
|
25
25
|
# NOTE: This is a new syntax in DroneCI 0.6+
|
26
26
|
#
|
27
|
-
# ```
|
27
|
+
# ```yml
|
28
28
|
# build:
|
29
29
|
# image: golang
|
30
30
|
# secrets:
|
@@ -7,6 +7,7 @@ module Danger
|
|
7
7
|
# ### CI Setup
|
8
8
|
#
|
9
9
|
# Install dependencies and add a danger step to your .gitlab-ci.yml:
|
10
|
+
#
|
10
11
|
# ```yml
|
11
12
|
# before_script:
|
12
13
|
# - bundle install
|
@@ -14,6 +15,7 @@ module Danger
|
|
14
15
|
# script:
|
15
16
|
# - bundle exec danger
|
16
17
|
# ```
|
18
|
+
#
|
17
19
|
# ### Token Setup
|
18
20
|
#
|
19
21
|
# Add the `DANGER_GITLAB_API_TOKEN` to your pipeline env variables if you
|
@@ -27,6 +27,7 @@ module Danger
|
|
27
27
|
# branch="%teamcity.build.branch%"
|
28
28
|
# export GITHUB_PULL_REQUEST_ID=(${branch//\// })
|
29
29
|
# ```
|
30
|
+
#
|
30
31
|
# Or if you are using the pull request feature you can set an environment parameter called `GITHUB_PULL_REQUEST_ID`
|
31
32
|
# to the value of: `%teamcity.pullRequest.number`
|
32
33
|
#
|
@@ -59,6 +60,7 @@ module Danger
|
|
59
60
|
#
|
60
61
|
# You will also need to set the `BITBUCKET_BRANCH_NAME` environment variable.
|
61
62
|
# TeamCity provides `%teamcity.build.branch%`, which you can use at the top of your Simple Command Runner:
|
63
|
+
#
|
62
64
|
# ```sh
|
63
65
|
# export BITBUCKET_BRANCH_NAME="%teamcity.build.branch%"
|
64
66
|
# ```
|
data/lib/danger/commands/init.rb
CHANGED
@@ -277,7 +277,7 @@ module Danger
|
|
277
277
|
ui.say "- You can look at the following Dangerfiles to get some more ideas:"
|
278
278
|
ui.pause 0.6
|
279
279
|
ui.link "https://github.com/danger/danger/blob/master/Dangerfile"
|
280
|
-
ui.link "https://github.com/artsy/eigen/blob/master/
|
280
|
+
ui.link "https://github.com/artsy/eigen/blob/master/dangerfile.ts"
|
281
281
|
ui.pause 1
|
282
282
|
end
|
283
283
|
|
@@ -4,9 +4,9 @@ module Danger
|
|
4
4
|
@cork = cork
|
5
5
|
end
|
6
6
|
|
7
|
-
def setup_pry(dangerfile_path)
|
7
|
+
def setup_pry(dangerfile_path, command)
|
8
8
|
return dangerfile_path if dangerfile_path.empty?
|
9
|
-
validate_pry_available
|
9
|
+
validate_pry_available(command)
|
10
10
|
FileUtils.cp dangerfile_path, DANGERFILE_COPY
|
11
11
|
File.open(DANGERFILE_COPY, "a") do |f|
|
12
12
|
f.write("\nbinding.pry; File.delete(\"#{DANGERFILE_COPY}\")")
|
@@ -20,10 +20,10 @@ module Danger
|
|
20
20
|
|
21
21
|
DANGERFILE_COPY = "_Dangerfile.tmp".freeze
|
22
22
|
|
23
|
-
def validate_pry_available
|
23
|
+
def validate_pry_available(command)
|
24
24
|
Kernel.require "pry"
|
25
25
|
rescue LoadError
|
26
|
-
cork.warn "Pry was not found, and is required for 'danger
|
26
|
+
cork.warn "Pry was not found, and is required for 'danger #{command} --pry'."
|
27
27
|
cork.print_warnings
|
28
28
|
abort
|
29
29
|
end
|
data/lib/danger/commands/pr.rb
CHANGED
@@ -37,7 +37,7 @@ module Danger
|
|
37
37
|
@dangerfile_path = dangerfile if File.exist?(dangerfile)
|
38
38
|
|
39
39
|
if argv.flag?("pry", false)
|
40
|
-
@dangerfile_path = PrySetup.new(cork).setup_pry(@dangerfile_path)
|
40
|
+
@dangerfile_path = PrySetup.new(cork).setup_pry(@dangerfile_path, PR.command)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -33,6 +33,11 @@ module Danger
|
|
33
33
|
#
|
34
34
|
# danger.import_dangerfile(github: "ruby-grape/danger", branch: "custom", path: "path/to/Dangerfile")
|
35
35
|
#
|
36
|
+
# @example Import a plugin available over HTTP
|
37
|
+
#
|
38
|
+
# custom_url = "https://custom.bitbucket.com/project-name/Dangerfile?raw"
|
39
|
+
# danger.import_dangerfile(url: custom_url)
|
40
|
+
#
|
36
41
|
# @see danger/danger
|
37
42
|
# @tags core, plugins
|
38
43
|
|
@@ -84,8 +89,10 @@ module Danger
|
|
84
89
|
import_dangerfile_from_path(opts[:path])
|
85
90
|
elsif opts.key?(:gem)
|
86
91
|
import_dangerfile_from_gem(opts[:gem])
|
92
|
+
elsif opts.key?(:url)
|
93
|
+
import_dangerfile_from_url(opts[:url])
|
87
94
|
else
|
88
|
-
raise "`import` requires a Hash with either :github, :gitlab, :gem, or :
|
95
|
+
raise "`import` requires a Hash with either :github, :gitlab, :gem, :path or :url"
|
89
96
|
end
|
90
97
|
else
|
91
98
|
raise "`import` requires a Hash"
|
@@ -180,6 +187,19 @@ module Danger
|
|
180
187
|
@dangerfile.parse(Pathname.new(local_path))
|
181
188
|
end
|
182
189
|
|
190
|
+
# @!group Danger
|
191
|
+
# Download and execute a remote Dangerfile.
|
192
|
+
#
|
193
|
+
# @param [String] url
|
194
|
+
# A https url where the Dangerfile is.
|
195
|
+
# @return [void]
|
196
|
+
#
|
197
|
+
def import_dangerfile_from_url(url)
|
198
|
+
raise "`import_dangerfile_from_url` requires a string" unless url.kind_of?(String)
|
199
|
+
local_path = download(url)
|
200
|
+
@dangerfile.parse(Pathname.new(local_path))
|
201
|
+
end
|
202
|
+
|
183
203
|
# @!group Plugins
|
184
204
|
# Download a local or remote plugin or Dangerfile.
|
185
205
|
# This method will not import the file for you, use plugin.import instead
|
@@ -57,7 +57,8 @@ module Danger
|
|
57
57
|
def fetch_comments
|
58
58
|
values = []
|
59
59
|
# TODO: use a url parts encoder to encode the query
|
60
|
-
|
60
|
+
corrected_uuid = @my_uuid[1...-1] if !@my_uuid.nil? # Endpoint doesnt support curly brackets for this, so remove them for this
|
61
|
+
uri = "#{pr_api_endpoint}/comments?pagelen=100&q=deleted+%7E+false+AND+user.uuid+%7E+%22#{corrected_uuid}%22"
|
61
62
|
|
62
63
|
while uri
|
63
64
|
json = fetch_json(URI(uri))
|
data/lib/danger/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.2.
|
4
|
+
version: 8.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Orta Therox
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-11-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|