peoplegroup-connectors 0.1.59 → 0.1.63

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: 880e9b3fac40c4640e8e0c50ab2935e9874a1bd8f3d9fa19484288e7c6af6600
4
- data.tar.gz: '0898dfefe0c405e442a0624e5c1289f266fc8fa9c8c3b2c8b4d1cf2a4974d48c'
3
+ metadata.gz: 9dcca5c68105e1122457fb9791bf5f04ac79cdfdc9d2bac4322216ba09eabdea
4
+ data.tar.gz: b071e58f273f21717bdbb08609512c1084cb9b8a48d17e319405c74870fcb659
5
5
  SHA512:
6
- metadata.gz: 5bfcda95570803256348e6f85931969dccc927381ccd9e2f9fdaf4776d47eb35209c32e8ba3d074b1c49846d55b84890834c542feadf9c5a84d66172dbeb94a9
7
- data.tar.gz: 5aedbfc3d6661e1b5a0ddae90bd498a548ed27368d983414f7cd36f13cc99422c1d7ca12b66cc38d6867850228260ff2dc8d8c63e14f1ee40fcc0c2a5d7aab47
6
+ metadata.gz: dd6fe63125e3fa3a0a57370477c05b33928e740f4fc6356616b74657e7564b6afe7cbe230cca51afbe9585697aeadf02cd7f6ab4114b22dfcbaa4c9ee46c48bc
7
+ data.tar.gz: '07380dae4f4a79de225064982a3a04d18eb70c5e4547a8d542a0f03547cb2d33de0de1e4f9aa34597476381aa44c4bcbebd56274f480c38808e55de88af3fa1d'
@@ -187,6 +187,10 @@ module PeopleGroup
187
187
  meta_fields.detect { |res| res['name'] == 'Division' }.dig('options').each_with_object([]) { |option, array| array << option['name'] if option['archived'] == 'no' } || []
188
188
  end
189
189
 
190
+ def locations
191
+ meta_fields.detect { |res| res['name'] == 'Location' }.dig('options').each_with_object([]) { |option, array| array << option['name'] if option['archived'] == 'no' } || []
192
+ end
193
+
190
194
  def fields
191
195
  return @fields if @fields
192
196
 
@@ -257,7 +261,7 @@ module PeopleGroup
257
261
  end
258
262
 
259
263
  def time_off_adjustment(employee_id, options)
260
- @client.employee.time_off_balance_adjustment('42043', options)
264
+ @client.employee.time_off_balance_adjustment(employee_id, options)
261
265
  end
262
266
 
263
267
  def accrued_days(employee_id)
@@ -35,14 +35,29 @@ module PeopleGroup
35
35
  end
36
36
  end
37
37
 
38
- def remove_group_member(group, user_id)
39
- retry_on_error { @client.remove_group_member(group, user_id) }
38
+ def create_group(name, path, options = {})
39
+ retry_on_error { @client.create_group(name, path, options) }
40
+ end
41
+
42
+ def get_subgroups(group_id, options = {})
43
+ retry_on_error { @client.group_subgroups(group_id, options).auto_paginate }
44
+ end
45
+
46
+ def get_group_members(group_id)
47
+ retry_on_error { @client.group_members(group_id).auto_paginate }
48
+ end
49
+
50
+ def add_group_member(group_id, user_id, access_level_name)
51
+ access_level = access_levels[access_level_name]
52
+ retry_on_error { @client.add_group_member(group_id, user_id, access_level) }
53
+ end
54
+
55
+ def remove_group_member(group_id, user_id)
56
+ retry_on_error { @client.remove_group_member(group_id, user_id) }
40
57
  end
41
58
 
42
59
  def create_issue(project, title, options = {})
43
- retry_on_error do
44
- @client.create_issue(project, title, options)
45
- end
60
+ retry_on_error { @client.create_issue(project, title, options) }
46
61
  end
47
62
 
48
63
  def create_issue_note(project, id, text)
@@ -72,8 +87,8 @@ module PeopleGroup
72
87
  epic || retry_on_error { @client.create_epic(group_id, title, options) }
73
88
  end
74
89
 
75
- def commit_new_files_to_new_merge_request(project_id, branch_name, new_files, commit_message, description = nil)
76
- retry_on_error { @client.create_branch(project_id, branch_name, 'master') }
90
+ def commit_new_files_to_new_merge_request(project_id, branch_name, new_files, commit_message, description = nil, target_branch: 'master')
91
+ retry_on_error { @client.create_branch(project_id, branch_name, target_branch) }
77
92
  actions = []
