peoplegroup-connectors 0.1.27 → 0.1.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/email_mapper.yml +4 -0
- data/lib/peoplegroup/connectors/bamboo.rb +9 -0
- data/lib/peoplegroup/connectors/gitlab.rb +2 -0
- data/lib/peoplegroup/connectors/greenhouse.rb +2 -2
- data/lib/peoplegroup/connectors/slack.rb +11 -0
- data/lib/peoplegroup/connectors/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24fc0303d37aaf2d6aa63b3babcf36ff18b086e084de6ac323440428c53926d4
|
4
|
+
data.tar.gz: 7974b2b210a74ab0236eb23cac227eb788332ddf0412609437139d0dc4a04ac4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a26c436c53c04da6889f179cad06c13f6a1b7d3f9fa6e12cfbfa2436d6df8e24311b3eebeabbaae5bb8cd2cc289b009635b64c0d581c212b5d3a518a4ce1ad5c
|
7
|
+
data.tar.gz: 80eb3e35a56dae8b36a4c50a05b6f052275f135435b2ca0821a9e275ddcce7941bfbb520a56652e9f035e5071f7e13e0a616d2e59e20d0930731b550110318ee
|
@@ -39,6 +39,15 @@ module PeopleGroup
|
|
39
39
|
end
|
40
40
|
alias_method :search_team_member_by_field, :search_employee_by_field
|
41
41
|
|
42
|
+
def slack_email_lookup_with_fallback(email)
|
43
|
+
file_path = File.join(__dir__, '../../../data/email_mapper.yml')
|
44
|
+
email_mapper = YAML.load_file(file_path)
|
45
|
+
email_hit = email_mapper.find { |mapping| mapping['slack_email'] == email.delete_suffix('@gitlab.com') }
|
46
|
+
email = email_hit['bamboo_email'] if email_hit
|
47
|
+
|
48
|
+
employees.find { |employee| employee['workEmail'] == email }
|
49
|
+
end
|
50
|
+
|
42
51
|
def fetch_manager(team_member)
|
43
52
|
active_team_members.find { |tm| tm['id'] == team_member['supervisorEId'] }
|
44
53
|
end
|
@@ -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
|
@@ -18,6 +18,17 @@ module PeopleGroup
|
|
18
18
|
nil
|
19
19
|
end
|
20
20
|
|
21
|
+
def bamboo_email_lookup_with_fallback(email)
|
22
|
+
file_path = File.join(__dir__, '../../../data/email_mapper.yml')
|
23
|
+
email_mapper = YAML.load_file(file_path)
|
24
|
+
email_hit = email_mapper.find { |mapping| mapping['bamboo_email'] == email.delete_suffix('@gitlab.com') }
|
25
|
+
email = email_hit['slack_email'] if email_hit
|
26
|
+
|
27
|
+
@client.users_lookupByEmail(email: email)
|
28
|
+
rescue ::Slack::Web::Api::Errors::SlackError
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
21
32
|
def find_user_by_id(id)
|
22
33
|
@client.users_info(user: id)
|
23
34
|
rescue ::Slack::Web::Api::Errors::SlackError
|
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.32
|
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-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab
|
@@ -159,6 +159,7 @@ extra_rdoc_files: []
|
|
159
159
|
files:
|
160
160
|
- LICENSE.txt
|
161
161
|
- README.md
|
162
|
+
- data/email_mapper.yml
|
162
163
|
- lib/peoplegroup/connectors.rb
|
163
164
|
- lib/peoplegroup/connectors/bamboo.rb
|
164
165
|
- lib/peoplegroup/connectors/gitlab.rb
|