danger 0.5.0 → 0.5.1
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/README.md +27 -10
- data/lib/danger/commands/init.rb +2 -2
- data/lib/danger/commands/runner.rb +1 -1
- data/lib/danger/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25ffbe9e81d58bb03a50c0813b2340802520b827
|
4
|
+
data.tar.gz: 11b7151376d9c471c80d522a81eb17a88c487e1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 744f9c2444f90270cb142684ba457a31f889d49031cb582526c6a3ad13b5b8e05a3c0320e79bff2d31a6b24767baa53c7aea45c3f33d95094944781189b9397e
|
7
|
+
data.tar.gz: b94a33faeb13e99218c602e18dca552eada52d22836cab057417d2e15e203254a634b8c2fc3a01822a3641d070d5d16e8d6743822d0f9b87166817263d5d8035
|
data/README.md
CHANGED
@@ -26,11 +26,19 @@ Add this line to your application's [Gemfile](https://guides.cocoapods.org/using
|
|
26
26
|
gem 'danger'
|
27
27
|
```
|
28
28
|
|
29
|
-
|
29
|
+
To get up and running quickly, just run
|
30
|
+
|
31
|
+
```
|
32
|
+
bundle exec danger init
|
33
|
+
```
|
30
34
|
|
31
35
|
## Usage on CI
|
32
36
|
|
33
|
-
|
37
|
+
```
|
38
|
+
bundle exec danger
|
39
|
+
```
|
40
|
+
|
41
|
+
This will look at your `Dangerfile` and update the pull request accordingly. While you are setting up Danger, you may want to use: `--verbose` for more debug information.
|
34
42
|
|
35
43
|
## What happens?
|
36
44
|
|
@@ -53,7 +61,7 @@ The `Dangerfile` is a ruby file, so really, you can do anything. However, at thi
|
|
53
61
|
|
54
62
|
#### Dealing with WIP pull requests
|
55
63
|
|
56
|
-
```
|
64
|
+
```ruby
|
57
65
|
# Sometimes its a README fix, or something like that - which isn't relevant for
|
58
66
|
# including in a CHANGELOG for example
|
59
67
|
declared_trivial = pr_title.include? "#trivial"
|
@@ -72,28 +80,32 @@ fail("Developer Specific file shouldn't be changed") if files_modified.include?(
|
|
72
80
|
made_analytics_changes = files_modified.include?("/Artsy/App/ARAppDelegate+Analytics.m")
|
73
81
|
made_analytics_specs_changes = files_modified.include?("/Artsy_Tests/Analytics_Tests/ARAppAnalyticsSpec.m")
|
74
82
|
if made_analytics_changes
|
75
|
-
|
83
|
+
fail("Analytics changes should have reflected specs changes") if !made_analytics_specs_changes
|
76
84
|
|
77
|
-
|
78
|
-
|
79
|
-
|
85
|
+
# And pay extra attention anyway
|
86
|
+
message('Analytics dict changed, double check for ?: `@""` on new entries')
|
87
|
+
message('Also, double check the [Analytics Eigen schema](https://docs.google.com/spreadsheets/u/1/d/1bLbeOgVFaWzLSjxLOBDNOKs757-zBGoLSM1lIz3OPiI/edit#gid=497747862) if the changes are non-trivial.')
|
80
88
|
end
|
81
89
|
```
|
82
90
|
|
83
91
|
#### Pinging people when a specific file has changed
|
84
92
|
|
85
|
-
```
|
93
|
+
```ruby
|
86
94
|
message("@orta something changed in elan!") if files_modified.include? "/components/lib/variables/colors.json"
|
87
95
|
```
|
88
96
|
|
89
97
|
#### Exposing aspects of CI logs into the PR discussion
|
90
98
|
|
91
|
-
```
|
92
|
-
build_log = File.read(
|
99
|
+
```ruby
|
100
|
+
build_log = File.read(File.join(ENV["CIRCLE_ARTIFACTS"], "xcode_test_raw.log"))
|
93
101
|
snapshots_url = build_log.match(%r{https://eigen-ci.s3.amazonaws.com/\d+/index.html})
|
94
102
|
fail("There were [snapshot errors](#{snapshots_url})") if snapshots_url
|
95
103
|
```
|
96
104
|
|
105
|
+
## Support
|
106
|
+
|
107
|
+
Danger currently is supported on Travis CI, Circle CI, BuildKite and Jenkins. These work via environment variables, so it's easy to extend to include your own.
|
108
|
+
|
97
109
|
## Advanced
|
98
110
|
|
99
111
|
You can access more detailed information by accessing the following variables
|
@@ -104,6 +116,9 @@ You can access more detailed information by accessing the following variables
|
|
104
116
|
`env.scm.diff` | The full [Diff](https://github.com/mojombo/grit/blob/master/lib/grit/diff.rb) file for the diff.
|
105
117
|
`env.ci_source` | To get information like the repo slug or pull request ID
|
106
118
|
|
119
|
+
These are considered implementation details though, and may be subject to change in future releases. We're very
|
120
|
+
open to turning useful bits into the official API.
|
121
|
+
|
107
122
|
## Test locally with `danger local`
|
108
123
|
|
109
124
|
Using `danger local` will look for the last merged pull request in your git history, and apply your current
|
@@ -114,6 +129,8 @@ Using `danger local` will look for the last merged pull request in your git hist
|
|
114
129
|
* You can set the base branch in the command line arguments see: `bundle exec danger --help`, if you commonly merge into non-master branches.
|
115
130
|
* Appending `--verbose` to `bundle exec danger` will expose all of the variables that Danger provides, and their values in the shell.
|
116
131
|
|
132
|
+
Here are some real-world Dangerfiles: [artsy/eigen](https://github.com/artsy/eigen/blob/master/Dangerfile), [danger/danger](https://github.com/danger/danger/blob/master/Dangerfile), [artsy/elan](https://github.com/artsy/elan/blob/master/Dangerfile) and more!
|
133
|
+
|
117
134
|
## License, Contributor's Guidelines and Code of Conduct
|
118
135
|
|
119
136
|
> This project is open source under the MIT license, which means you have full access to the source code and can modify it to fit your own needs.
|
data/lib/danger/commands/init.rb
CHANGED
@@ -231,7 +231,7 @@ module Danger
|
|
231
231
|
end
|
232
232
|
|
233
233
|
ui.say "In order to expose an environment variable, go to:"
|
234
|
-
ui.link "https://circleci.com/gh/#{
|
234
|
+
ui.link "https://circleci.com/gh/#{current_repo_slug}/edit#env-vars"
|
235
235
|
ui.say "The name is " + "DANGER_GITHUB_API_TOKEN".yellow + " and the value is the GitHub Personal Acess Token."
|
236
236
|
end
|
237
237
|
|
@@ -262,7 +262,7 @@ module Danger
|
|
262
262
|
ui.pause 0.6
|
263
263
|
|
264
264
|
ui.say "And you're set. Danger is a collaboration between Orta Therox, Gem 'Danger' McShane and Felix Krause."
|
265
|
-
ui.say "If you like it, let others know. If you want to know more, follow " + "@orta".yellow + " and " + "@
|
265
|
+
ui.say "If you like it, let others know. If you want to know more, follow " + "@orta".yellow + " and " + "@KrauseFx".yellow + " on Twitter."
|
266
266
|
ui.say "If you don't like it, help us improve it! xxx"
|
267
267
|
end
|
268
268
|
end
|
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: 0.5.
|
4
|
+
version: 0.5.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: 2016-02-
|
12
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|
@@ -248,8 +248,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
version: '0'
|
249
249
|
requirements: []
|
250
250
|
rubyforge_project:
|
251
|
-
rubygems_version: 2.
|
251
|
+
rubygems_version: 2.2.2
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: Automate your PR etiquette.
|
255
255
|
test_files: []
|
256
|
+
has_rdoc:
|