robopigeon 0.4.0 → 0.5.0

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: 495702532ec10da40ade27869b140a3e08818b3e526cf6facc9f3383ac3343b0
4
- data.tar.gz: 0114d17376193afeb45e156ec2e422a6d76f1045cae6b69d7b1c536c741bbe25
3
+ metadata.gz: 5391be1b19958006737a4513912bbadb65947bc291b85d4113fb8ce564b2da05
4
+ data.tar.gz: 3713d10465f423118fd01f0cf3bbc17e052177dd72c491b74d7a4ef6d6e1ed66
5
5
  SHA512:
6
- metadata.gz: 74b208a5c0567aaea87fab2873674e6f49644611094a4d00cbc459b58d1d01bb4479c90513919ed1d92b87a2581d7b8b0fe720f78b858dbb8d24be2c49547815
7
- data.tar.gz: edb6b068175cab4d768f62d9da5a63f862cca508538db22fbed96cdb8fc257d82ed180e1cba16f9b5b903a693c1c010d568f7ef0aededf3f7f2865a8ec28278e
6
+ metadata.gz: 770e9f834db0d439790b67b5751b393c95660dd64822673b4bad06db4d16a690e27400587080ab551b50a9a9f57c18d03877029757703fdbf80dcf24cf42040c
7
+ data.tar.gz: 05b08ed1a0dbe1263f98e0083eda2f706dccc524b2c6de914ce0cc2b12c66b111d73fe44e2d37c8141dce867a5ac6df0463b9a945c09fba38c68ac333645b1ec
data/.version CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.5.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## 0.5.0 (2019-05-16)
2
+
3
+ ### Added
4
+
5
+ - Support for Jira fields that are arrays of options
6
+
7
+ ## 0.4.0 (2019-04-29)
8
+
9
+ ### Added
10
+
11
+ - Support for specifying Jira labels in jobs
12
+ - Support for Jira fields that are arrays of strings
13
+
14
+ ### Fixed
15
+
16
+ - Does not attempt to send a Due Date field ot Jira if one does not exist
17
+
1
18
  ## 0.3.2 (2019-04-10)
2
19
 
3
20
  ### Added
@@ -83,12 +83,10 @@ module RoboPigeon::Jira
83
83
 
84
84
  def set_field(name, value)
85
85
  require_field(:issue_type)
86
- request_path = "#{ISSUE_PATH}/createmeta?projectKeys=#{project}&expand=projects.issuetypes.fields"
86
+ request_path = "#{ISSUE_PATH}/createmeta?projectKeys=#{project}&issuetypeNames=#{issue_type}&expand=projects.issuetypes.fields"
87
87
  response = jira_request.get(request_path)
88
88
  raw = JSON.parse(response.body)
89
- fields = raw['projects'].first['issuetypes'].select do |it|
90
- it['name'] == issue_type
91
- end.first['fields']
89
+ fields = raw['projects'].first['issuetypes'].first['fields']
92
90
  field = fields.keys.select do |key|
93
91
  fields[key]['name'] == name
94
92
  end.first
@@ -187,9 +185,21 @@ module RoboPigeon::Jira
187
185
 
188
186
  values.split(',').map do |value|
189
187
  value.strip!
190
- if field_metadata['schema']['items'] == 'string'
191
- value
188
+
189
+ # Construct item based on its type if available
190
+ if field_metadata.key?('schema') && field_metadata['schema'].key?('items')
191
+ case field_metadata['schema']['items']
192
+ when 'string'
193
+ value
194
+ when 'option'
195
+ { value: value }
196
+ else
197
+ # Not really sure if this is the best default format
198
+ { name: value }
199
+ end
192
200
  else
201
+ # Not really sure if this condition can happen
202
+ # Not really sure if this is the best default format
193
203
  { name: value }
194
204
  end
195
205
  end
data/robopigeon.gemspec CHANGED
@@ -44,7 +44,7 @@ Gem::Specification.new do |spec|
44
44
  spec.add_development_dependency 'pry', '~> 0.12'
45
45
  spec.add_development_dependency 'rake', '~> 10.5'
46
46
  spec.add_development_dependency 'rspec', '~> 3.8'
47
- spec.add_development_dependency 'rubocop', '~> 0.57'
47
+ spec.add_development_dependency 'rubocop', '= 0.57'
48
48
  spec.add_development_dependency 'simplecov', '~> 0.16'
49
49
  spec.add_development_dependency 'vcr', '~> 4.0'
50
50
  spec.add_development_dependency 'webmock', '~> 3.5'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robopigeon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Ives
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-30 00:00:00.000000000 Z
11
+ date: 2019-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab
@@ -174,14 +174,14 @@ dependencies:
174
174
  name: rubocop
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - "~>"
177
+ - - '='
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0.57'
180
180
  type: :development
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
- - - "~>"
184
+ - - '='
185
185
  - !ruby/object:Gem::Version
186
186
  version: '0.57'
187
187
  - !ruby/object:Gem::Dependency