danger-gitlab_graph 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.bundle/config +2 -0
- data/.gitignore +5 -0
- data/.rubocop.yml +148 -0
- data/.tool-versions +1 -0
- data/.travis.yml +10 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +175 -0
- data/Guardfile +21 -0
- data/LICENSE.txt +22 -0
- data/README.md +20 -0
- data/Rakefile +25 -0
- data/danger-gitlab_graph.gemspec +51 -0
- data/lib/danger_gitlab_graph.rb +3 -0
- data/lib/danger_plugin.rb +3 -0
- data/lib/gitlab_graph/gem_version.rb +5 -0
- data/lib/gitlab_graph/plugin.rb +91 -0
- data/spec/gitlab_graph_spec.rb +44 -0
- data/spec/spec_helper.rb +64 -0
- data/spec/support/fixtures/github_pr.json +277 -0
- metadata +220 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b22267bbd08ea047510e711c2e7e94df78c4a36935f58285bbbb38f36026c5db
|
4
|
+
data.tar.gz: faec3d4ebc51300200010473a885a8b4f80e3258946746a7363b2c78245a4d9b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 91aecc44d1c12f48ba78c8b4f26fe7c1c19ed8a19f95dbcae67eba5109b75503acdda2a32d18ef6941e5245f6c9614686f1cb663464b152fccbf01949eeaebb7
|
7
|
+
data.tar.gz: fddd42925cb4c47fd90317fd85d0bb4591434e38cb67dee44925ee2b21b9eca4e51adb6accc15583b0f51b91a041507fbaae5207181e023120e68c573f55d6ce
|
data/.bundle/config
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
# Defaults can be found here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
|
2
|
+
|
3
|
+
# If you don't like these settings, just delete this file :)
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
TargetRubyVersion: 2.7
|
7
|
+
|
8
|
+
Style/StringLiterals:
|
9
|
+
EnforcedStyle: double_quotes
|
10
|
+
Enabled: true
|
11
|
+
|
12
|
+
# kind_of? is a good way to check a type
|
13
|
+
Style/ClassCheck:
|
14
|
+
EnforcedStyle: kind_of?
|
15
|
+
|
16
|
+
# specs sometimes have useless assignments, which is fine
|
17
|
+
Lint/UselessAssignment:
|
18
|
+
Exclude:
|
19
|
+
- '**/spec/**/*'
|
20
|
+
|
21
|
+
# We could potentially enable the 2 below:
|
22
|
+
Layout/FirstHashElementIndentation:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Layout/HashAlignment:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
# HoundCI doesn't like this rule
|
29
|
+
Layout/DotPosition:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
# We allow !! as it's an easy way to convert ot boolean
|
33
|
+
Style/DoubleNegation:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
# Cop supports --auto-correct.
|
37
|
+
Lint/UnusedBlockArgument:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
# We want to allow class Fastlane::Class
|
41
|
+
Style/ClassAndModuleChildren:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Metrics/AbcSize:
|
45
|
+
Max: 60
|
46
|
+
|
47
|
+
# The %w might be confusing for new users
|
48
|
+
Style/WordArray:
|
49
|
+
MinSize: 19
|
50
|
+
|
51
|
+
# raise and fail are both okay
|
52
|
+
Style/SignalException:
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
# Better too much 'return' than one missing
|
56
|
+
Style/RedundantReturn:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
# Having if in the same line might not always be good
|
60
|
+
Style/IfUnlessModifier:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
# and and or is okay
|
64
|
+
Style/AndOr:
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
# Configuration parameters: CountComments.
|
68
|
+
Metrics/ClassLength:
|
69
|
+
Max: 350
|
70
|
+
|
71
|
+
Metrics/CyclomaticComplexity:
|
72
|
+
Max: 17
|
73
|
+
|
74
|
+
# Configuration parameters: AllowURI, URISchemes.
|
75
|
+
Layout/LineLength:
|
76
|
+
Max: 370
|
77
|
+
|
78
|
+
# Configuration parameters: CountKeywordArgs.
|
79
|
+
Metrics/ParameterLists:
|
80
|
+
Max: 10
|
81
|
+
|
82
|
+
Metrics/PerceivedComplexity:
|
83
|
+
Max: 18
|
84
|
+
|
85
|
+
# Sometimes it's easier to read without guards
|
86
|
+
Style/GuardClause:
|
87
|
+
Enabled: false
|
88
|
+
|
89
|
+
# something = if something_else
|
90
|
+
# that's confusing
|
91
|
+
Style/ConditionalAssignment:
|
92
|
+
Enabled: false
|
93
|
+
|
94
|
+
# Better to have too much self than missing a self
|
95
|
+
Style/RedundantSelf:
|
96
|
+
Enabled: false
|
97
|
+
|
98
|
+
Metrics/MethodLength:
|
99
|
+
Max: 60
|
100
|
+
|
101
|
+
# We're not there yet
|
102
|
+
Style/Documentation:
|
103
|
+
Enabled: false
|
104
|
+
|
105
|
+
# Adds complexity
|
106
|
+
Style/IfInsideElse:
|
107
|
+
Enabled: false
|
108
|
+
|
109
|
+
# danger specific
|
110
|
+
|
111
|
+
Style/BlockComments:
|
112
|
+
Enabled: false
|
113
|
+
|
114
|
+
Layout/MultilineMethodCallIndentation:
|
115
|
+
EnforcedStyle: indented
|
116
|
+
|
117
|
+
# FIXME: 25
|
118
|
+
Metrics/BlockLength:
|
119
|
+
Max: 345
|
120
|
+
Exclude:
|
121
|
+
- "**/*_spec.rb"
|
122
|
+
|
123
|
+
Style/MixinGrouping:
|
124
|
+
Enabled: false
|
125
|
+
|
126
|
+
Naming/FileName:
|
127
|
+
Enabled: false
|
128
|
+
|
129
|
+
Layout/HeredocIndentation:
|
130
|
+
Enabled: false
|
131
|
+
|
132
|
+
Style/SpecialGlobalVars:
|
133
|
+
Enabled: false
|
134
|
+
|
135
|
+
Style/PercentLiteralDelimiters:
|
136
|
+
PreferredDelimiters:
|
137
|
+
"%": ()
|
138
|
+
"%i": ()
|
139
|
+
"%q": ()
|
140
|
+
"%Q": ()
|
141
|
+
"%r": "{}"
|
142
|
+
"%s": ()
|
143
|
+
"%w": ()
|
144
|
+
"%W": ()
|
145
|
+
"%x": ()
|
146
|
+
|
147
|
+
Security/YAMLLoad:
|
148
|
+
Enabled: false
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.7.6
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
danger-gitlab_graph (0.0.3)
|
5
|
+
danger-plugin-api (~> 1.0)
|
6
|
+
svg-graph (~> 2.2.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
addressable (2.8.1)
|
12
|
+
public_suffix (>= 2.0.2, < 6.0)
|
13
|
+
ast (2.4.2)
|
14
|
+
claide (1.1.0)
|
15
|
+
claide-plugins (0.9.2)
|
16
|
+
cork
|
17
|
+
nap
|
18
|
+
open4 (~> 1.3)
|
19
|
+
coderay (1.1.3)
|
20
|
+
colored2 (3.1.2)
|
21
|
+
cork (0.3.0)
|
22
|
+
colored2 (~> 3.1)
|
23
|
+
danger (9.0.0)
|
24
|
+
claide (~> 1.0)
|
25
|
+
claide-plugins (>= 0.9.2)
|
26
|
+
colored2 (~> 3.1)
|
27
|
+
cork (~> 0.1)
|
28
|
+
faraday (>= 0.9.0, < 2.0)
|
29
|
+
faraday-http-cache (~> 2.0)
|
30
|
+
git (~> 1.7)
|
31
|
+
kramdown (~> 2.3)
|
32
|
+
kramdown-parser-gfm (~> 1.0)
|
33
|
+
no_proxy_fix
|
34
|
+
octokit (~> 5.0)
|
35
|
+
terminal-table (>= 1, < 4)
|
36
|
+
danger-plugin-api (1.0.0)
|
37
|
+
danger (> 2.0)
|
38
|
+
diff-lcs (1.5.0)
|
39
|
+
faraday (1.10.2)
|
40
|
+
faraday-em_http (~> 1.0)
|
41
|
+
faraday-em_synchrony (~> 1.0)
|
42
|
+
faraday-excon (~> 1.1)
|
43
|
+
faraday-httpclient (~> 1.0)
|
44
|
+
faraday-multipart (~> 1.0)
|
45
|
+
faraday-net_http (~> 1.0)
|
46
|
+
faraday-net_http_persistent (~> 1.0)
|
47
|
+
faraday-patron (~> 1.0)
|
48
|
+
faraday-rack (~> 1.0)
|
49
|
+
faraday-retry (~> 1.0)
|
50
|
+
ruby2_keywords (>= 0.0.4)
|
51
|
+
faraday-em_http (1.0.0)
|
52
|
+
faraday-em_synchrony (1.0.0)
|
53
|
+
faraday-excon (1.1.0)
|
54
|
+
faraday-http-cache (2.4.1)
|
55
|
+
faraday (>= 0.8)
|
56
|
+
faraday-httpclient (1.0.1)
|
57
|
+
faraday-multipart (1.0.4)
|
58
|
+
multipart-post (~> 2)
|
59
|
+
faraday-net_http (1.0.1)
|
60
|
+
faraday-net_http_persistent (1.2.0)
|
61
|
+
faraday-patron (1.0.0)
|
62
|
+
faraday-rack (1.0.0)
|
63
|
+
faraday-retry (1.0.3)
|
64
|
+
ffi (1.15.5)
|
65
|
+
formatador (1.1.0)
|
66
|
+
git (1.12.0)
|
67
|
+
addressable (~> 2.8)
|
68
|
+
rchardet (~> 1.8)
|
69
|
+
guard (2.18.0)
|
70
|
+
formatador (>= 0.2.4)
|
71
|
+
listen (>= 2.7, < 4.0)
|
72
|
+
lumberjack (>= 1.0.12, < 2.0)
|
73
|
+
nenv (~> 0.1)
|
74
|
+
notiffany (~> 0.0)
|
75
|
+
pry (>= 0.13.0)
|
76
|
+
shellany (~> 0.0)
|
77
|
+
thor (>= 0.18.1)
|
78
|
+
guard-compat (1.2.1)
|
79
|
+
guard-rspec (4.7.3)
|
80
|
+
guard (~> 2.1)
|
81
|
+
guard-compat (~> 1.1)
|
82
|
+
rspec (>= 2.99.0, < 4.0)
|
83
|
+
json (2.6.2)
|
84
|
+
kramdown (2.4.0)
|
85
|
+
rexml
|
86
|
+
kramdown-parser-gfm (1.1.0)
|
87
|
+
kramdown (~> 2.0)
|
88
|
+
listen (3.0.7)
|
89
|
+
rb-fsevent (>= 0.9.3)
|
90
|
+
rb-inotify (>= 0.9.7)
|
91
|
+
lumberjack (1.2.8)
|
92
|
+
method_source (1.0.0)
|
93
|
+
multipart-post (2.2.3)
|
94
|
+
nap (1.1.0)
|
95
|
+
nenv (0.3.0)
|
96
|
+
no_proxy_fix (0.1.2)
|
97
|
+
notiffany (0.1.3)
|
98
|
+
nenv (~> 0.1)
|
99
|
+
shellany (~> 0.0)
|
100
|
+
octokit (5.6.1)
|
101
|
+
faraday (>= 1, < 3)
|
102
|
+
sawyer (~> 0.9)
|
103
|
+
open4 (1.3.4)
|
104
|
+
parallel (1.22.1)
|
105
|
+
parser (3.1.2.1)
|
106
|
+
ast (~> 2.4.1)
|
107
|
+
pry (0.14.1)
|
108
|
+
coderay (~> 1.1)
|
109
|
+
method_source (~> 1.0)
|
110
|
+
public_suffix (5.0.0)
|
111
|
+
rainbow (3.1.1)
|
112
|
+
rake (10.5.0)
|
113
|
+
rb-fsevent (0.11.2)
|
114
|
+
rb-inotify (0.10.1)
|
115
|
+
ffi (~> 1.0)
|
116
|
+
rchardet (1.8.0)
|
117
|
+
regexp_parser (2.6.0)
|
118
|
+
rexml (3.2.5)
|
119
|
+
rspec (3.11.0)
|
120
|
+
rspec-core (~> 3.11.0)
|
121
|
+
rspec-expectations (~> 3.11.0)
|
122
|
+
rspec-mocks (~> 3.11.0)
|
123
|
+
rspec-core (3.11.0)
|
124
|
+
rspec-support (~> 3.11.0)
|
125
|
+
rspec-expectations (3.11.1)
|
126
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
127
|
+
rspec-support (~> 3.11.0)
|
128
|
+
rspec-mocks (3.11.1)
|
129
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
130
|
+
rspec-support (~> 3.11.0)
|
131
|
+
rspec-support (3.11.1)
|
132
|
+
rubocop (1.36.0)
|
133
|
+
json (~> 2.3)
|
134
|
+
parallel (~> 1.10)
|
135
|
+
parser (>= 3.1.2.1)
|
136
|
+
rainbow (>= 2.2.2, < 4.0)
|
137
|
+
regexp_parser (>= 1.8, < 3.0)
|
138
|
+
rexml (>= 3.2.5, < 4.0)
|
139
|
+
rubocop-ast (>= 1.20.1, < 2.0)
|
140
|
+
ruby-progressbar (~> 1.7)
|
141
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
142
|
+
rubocop-ast (1.21.0)
|
143
|
+
parser (>= 3.1.1.0)
|
144
|
+
ruby-progressbar (1.11.0)
|
145
|
+
ruby2_keywords (0.0.5)
|
146
|
+
sawyer (0.9.2)
|
147
|
+
addressable (>= 2.3.5)
|
148
|
+
faraday (>= 0.17.3, < 3)
|
149
|
+
shellany (0.0.1)
|
150
|
+
svg-graph (2.2.1)
|
151
|
+
terminal-table (3.0.2)
|
152
|
+
unicode-display_width (>= 1.1.1, < 3)
|
153
|
+
thor (1.2.1)
|
154
|
+
unicode-display_width (2.3.0)
|
155
|
+
webrick (1.7.0)
|
156
|
+
yard (0.9.28)
|
157
|
+
webrick (~> 1.7.0)
|
158
|
+
|
159
|
+
PLATFORMS
|
160
|
+
x86_64-linux
|
161
|
+
|
162
|
+
DEPENDENCIES
|
163
|
+
bundler (~> 2.0)
|
164
|
+
danger-gitlab_graph!
|
165
|
+
guard (~> 2.14)
|
166
|
+
guard-rspec (~> 4.7)
|
167
|
+
listen (= 3.0.7)
|
168
|
+
pry
|
169
|
+
rake (~> 10.0)
|
170
|
+
rspec (~> 3.4)
|
171
|
+
rubocop
|
172
|
+
yard
|
173
|
+
|
174
|
+
BUNDLED WITH
|
175
|
+
2.3.22
|
data/Guardfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# A guardfile for making Danger Plugins
|
4
|
+
# For more info see https://github.com/guard/guard#readme
|
5
|
+
|
6
|
+
# To run, use `bundle exec guard`.
|
7
|
+
|
8
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
9
|
+
require "guard/rspec/dsl"
|
10
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
11
|
+
|
12
|
+
# RSpec files
|
13
|
+
rspec = dsl.rspec
|
14
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
15
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
16
|
+
watch(rspec.spec_files)
|
17
|
+
|
18
|
+
# Ruby files
|
19
|
+
ruby = dsl.ruby
|
20
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
21
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2022 Jan Beckmann <king-jan1999@hotmail.de>
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# danger-gitlab_graph
|
2
|
+
|
3
|
+
A description of danger-gitlab_graph.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
$ gem install danger-gitlab_graph
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
Methods and attributes from this plugin are available in
|
12
|
+
your `Dangerfile` under the `gitlab_graph` namespace.
|
13
|
+
|
14
|
+
## Development
|
15
|
+
|
16
|
+
1. Clone this repo
|
17
|
+
2. Run `bundle install` to setup dependencies.
|
18
|
+
3. Run `bundle exec rake spec` to run the tests.
|
19
|
+
4. Use `bundle exec guard` to automatically have tests run as you make changes.
|
20
|
+
5. Make your changes.
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
require "rubocop/rake_task"
|
6
|
+
|
7
|
+
RSpec::Core::RakeTask.new(:specs)
|
8
|
+
|
9
|
+
task default: :specs
|
10
|
+
|
11
|
+
task :spec do
|
12
|
+
Rake::Task["specs"].invoke
|
13
|
+
Rake::Task["rubocop"].invoke
|
14
|
+
Rake::Task["spec_docs"].invoke
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run RuboCop on the lib/specs directory"
|
18
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
19
|
+
task.patterns = ["lib/**/*.rb", "spec/**/*.rb"]
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Ensure that the plugin passes `danger plugins lint`"
|
23
|
+
task :spec_docs do
|
24
|
+
sh "bundle exec danger plugins lint"
|
25
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require "gitlab_graph/gem_version"
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "danger-gitlab_graph"
|
9
|
+
spec.version = GitlabGraph::VERSION
|
10
|
+
spec.authors = ["Jan Beckmann"]
|
11
|
+
spec.email = ["king-jan1999@hotmail.de"]
|
12
|
+
spec.description = "Danger plugin for creating graph from ci metrics."
|
13
|
+
spec.summary = "Danger plugin which allows you to extract and visualize metrics over previous ci runs."
|
14
|
+
spec.homepage = "https://github.com/kingjan1999/danger-gitlab_graph"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files`.split($/)
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_runtime_dependency "danger-plugin-api", "~> 1.0"
|
23
|
+
spec.add_runtime_dependency "svg-graph", "~> 2.2.1"
|
24
|
+
|
25
|
+
# General ruby development
|
26
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
|
29
|
+
# Testing support
|
30
|
+
spec.add_development_dependency "rspec", "~> 3.4"
|
31
|
+
|
32
|
+
# Linting code and docs
|
33
|
+
spec.add_development_dependency "rubocop"
|
34
|
+
spec.add_development_dependency "yard"
|
35
|
+
|
36
|
+
# Makes testing easy via `bundle exec guard`
|
37
|
+
spec.add_development_dependency "guard", "~> 2.14"
|
38
|
+
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
39
|
+
|
40
|
+
# If you want to work on older builds of ruby
|
41
|
+
spec.add_development_dependency "listen", "3.0.7"
|
42
|
+
|
43
|
+
# This gives you the chance to run a REPL inside your tests
|
44
|
+
# via:
|
45
|
+
#
|
46
|
+
# require 'pry'
|
47
|
+
# binding.pry
|
48
|
+
#
|
49
|
+
# This will stop test execution and let you inspect the results
|
50
|
+
spec.add_development_dependency "pry"
|
51
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'svggraph'
|
3
|
+
|
4
|
+
module Danger
|
5
|
+
# This plugin retrieves a certain metric from previous job runs and displays them as a graph
|
6
|
+
#
|
7
|
+
# @example Extract values from job "test" with the given regex
|
8
|
+
#
|
9
|
+
# gitlab_graph.report_metric(/performance: ([0-9]+)s/, "test")
|
10
|
+
#
|
11
|
+
# @see kingjan1999/danger-gitlab_graph
|
12
|
+
# @tags gitlab, graph, performance
|
13
|
+
#
|
14
|
+
class DangerGitlabGraph < Plugin
|
15
|
+
# Creates and comments a graph based on a certain metric, extracted via regex
|
16
|
+
# @return [Array<String>]
|
17
|
+
#
|
18
|
+
def report_metric(extraction_regex, job_name, prev_pipeline_count = 10, graph_options = {})
|
19
|
+
pipeline_id = ENV["CI_PIPELINE_ID"]
|
20
|
+
project_id = ENV["CI_PROJECT_ID"]
|
21
|
+
|
22
|
+
target_branch = gitlab.branch_for_merge
|
23
|
+
|
24
|
+
_, new_metric = extract_metric_from_pipeline(project_id, pipeline_id, extraction_regex, job_name)
|
25
|
+
unless new_metric
|
26
|
+
warn("No updated metric found for job #{job_name}")
|
27
|
+
return
|
28
|
+
end
|
29
|
+
|
30
|
+
previous_target_branch_pipelines = gitlab.api.pipelines(project_id, {
|
31
|
+
status: 'success',
|
32
|
+
ref: target_branch,
|
33
|
+
per_page: prev_pipeline_count
|
34
|
+
})
|
35
|
+
|
36
|
+
previous_metrics = previous_target_branch_pipelines.collect { |pipeline| extract_metric_from_pipeline(project_id, pipeline.id, extraction_regex, job_name) }
|
37
|
+
previous_metrics = previous_metrics.select { |val| val[1] }
|
38
|
+
# create graph
|
39
|
+
|
40
|
+
data = previous_metrics.collect { |val| val[1] }
|
41
|
+
data = data + [new_metric]
|
42
|
+
|
43
|
+
fields = previous_metrics.collect { |pipeline| "Run #{pipeline[0]}" }
|
44
|
+
fields += [pipeline_id]
|
45
|
+
|
46
|
+
default_graph_options = {
|
47
|
+
:width => 640,
|
48
|
+
:height => 480,
|
49
|
+
:graph_title => "Performance Metric",
|
50
|
+
:show_graph_title => true,
|
51
|
+
:x_title => "Pipeline Runs",
|
52
|
+
:y_title => "Metric Value",
|
53
|
+
:show_y_title => true,
|
54
|
+
:show_x_title => true,
|
55
|
+
:number_format => "%.2fs",
|
56
|
+
:fields => fields
|
57
|
+
}
|
58
|
+
|
59
|
+
g = SVG::Graph::Line.new(default_graph_options.merge(graph_options))
|
60
|
+
|
61
|
+
g.add_data(:data => data)
|
62
|
+
|
63
|
+
temp_file = Tempfile.new(%w[graph .svg])
|
64
|
+
begin
|
65
|
+
temp_file.write(g.burn_svg_only)
|
66
|
+
uploaded_file = gitlab.api.upload_file(project_id, temp_file.path)
|
67
|
+
markdown(uploaded_file.markdown)
|
68
|
+
ensure
|
69
|
+
temp_file.close
|
70
|
+
temp_file.unlink
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
def extract_metric_from_pipeline(project_id, pipeline_id, extraction_regex, job_name)
|
77
|
+
all_jobs = gitlab.api.pipeline_jobs(project_id, pipeline_id)
|
78
|
+
target_job = all_jobs.find { |x| x.name == job_name }
|
79
|
+
return false unless target_job
|
80
|
+
|
81
|
+
job_trace = gitlab.api.job_trace(project_id, target_job.id)
|
82
|
+
|
83
|
+
metric_matches = job_trace.match(extraction_regex)
|
84
|
+
unless metric_matches.captures
|
85
|
+
return pipeline_id, false
|
86
|
+
end
|
87
|
+
|
88
|
+
[pipeline_id, metric_matches.captures[0].to_f]
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path("spec_helper", __dir__)
|
4
|
+
|
5
|
+
module Danger
|
6
|
+
describe Danger::DangerGitlabGraph do
|
7
|
+
it "should be a plugin" do
|
8
|
+
expect(Danger::DangerGitlabGraph.new(nil)).to be_a Danger::Plugin
|
9
|
+
end
|
10
|
+
|
11
|
+
#
|
12
|
+
# You should test your custom attributes and methods here
|
13
|
+
#
|
14
|
+
describe "with Dangerfile" do
|
15
|
+
before do
|
16
|
+
@dangerfile = testing_dangerfile
|
17
|
+
@my_plugin = @dangerfile.gitlab_graph
|
18
|
+
|
19
|
+
allow(@my_plugin.gitlab).to receive(:api).and_return(json)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Some examples for writing tests
|
23
|
+
# You should replace these with your own.
|
24
|
+
|
25
|
+
it "Warns on a monday" do
|
26
|
+
monday_date = Date.parse("2016-07-11")
|
27
|
+
allow(Date).to receive(:today).and_return monday_date
|
28
|
+
|
29
|
+
@my_plugin.warn_on_mondays
|
30
|
+
|
31
|
+
expect(@dangerfile.status_report[:warnings]).to eq(["Trying to merge code on a Monday"])
|
32
|
+
end
|
33
|
+
|
34
|
+
it "Does nothing on a tuesday" do
|
35
|
+
monday_date = Date.parse("2016-07-12")
|
36
|
+
allow(Date).to receive(:today).and_return monday_date
|
37
|
+
|
38
|
+
@my_plugin.warn_on_mondays
|
39
|
+
|
40
|
+
expect(@dangerfile.status_report[:warnings]).to eq([])
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "pathname"
|
4
|
+
ROOT = Pathname.new(File.expand_path("..", __dir__))
|
5
|
+
$:.unshift("#{ROOT}lib".to_s)
|
6
|
+
$:.unshift("#{ROOT}spec".to_s)
|
7
|
+
|
8
|
+
require "bundler/setup"
|
9
|
+
require "pry"
|
10
|
+
|
11
|
+
require "rspec"
|
12
|
+
require "danger"
|
13
|
+
|
14
|
+
if `git remote -v` == ""
|
15
|
+
puts "You cannot run tests without setting a local git remote on this repo"
|
16
|
+
puts "It's a weird side-effect of Danger's internals."
|
17
|
+
exit(0)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Use coloured output, it's the best.
|
21
|
+
RSpec.configure do |config|
|
22
|
+
config.filter_gems_from_backtrace "bundler"
|
23
|
+
config.color = true
|
24
|
+
config.tty = true
|
25
|
+
end
|
26
|
+
|
27
|
+
require "danger_plugin"
|
28
|
+
|
29
|
+
# These functions are a subset of https://github.com/danger/danger/blob/master/spec/spec_helper.rb
|
30
|
+
# If you are expanding these files, see if it's already been done ^.
|
31
|
+
|
32
|
+
# A silent version of the user interface,
|
33
|
+
# it comes with an extra function `.string` which will
|
34
|
+
# strip all ANSI colours from the string.
|
35
|
+
|
36
|
+
# rubocop:disable Lint/NestedMethodDefinition
|
37
|
+
def testing_ui
|
38
|
+
@output = StringIO.new
|
39
|
+
def @output.winsize
|
40
|
+
[20, 9999]
|
41
|
+
end
|
42
|
+
|
43
|
+
cork = Cork::Board.new(out: @output)
|
44
|
+
def cork.string
|
45
|
+
out.string.gsub(/\e\[([;\d]+)?m/, "")
|
46
|
+
end
|
47
|
+
cork
|
48
|
+
end
|
49
|
+
# rubocop:enable Lint/NestedMethodDefinition
|
50
|
+
|
51
|
+
# Example environment (ENV) that would come from
|
52
|
+
# running a PR on TravisCI
|
53
|
+
def testing_env
|
54
|
+
{
|
55
|
+
"CI_PIPELINE_ID" => "12346",
|
56
|
+
"CI_PROJECT_ID" => "123"
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
# A stubbed out Dangerfile for use in tests
|
61
|
+
def testing_dangerfile
|
62
|
+
env = Danger::EnvironmentManager.new(testing_env)
|
63
|
+
Danger::Dangerfile.new(env, testing_ui)
|
64
|
+
end
|
@@ -0,0 +1,277 @@
|
|
1
|
+
{
|
2
|
+
"url": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18",
|
3
|
+
"id": 185317229,
|
4
|
+
"node_id": "MDExOlB1bGxSZXF1ZXN0MTg1MzE3MjI5",
|
5
|
+
"html_url": "https://github.com/danger/danger-plugin-template/pull/18",
|
6
|
+
"diff_url": "https://github.com/danger/danger-plugin-template/pull/18.diff",
|
7
|
+
"patch_url": "https://github.com/danger/danger-plugin-template/pull/18.patch",
|
8
|
+
"issue_url": "https://api.github.com/repos/danger/danger-plugin-template/issues/18",
|
9
|
+
"number": 18,
|
10
|
+
"state": "closed",
|
11
|
+
"locked": false,
|
12
|
+
"title": "add exmaple of how to mock PRs",
|
13
|
+
"user": {
|
14
|
+
"login": "wilrnh",
|
15
|
+
"id": 555966,
|
16
|
+
"node_id": "MDQ6VXNlcjU1NTk2Ng==",
|
17
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/555966?v=4",
|
18
|
+
"gravatar_id": "",
|
19
|
+
"url": "https://api.github.com/users/wilrnh",
|
20
|
+
"html_url": "https://github.com/wilrnh",
|
21
|
+
"followers_url": "https://api.github.com/users/wilrnh/followers",
|
22
|
+
"following_url": "https://api.github.com/users/wilrnh/following{/other_user}",
|
23
|
+
"gists_url": "https://api.github.com/users/wilrnh/gists{/gist_id}",
|
24
|
+
"starred_url": "https://api.github.com/users/wilrnh/starred{/owner}{/repo}",
|
25
|
+
"subscriptions_url": "https://api.github.com/users/wilrnh/subscriptions",
|
26
|
+
"organizations_url": "https://api.github.com/users/wilrnh/orgs",
|
27
|
+
"repos_url": "https://api.github.com/users/wilrnh/repos",
|
28
|
+
"events_url": "https://api.github.com/users/wilrnh/events{/privacy}",
|
29
|
+
"received_events_url": "https://api.github.com/users/wilrnh/received_events",
|
30
|
+
"type": "User",
|
31
|
+
"site_admin": false
|
32
|
+
},
|
33
|
+
"body": "Fixes danger/danger#661\r\n\r\nadd example how to mock PRs",
|
34
|
+
"created_at": "2018-05-02T01:52:26Z",
|
35
|
+
"updated_at": "2018-05-02T10:37:04Z",
|
36
|
+
"closed_at": "2018-05-02T10:37:04Z",
|
37
|
+
"merged_at": "2018-05-02T10:37:04Z",
|
38
|
+
"merge_commit_sha": "39eacac22d52a2b70fc49bd8aba19eb7d2864717",
|
39
|
+
"assignee": null,
|
40
|
+
"assignees": [
|
41
|
+
|
42
|
+
],
|
43
|
+
"requested_reviewers": [
|
44
|
+
|
45
|
+
],
|
46
|
+
"requested_teams": [
|
47
|
+
|
48
|
+
],
|
49
|
+
"labels": [
|
50
|
+
|
51
|
+
],
|
52
|
+
"milestone": null,
|
53
|
+
"draft": false,
|
54
|
+
"commits_url": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18/commits",
|
55
|
+
"review_comments_url": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18/comments",
|
56
|
+
"review_comment_url": "https://api.github.com/repos/danger/danger-plugin-template/pulls/comments{/number}",
|
57
|
+
"comments_url": "https://api.github.com/repos/danger/danger-plugin-template/issues/18/comments",
|
58
|
+
"statuses_url": "https://api.github.com/repos/danger/danger-plugin-template/statuses/abe89bee0cdc5f45b1dee62c60e74c70f3fcb5d5",
|
59
|
+
"head": {
|
60
|
+
"label": "wilrnh:661-mocking-prs",
|
61
|
+
"ref": "661-mocking-prs",
|
62
|
+
"sha": "abe89bee0cdc5f45b1dee62c60e74c70f3fcb5d5",
|
63
|
+
"user": {
|
64
|
+
"login": "wilrnh",
|
65
|
+
"id": 555966,
|
66
|
+
"node_id": "MDQ6VXNlcjU1NTk2Ng==",
|
67
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/555966?v=4",
|
68
|
+
"gravatar_id": "",
|
69
|
+
"url": "https://api.github.com/users/wilrnh",
|
70
|
+
"html_url": "https://github.com/wilrnh",
|
71
|
+
"followers_url": "https://api.github.com/users/wilrnh/followers",
|
72
|
+
"following_url": "https://api.github.com/users/wilrnh/following{/other_user}",
|
73
|
+
"gists_url": "https://api.github.com/users/wilrnh/gists{/gist_id}",
|
74
|
+
"starred_url": "https://api.github.com/users/wilrnh/starred{/owner}{/repo}",
|
75
|
+
"subscriptions_url": "https://api.github.com/users/wilrnh/subscriptions",
|
76
|
+
"organizations_url": "https://api.github.com/users/wilrnh/orgs",
|
77
|
+
"repos_url": "https://api.github.com/users/wilrnh/repos",
|
78
|
+
"events_url": "https://api.github.com/users/wilrnh/events{/privacy}",
|
79
|
+
"received_events_url": "https://api.github.com/users/wilrnh/received_events",
|
80
|
+
"type": "User",
|
81
|
+
"site_admin": false
|
82
|
+
},
|
83
|
+
"repo": null
|
84
|
+
},
|
85
|
+
"base": {
|
86
|
+
"label": "danger:master",
|
87
|
+
"ref": "master",
|
88
|
+
"sha": "30bd69c1c09d927abde0695fcb39dd70d4cc0f81",
|
89
|
+
"user": {
|
90
|
+
"login": "danger",
|
91
|
+
"id": 17147106,
|
92
|
+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE3MTQ3MTA2",
|
93
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/17147106?v=4",
|
94
|
+
"gravatar_id": "",
|
95
|
+
"url": "https://api.github.com/users/danger",
|
96
|
+
"html_url": "https://github.com/danger",
|
97
|
+
"followers_url": "https://api.github.com/users/danger/followers",
|
98
|
+
"following_url": "https://api.github.com/users/danger/following{/other_user}",
|
99
|
+
"gists_url": "https://api.github.com/users/danger/gists{/gist_id}",
|
100
|
+
"starred_url": "https://api.github.com/users/danger/starred{/owner}{/repo}",
|
101
|
+
"subscriptions_url": "https://api.github.com/users/danger/subscriptions",
|
102
|
+
"organizations_url": "https://api.github.com/users/danger/orgs",
|
103
|
+
"repos_url": "https://api.github.com/users/danger/repos",
|
104
|
+
"events_url": "https://api.github.com/users/danger/events{/privacy}",
|
105
|
+
"received_events_url": "https://api.github.com/users/danger/received_events",
|
106
|
+
"type": "Organization",
|
107
|
+
"site_admin": false
|
108
|
+
},
|
109
|
+
"repo": {
|
110
|
+
"id": 60424063,
|
111
|
+
"node_id": "MDEwOlJlcG9zaXRvcnk2MDQyNDA2Mw==",
|
112
|
+
"name": "danger-plugin-template",
|
113
|
+
"full_name": "danger/danger-plugin-template",
|
114
|
+
"private": false,
|
115
|
+
"owner": {
|
116
|
+
"login": "danger",
|
117
|
+
"id": 17147106,
|
118
|
+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE3MTQ3MTA2",
|
119
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/17147106?v=4",
|
120
|
+
"gravatar_id": "",
|
121
|
+
"url": "https://api.github.com/users/danger",
|
122
|
+
"html_url": "https://github.com/danger",
|
123
|
+
"followers_url": "https://api.github.com/users/danger/followers",
|
124
|
+
"following_url": "https://api.github.com/users/danger/following{/other_user}",
|
125
|
+
"gists_url": "https://api.github.com/users/danger/gists{/gist_id}",
|
126
|
+
"starred_url": "https://api.github.com/users/danger/starred{/owner}{/repo}",
|
127
|
+
"subscriptions_url": "https://api.github.com/users/danger/subscriptions",
|
128
|
+
"organizations_url": "https://api.github.com/users/danger/orgs",
|
129
|
+
"repos_url": "https://api.github.com/users/danger/repos",
|
130
|
+
"events_url": "https://api.github.com/users/danger/events{/privacy}",
|
131
|
+
"received_events_url": "https://api.github.com/users/danger/received_events",
|
132
|
+
"type": "Organization",
|
133
|
+
"site_admin": false
|
134
|
+
},
|
135
|
+
"html_url": "https://github.com/danger/danger-plugin-template",
|
136
|
+
"description": "An opinionated template for creating a Danger plugin",
|
137
|
+
"fork": false,
|
138
|
+
"url": "https://api.github.com/repos/danger/danger-plugin-template",
|
139
|
+
"forks_url": "https://api.github.com/repos/danger/danger-plugin-template/forks",
|
140
|
+
"keys_url": "https://api.github.com/repos/danger/danger-plugin-template/keys{/key_id}",
|
141
|
+
"collaborators_url": "https://api.github.com/repos/danger/danger-plugin-template/collaborators{/collaborator}",
|
142
|
+
"teams_url": "https://api.github.com/repos/danger/danger-plugin-template/teams",
|
143
|
+
"hooks_url": "https://api.github.com/repos/danger/danger-plugin-template/hooks",
|
144
|
+
"issue_events_url": "https://api.github.com/repos/danger/danger-plugin-template/issues/events{/number}",
|
145
|
+
"events_url": "https://api.github.com/repos/danger/danger-plugin-template/events",
|
146
|
+
"assignees_url": "https://api.github.com/repos/danger/danger-plugin-template/assignees{/user}",
|
147
|
+
"branches_url": "https://api.github.com/repos/danger/danger-plugin-template/branches{/branch}",
|
148
|
+
"tags_url": "https://api.github.com/repos/danger/danger-plugin-template/tags",
|
149
|
+
"blobs_url": "https://api.github.com/repos/danger/danger-plugin-template/git/blobs{/sha}",
|
150
|
+
"git_tags_url": "https://api.github.com/repos/danger/danger-plugin-template/git/tags{/sha}",
|
151
|
+
"git_refs_url": "https://api.github.com/repos/danger/danger-plugin-template/git/refs{/sha}",
|
152
|
+
"trees_url": "https://api.github.com/repos/danger/danger-plugin-template/git/trees{/sha}",
|
153
|
+
"statuses_url": "https://api.github.com/repos/danger/danger-plugin-template/statuses/{sha}",
|
154
|
+
"languages_url": "https://api.github.com/repos/danger/danger-plugin-template/languages",
|
155
|
+
"stargazers_url": "https://api.github.com/repos/danger/danger-plugin-template/stargazers",
|
156
|
+
"contributors_url": "https://api.github.com/repos/danger/danger-plugin-template/contributors",
|
157
|
+
"subscribers_url": "https://api.github.com/repos/danger/danger-plugin-template/subscribers",
|
158
|
+
"subscription_url": "https://api.github.com/repos/danger/danger-plugin-template/subscription",
|
159
|
+
"commits_url": "https://api.github.com/repos/danger/danger-plugin-template/commits{/sha}",
|
160
|
+
"git_commits_url": "https://api.github.com/repos/danger/danger-plugin-template/git/commits{/sha}",
|
161
|
+
"comments_url": "https://api.github.com/repos/danger/danger-plugin-template/comments{/number}",
|
162
|
+
"issue_comment_url": "https://api.github.com/repos/danger/danger-plugin-template/issues/comments{/number}",
|
163
|
+
"contents_url": "https://api.github.com/repos/danger/danger-plugin-template/contents/{+path}",
|
164
|
+
"compare_url": "https://api.github.com/repos/danger/danger-plugin-template/compare/{base}...{head}",
|
165
|
+
"merges_url": "https://api.github.com/repos/danger/danger-plugin-template/merges",
|
166
|
+
"archive_url": "https://api.github.com/repos/danger/danger-plugin-template/{archive_format}{/ref}",
|
167
|
+
"downloads_url": "https://api.github.com/repos/danger/danger-plugin-template/downloads",
|
168
|
+
"issues_url": "https://api.github.com/repos/danger/danger-plugin-template/issues{/number}",
|
169
|
+
"pulls_url": "https://api.github.com/repos/danger/danger-plugin-template/pulls{/number}",
|
170
|
+
"milestones_url": "https://api.github.com/repos/danger/danger-plugin-template/milestones{/number}",
|
171
|
+
"notifications_url": "https://api.github.com/repos/danger/danger-plugin-template/notifications{?since,all,participating}",
|
172
|
+
"labels_url": "https://api.github.com/repos/danger/danger-plugin-template/labels{/name}",
|
173
|
+
"releases_url": "https://api.github.com/repos/danger/danger-plugin-template/releases{/id}",
|
174
|
+
"deployments_url": "https://api.github.com/repos/danger/danger-plugin-template/deployments",
|
175
|
+
"created_at": "2016-06-04T18:17:02Z",
|
176
|
+
"updated_at": "2021-10-27T08:26:48Z",
|
177
|
+
"pushed_at": "2022-09-04T13:16:52Z",
|
178
|
+
"git_url": "git://github.com/danger/danger-plugin-template.git",
|
179
|
+
"ssh_url": "git@github.com:danger/danger-plugin-template.git",
|
180
|
+
"clone_url": "https://github.com/danger/danger-plugin-template.git",
|
181
|
+
"svn_url": "https://github.com/danger/danger-plugin-template",
|
182
|
+
"homepage": null,
|
183
|
+
"size": 42,
|
184
|
+
"stargazers_count": 19,
|
185
|
+
"watchers_count": 19,
|
186
|
+
"language": "Ruby",
|
187
|
+
"has_issues": true,
|
188
|
+
"has_projects": true,
|
189
|
+
"has_downloads": true,
|
190
|
+
"has_wiki": true,
|
191
|
+
"has_pages": false,
|
192
|
+
"forks_count": 12,
|
193
|
+
"mirror_url": null,
|
194
|
+
"archived": false,
|
195
|
+
"disabled": false,
|
196
|
+
"open_issues_count": 2,
|
197
|
+
"license": {
|
198
|
+
"key": "other",
|
199
|
+
"name": "Other",
|
200
|
+
"spdx_id": "NOASSERTION",
|
201
|
+
"url": null,
|
202
|
+
"node_id": "MDc6TGljZW5zZTA="
|
203
|
+
},
|
204
|
+
"allow_forking": true,
|
205
|
+
"is_template": false,
|
206
|
+
"web_commit_signoff_required": false,
|
207
|
+
"topics": [
|
208
|
+
|
209
|
+
],
|
210
|
+
"visibility": "public",
|
211
|
+
"forks": 12,
|
212
|
+
"open_issues": 2,
|
213
|
+
"watchers": 19,
|
214
|
+
"default_branch": "master"
|
215
|
+
}
|
216
|
+
},
|
217
|
+
"_links": {
|
218
|
+
"self": {
|
219
|
+
"href": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18"
|
220
|
+
},
|
221
|
+
"html": {
|
222
|
+
"href": "https://github.com/danger/danger-plugin-template/pull/18"
|
223
|
+
},
|
224
|
+
"issue": {
|
225
|
+
"href": "https://api.github.com/repos/danger/danger-plugin-template/issues/18"
|
226
|
+
},
|
227
|
+
"comments": {
|
228
|
+
"href": "https://api.github.com/repos/danger/danger-plugin-template/issues/18/comments"
|
229
|
+
},
|
230
|
+
"review_comments": {
|
231
|
+
"href": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18/comments"
|
232
|
+
},
|
233
|
+
"review_comment": {
|
234
|
+
"href": "https://api.github.com/repos/danger/danger-plugin-template/pulls/comments{/number}"
|
235
|
+
},
|
236
|
+
"commits": {
|
237
|
+
"href": "https://api.github.com/repos/danger/danger-plugin-template/pulls/18/commits"
|
238
|
+
},
|
239
|
+
"statuses": {
|
240
|
+
"href": "https://api.github.com/repos/danger/danger-plugin-template/statuses/abe89bee0cdc5f45b1dee62c60e74c70f3fcb5d5"
|
241
|
+
}
|
242
|
+
},
|
243
|
+
"author_association": "CONTRIBUTOR",
|
244
|
+
"auto_merge": null,
|
245
|
+
"active_lock_reason": null,
|
246
|
+
"merged": true,
|
247
|
+
"mergeable": null,
|
248
|
+
"rebaseable": null,
|
249
|
+
"mergeable_state": "unknown",
|
250
|
+
"merged_by": {
|
251
|
+
"login": "orta",
|
252
|
+
"id": 49038,
|
253
|
+
"node_id": "MDQ6VXNlcjQ5MDM4",
|
254
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/49038?v=4",
|
255
|
+
"gravatar_id": "",
|
256
|
+
"url": "https://api.github.com/users/orta",
|
257
|
+
"html_url": "https://github.com/orta",
|
258
|
+
"followers_url": "https://api.github.com/users/orta/followers",
|
259
|
+
"following_url": "https://api.github.com/users/orta/following{/other_user}",
|
260
|
+
"gists_url": "https://api.github.com/users/orta/gists{/gist_id}",
|
261
|
+
"starred_url": "https://api.github.com/users/orta/starred{/owner}{/repo}",
|
262
|
+
"subscriptions_url": "https://api.github.com/users/orta/subscriptions",
|
263
|
+
"organizations_url": "https://api.github.com/users/orta/orgs",
|
264
|
+
"repos_url": "https://api.github.com/users/orta/repos",
|
265
|
+
"events_url": "https://api.github.com/users/orta/events{/privacy}",
|
266
|
+
"received_events_url": "https://api.github.com/users/orta/received_events",
|
267
|
+
"type": "User",
|
268
|
+
"site_admin": false
|
269
|
+
},
|
270
|
+
"comments": 2,
|
271
|
+
"review_comments": 0,
|
272
|
+
"maintainer_can_modify": false,
|
273
|
+
"commits": 2,
|
274
|
+
"additions": 5,
|
275
|
+
"deletions": 0,
|
276
|
+
"changed_files": 1
|
277
|
+
}
|
metadata
ADDED
@@ -0,0 +1,220 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: danger-gitlab_graph
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.7
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jan Beckmann
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-10-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: danger-plugin-api
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: svg-graph
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.2.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.2.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.4'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: yard
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: guard
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.14'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '2.14'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: guard-rspec
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '4.7'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '4.7'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: listen
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 3.0.7
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - '='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 3.0.7
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
description: Danger plugin for creating graph from ci metrics.
|
168
|
+
email:
|
169
|
+
- king-jan1999@hotmail.de
|
170
|
+
executables: []
|
171
|
+
extensions: []
|
172
|
+
extra_rdoc_files: []
|
173
|
+
files:
|
174
|
+
- ".bundle/config"
|
175
|
+
- ".gitignore"
|
176
|
+
- ".rubocop.yml"
|
177
|
+
- ".tool-versions"
|
178
|
+
- ".travis.yml"
|
179
|
+
- Gemfile
|
180
|
+
- Gemfile.lock
|
181
|
+
- Guardfile
|
182
|
+
- LICENSE.txt
|
183
|
+
- README.md
|
184
|
+
- Rakefile
|
185
|
+
- danger-gitlab_graph.gemspec
|
186
|
+
- lib/danger_gitlab_graph.rb
|
187
|
+
- lib/danger_plugin.rb
|
188
|
+
- lib/gitlab_graph/gem_version.rb
|
189
|
+
- lib/gitlab_graph/plugin.rb
|
190
|
+
- spec/gitlab_graph_spec.rb
|
191
|
+
- spec/spec_helper.rb
|
192
|
+
- spec/support/fixtures/github_pr.json
|
193
|
+
homepage: https://github.com/kingjan1999/danger-gitlab_graph
|
194
|
+
licenses:
|
195
|
+
- MIT
|
196
|
+
metadata: {}
|
197
|
+
post_install_message:
|
198
|
+
rdoc_options: []
|
199
|
+
require_paths:
|
200
|
+
- lib
|
201
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
202
|
+
requirements:
|
203
|
+
- - ">="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '0'
|
206
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
|
+
requirements:
|
208
|
+
- - ">="
|
209
|
+
- !ruby/object:Gem::Version
|
210
|
+
version: '0'
|
211
|
+
requirements: []
|
212
|
+
rubygems_version: 3.1.6
|
213
|
+
signing_key:
|
214
|
+
specification_version: 4
|
215
|
+
summary: Danger plugin which allows you to extract and visualize metrics over previous
|
216
|
+
ci runs.
|
217
|
+
test_files:
|
218
|
+
- spec/gitlab_graph_spec.rb
|
219
|
+
- spec/spec_helper.rb
|
220
|
+
- spec/support/fixtures/github_pr.json
|