78
93
  new_files.each do |file|
79
94
  actions << {
@@ -85,7 +100,7 @@ module PeopleGroup
85
100
 
86
101
  retry_on_error { @client.create_commit(project_id, branch_name, commit_message, actions) }
87
102
 
88
- options = { source_branch: branch_name, target_branch: 'master', remove_source_branch: true }
103
+ options = { source_branch: branch_name, target_branch: target_branch, remove_source_branch: true }
89
104
  options[:description] = description if description
90
105
  retry_on_error { @client.create_merge_request(project_id, commit_message, options) }
91
106
  end
@@ -120,8 +135,8 @@ module PeopleGroup
120
135
  retry_on_error { @client.create_merge_request(project_id, commit_message, options) }
121
136
  end
122
137
 
123
- def commit_change_to_new_merge_request(project_id, branch_name, file_path, file_with_change, commit_message, description = nil)
124
- retry_on_error { @client.create_branch(project_id, branch_name, 'master') }
138
+ def commit_change_to_new_merge_request(project_id, branch_name, file_path, file_with_change, commit_message, description = nil, target_branch: 'master')
139
+ retry_on_error { @client.create_branch(project_id, branch_name, target_branch) }
125
140
  actions = [
126
141
  {
127
142
  action: 'update',
@@ -131,7 +146,7 @@ module PeopleGroup
131
146
  ]
132
147
  retry_on_error { @client.create_commit(project_id, branch_name, commit_message, actions) }
133
148
 
134
- options = { source_branch: branch_name, target_branch: 'master', remove_source_branch: true }
149
+ options = { source_branch: branch_name, target_branch: target_branch, remove_source_branch: true }
135
150
  options[:description] = description if description
136
151
  retry_on_error { @client.create_merge_request(project_id, commit_message, options) }
137
152
  end
@@ -177,6 +192,19 @@ module PeopleGroup
177
192
  def reopen_epic(epic)
178
193
  retry_on_error { @client.edit_epic(epic.group_id, epic.iid, { state_event: 'reopen' }) }
179
194
  end
195
+
196
+ # Map access level names to values according to https://docs.gitlab.com/ee/api/members.html#valid-access-levels
197
+ def access_levels
198
+ @access_levels ||= {
199
+ no_access: 0,
200
+ minimal_access: 5,
201
+ guest: 10,
202
+ reporter: 20,
203
+ developer: 30,
204
+ maintainer: 40,
205
+ owner: 50
206
+ }
207
+ end
180
208
  end
181
209
  end
182
210
  end
@@ -54,8 +54,8 @@ module PeopleGroup
54
54
  @client.chat_postMessage(channel: channel, text: text, as_user: true, attachments: attachments, unfurl_links: false, thread_ts: thread_ts, reply_broadcast: reply_broadcast, blocks: formatted_message)
55
55
  end
56
56
 
57
- def update_message(channel:, timestamp:, text:, attachments: [])
58
- @client.chat_update(channel: channel, text: text, ts: timestamp, as_user: true, attachments: attachments)
57
+ def update_message(channel:, timestamp:, text: '', attachments: [], formatted_message: [])
58
+ @client.chat_update(channel: channel, text: text, ts: timestamp, as_user: true, attachments: attachments, blocks: formatted_message)
59
59
  end
60
60
 
61
61
  def send_modal_message(trigger:, view:)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PeopleGroup
4
4
  module Connectors
5
- VERSION = '0.1.59'
5
+ VERSION = '0.1.63'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peoplegroup-connectors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.59
4
+ version: 0.1.63
5
5
  platform: ruby
6
6
  authors:
7
7
  - lien van den steen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-15 00:00:00.000000000 Z
11
+ date: 2021-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.2.11
75
+ version: 0.2.12
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.2.11
82
+ version: 0.2.12
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: greenhouse_io-gitlab
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -190,7 +190,7 @@ metadata:
190
190
  homepage_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/connectors-gem
191
191
  source_code_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/connectors-gem
192
192
  changelog_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/connectors-gem
193
- post_install_message:
193
+ post_install_message:
194
194
  rdoc_options: []
195
195
  require_paths:
196
196
  - lib
@@ -205,8 +205,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  requirements: []
208
- rubygems_version: 3.1.4
209
- signing_key:
208
+ rubygems_version: 3.2.3
209
+ signing_key:
210
210
  specification_version: 4
211
211
  summary: Library for our shared connectors.
212
212
  test_files: []