talentio-notifier 0.3.5 → 0.3.6

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: ab95645c024ef8541200bbffb70ba196377c46a1337b4243410da86a5b538c03
4
- data.tar.gz: 0b4892fefdd35d45ee2caeb0bc4a06b77879c598c566803f4756004abc0ca1de
3
+ metadata.gz: 60637573e5522c31863a6d645b00b03e2ed3928d55af0991a61182a074202f61
4
+ data.tar.gz: 5d41bc07b84d2344951e8ea7e0aaa717776d52c34f2942edee4a55c68014514a
5
5
  SHA512:
6
- metadata.gz: 5447045371a31ffbf115ce1e41cf50e41bd70de3fc3e7e4a72dfda1909f77d7ce4bfc5b90a5c6d28ff796cadbebe81896e51a5dd62d8ca9e21933040cc5d7b04
7
- data.tar.gz: d7e1e35a8486a6ebd6b5b64d2354d569ebd5d804363cc1f7bbaeff3a29b7e59f2a9d3f5a1bfa7f8ed61813003a54815f329eb865e2cce096364c44df55ba042d
6
+ metadata.gz: 5ed7040c1822a524191c321b1e63f48f62f0a10f9788171da40c36fffbd22115325c2fdeaf8124c119a87962548926c07c9f8102ddce870d6c364bc40e2ac7a4
7
+ data.tar.gz: dfce8096e267b7b73df1944455e2b6ee4ba761b7ad1a8a9eea88a7cc82c930e1236700d575d4b3c311b145a4759c1b63eebcc9af9b285b838b14784dd4ec853b
data/Dockerfile CHANGED
@@ -2,5 +2,8 @@ FROM ruby:2.6.5
2
2
  WORKDIR /talentio-notifier
3
3
  ENV LANG C.UTF-8
4
4
  RUN apt update -qqy && apt install -qqy python git python-yaml
5
+ RUN useradd talentio && chown talentio /talentio-notifier
6
+ USER talentio
7
+
5
8
  RUN git clone https://github.com/emasaka/jpholidayp.git
6
9
  RUN gem install talentio-notifier -v "0.3.5"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- talentio-notifier (0.3.5)
4
+ talentio-notifier (0.3.6)
5
5
  activesupport
6
6
  faraday
7
7
  holiday_jp
@@ -12,30 +12,29 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (6.0.3.2)
15
+ activesupport (7.0.5.1)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
- i18n (>= 0.7, < 2)
18
- minitest (~> 5.1)
19
- tzinfo (~> 1.1)
20
- zeitwerk (~> 2.2, >= 2.2.2)
21
- concurrent-ruby (1.1.6)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ concurrent-ruby (1.2.2)
22
21
  diff-lcs (1.4.4)
23
22
  eventmachine (1.2.7)
24
- faraday (0.17.3)
23
+ faraday (0.17.6)
25
24
  multipart-post (>= 1.2, < 3)
26
25
  faraday_middleware (0.10.1)
27
26
  faraday (>= 0.7.4, < 1.0)
28
27
  faye-websocket (0.10.9)
29
28
  eventmachine (>= 0.12.0)
30
29
  websocket-driver (>= 0.5.1)
31
- gli (2.19.2)
32
- hashie (4.1.0)
33
- holiday_jp (0.7.1)
34
- i18n (1.8.5)
30
+ gli (2.21.0)
31
+ hashie (5.0.0)
32
+ holiday_jp (0.8.1)
33
+ i18n (1.14.1)
35
34
  concurrent-ruby (~> 1.0)
36
- minitest (5.14.1)
35
+ minitest (5.18.1)
37
36
  multi_json (1.15.0)
38
- multipart-post (2.1.1)
37
+ multipart-post (2.3.0)
39
38
  rake (12.3.3)
40
39
  rspec (3.9.0)
41
40
  rspec-core (~> 3.9.0)
@@ -62,14 +61,12 @@ GEM
62
61
  gli
63
62
  hashie
64
63
  websocket-driver
