peoplegroup-connectors 0.1.26 → 0.1.31
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f8e9b381041269a553b63f9c64fc86de1dedf730ba10191d055b2d30eaeb205
|
4
|
+
data.tar.gz: cd5512eef60b5d2bc05450790ed6181b013ac7f7bacc3c888a4c1c91fb4c5a65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85014b51651109152eff8a1232b13bc653f5d0855bc1408044ffd5f304bbe20768cd861c4683097bd7d9f8d4123a09f52ca5dd84dbf9948dd26f4eaf6522ee0f
|
7
|
+
data.tar.gz: 8324034a0ce7ddd6038a56a0a5b9680a0a64f2cbdf8cece9b72f5bbc8a063743c85940577728bb7b7aca244dd00ff598762d806ba82b65f801da8e140b65ace6
|
@@ -5,6 +5,8 @@ require 'gitlab'
|
|
5
5
|
module PeopleGroup
|
6
6
|
module Connectors
|
7
7
|
class GitLab
|
8
|
+
attr_accessor :client
|
9
|
+
|
8
10
|
MAX_RETRIES = 3
|
9
11
|
|
10
12
|
API_URL = ENV['GITLAB_API_V4_URL'] || 'https://gitlab.com/api/v4'
|
@@ -24,6 +26,21 @@ module PeopleGroup
|
|
24
26
|
end
|
25
27
|
end
|
26
28
|
|
29
|
+
def find_gitlabber_on(field, query, group)
|
30
|
+
return if !query || query.empty?
|
31
|
+
|
32
|
+
possible_members = retry_on_error { @client.group_members(group, query: query) }
|
33
|
+
if field === :email
|
34
|
+
possible_members.first
|
35
|
+
else
|
36
|
+
possible_members.find { |team_member| team_member.public_send(field) === query }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def remove_group_member(group, user_id)
|
41
|
+
retry_on_error { @client.remove_group_member(group, user_id) }
|
42
|
+
end
|
43
|
+
|
27
44
|
def create_issue(project, title, options = {})
|
28
45
|
retry_on_error do
|
29
46
|
@client.create_issue(project, title, options)
|
@@ -73,8 +73,8 @@ module PeopleGroup
|
|
73
73
|
# If the candidate has any application that is active, we don't sync.
|
74
74
|
return false if candidate['applications'].any? { |application| application['status'] == 'active' }
|
75
75
|
|
76
|
-
# Check if candidate is hired for
|
77
|
-
candidate['applications'].
|
76
|
+
# Check if candidate is hired for at least one of their applications
|
77
|
+
candidate['applications'].any? { |application| application['status'] == 'hired' }
|
78
78
|
end
|
79
79
|
end
|
80
80
|
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.
|
4
|
+
version: 0.1.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lien van den steen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab
|