tutter-sppuppet 1.1.1 → 1.1.2

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGY3YmE5MDFlNjE5MDdkYzY2MjcxZjE3YmIyNDBkZmEzNmE2MjQ5OQ==
4
+ MWU4YTU4YzUxMTM0N2FkZTYyODc5MjdjYTY3N2RiYTFmMGExMjM4MQ==
5
5
  data.tar.gz: !binary |-
6
- ZWZkODNmMjE4MTA0NTI3MmEwYzRlYzIyNjcxNzFmZjFkYWVhMzE0Zg==
6
+ ZDE3NmUzYzAyMDk0NGFhODJjYmEyYzNhYTVhZmMyY2JmNzkwY2U2ZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTRkYmViYWZhYzYxOTljYmY1NDg0NDVmOWYwYTFhMzM3ZmY0OTlmYjE5NWFh
10
- YjcyZTU4NzBmYTYwYjFlM2UyYmIyNWU3MDBlOGQxNGYwYWY5YWVhM2I3ZmY2
11
- NzNhYzI2MjBjNGQxOWViNWEyMWExZjg2ZWU4NTBkNzhlZmNkNjA=
9
+ OGVlMGIyYTQwYWNlNThmMWQ5ZGQyZjAxOWIzMDRkMzRmMjYxMzMyMjE3ZjI3
10
+ ZDMxNjUxODBlMDM5YzZiNmVhNjc4YTg3ZmI5YzI1NmFlZjMwMzA2N2EyNThh
11
+ ZjMxNTZjODdmNGY3YTAxYWVkYzVlZjQyNmE4MjdhYjk1NGQ4YmE=
12
12
  data.tar.gz: !binary |-
13
- NDM2NThkZGNhMjdkMGYxZTdkYjgwODIwNDBhNDU3NjNiMWE5M2NkNTk5ODdk
14
- NDg4N2Y2NGFkMzQ3NzFjMzYwODI3YTcwZDQ3OTBjOWU0Y2QxZDQ2M2RiOWI5
15
- NWFlNDVmZDhhMTY0MzllYTM3YjI3YTNkYjVjZGQ4ZGYxZGQ4MTk=
13
+ ZjE4MGIwMjU1ODgxN2ZiOWM0MzUyY2QxNWZhYTY5Yzg1NDY2ZTc5ODllOWVj
14
+ ZDc0ZWJkOWJmZTU3ZGRiNjEyODE0NThhZDE1ODU2NDFmZmQ5YmJkNmJlYjk1
15
+ NDVmNzc1N2I2MDdhOGMzNTNiZmYyNTYxZDUzM2I4ZTVjYzYxMDY=
@@ -55,19 +55,9 @@ class Sppuppet
55
55
  def maybe_merge(pull_request_id, merge_command)
56
56
  votes = {}
57
57
  merger = nil
58
+ incident_merge_override = false
58
59
  pr = @client.pull_request @project, pull_request_id
59
60
 
60
- unless pr.mergeable_state == 'clean'
61
- msg = "Merge state for is not clean. Current state: #{pr.mergeable_state}\n"
62
- reassure = "I will try to merge this for you when the builds turn green\n" +
63
- 'If your build fails or becomes stuck for some reason, just say \'rebuild\''
64
- if merge_command
65
- return post_comment(pull_request_id, msg + reassure)
66
- else
67
- return 200, msg
68
- end
69
- end
70
-
71
61
  # We fetch the latest commit and it's date.
72
62
  last_commit = @client.pull_request_commits(@project, pull_request_id).last
73
63
  last_commit_date = last_commit.commit.committer.date
@@ -88,7 +78,7 @@ class Sppuppet
88
78
  end
89
79
  end
90
80
 
91
- match = /^:?([+-])1:?/.match(i.body)
81
+ match = /^(:?([+-])1:?|LGTM)/.match(i.body)
92
82
  if match
93
83
  score = match[1] == '+' ? 1 : -1
94
84
  # pull request submitter cant +1
@@ -102,12 +92,28 @@ class Sppuppet
102
92
  msg = "Commit cannot be merged so long as a -2 comment appears in the PR."
103
93
  return post_comment(pull_request_id, msg)
104
94
  end
95
+
96
+ if /jira.*INCIDENT/.match(i.body)
97
+ incident_merge_override = true
98
+ end
99
+ end
100
+
101
+ if pr.mergeable_state != 'clean' && !incident_merge_override
102
+ msg = "Merge state for is not clean. Current state: #{pr.mergeable_state}\n"
103
+ reassure = "I will try to merge this for you when the builds turn green\n" +
104
+ "If your build fails or becomes stuck for some reason, just say 'rebuild'\n" +
105
+ 'If have an incident and want to skip the tests and the peer review, please post the link to the jira ticket.'
106
+ if merge_command
107
+ return post_comment(pull_request_id, msg + reassure)
108
+ else
109
+ return 200, msg
110
+ end
105
111
  end
106
112
 
107
113
  return 200, 'No merge comment found' unless merger
108
114
 
109
115
  num_votes = votes.values.reduce(0) { |a, e| a + e }
110
- if num_votes < @settings['plus_ones_required']
116
+ if num_votes < @settings['plus_ones_required'] && !incident_merge_override
111
117
  msg = "Not enough plus ones. #{@settings['plus_ones_required']} required, and only have #{num_votes}"
112
118
  return post_comment(pull_request_id, msg)
113
119
  end
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'tutter-sppuppet'
4
- s.version = '1.1.1'
4
+ s.version = '1.1.2'
5
5
  s.author = ['Johan Haals', 'Erik Dalén', 'Alexey Lapitsky']
6
6
  s.email = ['johan.haals@gmail.com', 'dalen@spotify.com', 'alexey@spotify.com']
7
7
  s.homepage = 'https://github.com/jhaals/tutter-sppuppet'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tutter-sppuppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan Haals
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-04-15 00:00:00.000000000 Z
13
+ date: 2015-10-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: tutter