65
- thor (1.0.1)
66
- thread_safe (0.3.6)
67
- tzinfo (1.2.7)
68
- thread_safe (~> 0.1)
69
- websocket-driver (0.7.3)
64
+ thor (1.2.2)
65
+ tzinfo (2.0.6)
66
+ concurrent-ruby (~> 1.0)
67
+ websocket-driver (0.7.5)
70
68
  websocket-extensions (>= 0.1.0)
71
69
  websocket-extensions (0.1.5)
72
- zeitwerk (2.4.0)
73
70
 
74
71
  PLATFORMS
75
72
  ruby
data/Makefile CHANGED
@@ -1,4 +1,4 @@
1
- VERSION=0.3.5
1
+ VERSION=0.3.6
2
2
  build:
3
3
  docker build -t talentio-notifier .
4
4
 
@@ -1,6 +1,5 @@
1
1
  require 'time'
2
2
  require 'json'
3
- require 'pp'
4
3
  require 'slack-ruby-client'
5
4
  require 'holiday_jp'
6
5
  require 'active_support/core_ext/module'
@@ -14,24 +13,27 @@ module Talentio
14
13
 
15
14
  def nofity
16
15
  return unless notify?
17
-
18
16
  end
19
17
 
20
18
  def mention_id_from_evaluations(evaluations)
21
19
  members.map do |sm|
22
- evaluations.select {|e| !e['finished']}.map do |m|
23
- { id: "@#{sm['id']}", name: sm['name'] } if sm['real_name'] =~ /#{m["employee"]['lastName']}/ && sm['real_name'] =~ /#{m["employee"]['firstName']}/
20
+ evaluations.select { |e| !e['finished'] }.map do |m|
21
+ next unless sm['email'] == m['email']
22
+
23
+ { id: "@#{sm['id']}",
24
+ name: sm['name'] }
24
25
  end
25
26
  end.flatten.compact
26
27
  end
27
28
 
28
29
  private
30
+
29
31
  def members
30
32
  unless @members
31
33
  members = []
32
34
  next_cursor = nil
33
35
  loop do
34
- slack_users = client.users_list({limit: 1000, cursor: next_cursor})
36
+ slack_users = client.users_list({ limit: 1000, cursor: next_cursor })
35
37
  members << slack_users['members']
36
38
  next_cursor = slack_users['response_metadata']['next_cursor']
37
39
  break if next_cursor.empty?
@@ -47,11 +49,11 @@ module Talentio
47
49
  conf.token = ENV['SLACK_APIKEY']
48
50
  end
49
51
  @client = ::Slack::Web::Client.new
50
- if ENV['TALENTIO_TEST']
51
- @client.define_singleton_method(:chat_postMessage) do |m|
52
- puts m
53
- end
54
- end
52
+ if ENV['TALENTIO_TEST']
53
+ @client.define_singleton_method(:chat_postMessage) do |m|
54
+ puts m
55
+ end
56
+ end
55
57
  end
56
58
 
57
59
  @client
@@ -1,5 +1,5 @@
1
1
  module Talentio
2
2
  module Notifier
3
- VERSION = "0.3.5"
3
+ VERSION = '0.3.6'
4
4
  end
5
5
  end
data/manifests/cron.yml CHANGED
@@ -1,4 +1,4 @@
1
- apiVersion: batch/v1beta1
1
+ apiVersion: batch/v1
2
2
  kind: CronJob
3
3
  metadata:
4
4
  name: talentio-notifier-result
@@ -10,6 +10,13 @@ spec:
10
10
  spec:
11
11
  containers:
12
12
  - name: talentio-notifier
13
+ resources:
14
+ requests:
15
+ cpu: 50m
16
+ memory: 256M
17
+ limits:
18
+ cpu: 200m
19
+ memory: 512M
13
20
  image: pyama/talentio-notifier:0.3.5
14
21
  imagePullPolicy: Always
15
22
  env:
@@ -20,8 +27,6 @@ spec:
20
27
  secretKeyRef:
