danger 7.0.0 → 7.0.1

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: bac82d5de5c00b56576cd95681444543eb4b540f6bb6767ac1d407fb13150fbc
4
- data.tar.gz: 032b2993f97a2c8c56b4d8f69690c7bbd7bbf6738e3631af54a0ea657811939f
3
+ metadata.gz: 63dbe2ade63bf454f001702c2f0c3f478edd5a8cb060d2f417992da1f989ecdb
4
+ data.tar.gz: a2dd9e0b5aacf4e28d03249721ed60f9dd1db93aca597e6eb6aaf087fe9dea0a
5
5
  SHA512:
6
- metadata.gz: 74fa60f6fc40846e32837a0b8234b119f6132ff4a629abd705480a8c4ebee1bbb78ed19ad940fc63d8d08b427e238bea3edb2d67286d23ceef48ac8a7c9e0dd3
7
- data.tar.gz: 7072368e374403c31ea5240b8004942c9e28f00806f4acb1d65fafe850d291b8a893f06a3b1a294a325e374fc594e732c43343cd50c36ea99ee5d52ffe281c0a
6
+ metadata.gz: d3205f7b0a508ff32fe0fac7b24b3a6b54aac5f272ff80b3594175a79e3eaa0967a05cd697c190883c759a2518e06c745b7e9089453dbb16b7b23848e531906c
7
+ data.tar.gz: dc10f9b37711f33c1e92c128796f0da53b5d9f03f0d68e089d00360143fa552d96dbf30cf35285323d93d8c8b1e936d2b9429579d358cb28f5057eef77aeb94c
@@ -63,7 +63,7 @@ module Danger
63
63
  unless EnvironmentManager.pr?(system_env)
64
64
  ci_name = EnvironmentManager.local_ci_source(system_env).name.split("::").last
65
65
 
66
- msg = "Not a #{ci_name} Pull Request - skipping `danger` run. "
66
+ msg = "Not a #{ci_name} #{commit_request(ci_name)} - skipping `danger` run. "
67
67
  # circle won't run danger properly if the commit is pushed and build runs before the PR exists
68
68
  # https://danger.systems/guides/troubleshooting.html#circle-ci-doesnt-run-my-build-consistently
69
69
  # the best solution is to enable `fail_if_no_pr`, and then re-run the job once the PR is up
@@ -83,5 +83,10 @@ module Danger
83
83
  def head_branch(user_specified_head_branch)
84
84
  user_specified_head_branch || EnvironmentManager.danger_head_branch
85
85
  end
86
+
87
+ def commit_request(ci_name)
88
+ return "Merge Request" if ci_name == 'GitLabCI'
89
+ return "Pull Request"
90
+ end
86
91
  end
87
92
  end
@@ -170,7 +170,7 @@ module Danger
170
170
  rest_inline_violations = submit_inline_comments!({
171
171
  danger_id: danger_id,
172
172
  previous_violations: previous_violations
173
- }.merge(inline_violations))
173
+ }.merge(**inline_violations))
174
174
 
175
175
  main_violations = merge_violations(
176
176
  regular_violations, rest_inline_violations
@@ -189,7 +189,7 @@ module Danger
189
189
  template: "github",
190
190
  danger_id: danger_id,
191
191
  previous_violations: previous_violations
192
- }.merge(main_violations))
192
+ }.merge(**main_violations))
193
193
 
194
194
  comment_result =
195
195
  if should_create_new_comment
@@ -302,6 +302,9 @@ module Danger
302
302
  def file_url(organisation: nil, repository: nil, branch: nil, path: nil)
303
303
  branch ||= 'master'
304
304
  token = @environment["DANGER_GITLAB_API_TOKEN"]
305
+ # According to GitLab Repositories API docs path and id(slug) should be encoded.
306
+ path = URI.encode_www_form_component(path)
307
+ repository = URI.encode_www_form_component(repository)
305
308
  "#{endpoint}/projects/#{repository}/repository/files/#{path}/raw?ref=#{branch}&private_token=#{token}"
306
309
  end
307
310
 
@@ -1,4 +1,4 @@
1
1
  module Danger
2
- VERSION = "7.0.0".freeze
2
+ VERSION = "7.0.1".freeze
3
3
  DESCRIPTION = "Like Unit Tests, but for your Team Culture.".freeze
4
4
  end
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: 7.0.0
4
+ version: 7.0.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-04-16 00:00:00.000000000 Z
12
+ date: 2020-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: claide
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '1.6'
48
+ version: '1.7'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '1.6'
55
+ version: '1.7'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: colored2
58
58
  requirement: !ruby/object:Gem::Requirement