21
28
  name: talentio-notifier-secret
22
29
  key: talentio-apikey
23
- - name: LANG
24
- value: C.UTF-8
25
30
  - name: SLACK_APIKEY
26
31
  valueFrom:
27
32
  secretKeyRef:
@@ -33,7 +38,7 @@ spec:
33
38
  - "jpholidayp/jpholidayp || talentio-notifier remind-result"
34
39
  restartPolicy: Never
35
40
  ---
36
- apiVersion: batch/v1beta1
41
+ apiVersion: batch/v1
37
42
  kind: CronJob
38
43
  metadata:
39
44
  name: talentio-notifier-interview
@@ -46,6 +51,13 @@ spec:
46
51
  containers:
47
52
  - name: talentio-notifier
48
53
  image: pyama/talentio-notifier:0.3.5
54
+ resources:
55
+ requests:
56
+ cpu: 50m
57
+ memory: 256M
58
+ limits:
59
+ cpu: 200m
60
+ memory: 512M
49
61
  env:
50
62
  - name: TALENTIO_SKIP_STAGE
51
63
  value: "3"
@@ -56,8 +68,6 @@ spec:
56
68
  secretKeyRef:
57
69
  name: talentio-notifier-secret
58
70
  key: talentio-apikey
59
- - name: LANG
60
- value: C.UTF-8
61
71
  - name: SLACK_APIKEY
62
72
  valueFrom:
63
73
  secretKeyRef:
@@ -1,30 +1,30 @@
1
1
  require_relative 'lib/talentio/notifier/version'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
- spec.name = "talentio-notifier"
4
+ spec.name = 'talentio-notifier'
5
5
  spec.version = Talentio::Notifier::VERSION
6
- spec.authors = ["pyama86"]
7
- spec.email = ["pyama@pepabo.com"]
6
+ spec.authors = ['pyama86']
7
+ spec.email = ['www.kazu.com@gmail.com']
8
8
 
9
- spec.summary = %q{nofity command for talentio.}
10
- spec.description = %q{nofity command for talentio.}
11
- spec.homepage = "https://github.com/pyama86/talentio-notifier"
12
- spec.license = "MIT"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
9
+ spec.summary = 'nofity command for talentio.'
10
+ spec.description = 'nofity command for talentio.'
11
+ spec.homepage = 'https://github.com/pyama86/talentio-notifier'
12
+ spec.license = 'MIT'
13
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
14
14
 
15
- spec.metadata["homepage_uri"] = spec.homepage
15
+ spec.metadata['homepage_uri'] = spec.homepage
16
16
 
17
17
  # Specify which files should be added to the gem when it is released.
18
18
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
20
20
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
21
  end
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
- spec.require_paths = ["lib"]
24
- spec.add_dependency "thor"
25
- spec.add_dependency "faraday"
23
+ spec.require_paths = ['lib']
24
+ spec.add_dependency 'activesupport'
25
+ spec.add_dependency 'faraday'
26
+ spec.add_dependency 'holiday_jp'
26
27
  spec.add_dependency 'slack-api'
27
28
  spec.add_dependency 'slack-ruby-client'
28
- spec.add_dependency "holiday_jp"
29
- spec.add_dependency "activesupport"
29
+ spec.add_dependency 'thor'
30
30
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: talentio-notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyama86
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-27 00:00:00.000000000 Z
11
+ date: 2023-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: thor
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: slack-api
42
+ name: holiday_jp
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: slack-ruby-client
56
+ name: slack-api
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: holiday_jp
70
+ name: slack-ruby-client
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: activesupport
84
+ name: thor
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -96,7 +96,7 @@ dependencies:
96
96
  version: '0'
97
97
  description: nofity command for talentio.
98
98
  email:
99
- - pyama@pepabo.com
99
+ - www.kazu.com@gmail.com
100
100
  executables:
101
101
  - talentio-notifier
102
102
  extensions: []
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
- rubygems_version: 3.0.6
148
+ rubygems_version: 3.3.26
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: nofity command for talentio.