Skip to content

Commit

Permalink
Merge pull request #11 from opensourcerouting/main
Browse files Browse the repository at this point in the history
Release 1.0.3
  • Loading branch information
RodrigoMNardi committed Nov 20, 2023
2 parents ca501da + 9c10968 commit 3144339
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ gem 'puma', '5.5.2'

gem 'rack', '2.2.3.1'

gem 'rubocop', '1.56.1', group: %w[development test], require: false
gem 'rubocop-performance', '1.7.1', group: %w[development test], require: false
gem 'rubocop', '0.89.1', group: %i[development test], require: false
gem 'rubocop-performance', '1.7.1', group: %i[development test], require: false

gem 'sinatra', '2.0.8.1'
gem 'slack-ruby-bot-server', '2.1.1'
Expand Down
33 changes: 14 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GEM
console (~> 1.10)
nio4r (~> 2.3)
timers (~> 4.1)
base64 (0.1.1)
base64 (0.2.0)
builder (3.2.4)
concurrent-ruby (1.2.2)
console (1.23.2)
Expand All @@ -44,7 +44,7 @@ GEM
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
factory_bot (6.3.0)
factory_bot (6.4.0)
activesupport (>= 5.0.0)
faker (3.2.2)
i18n (>= 1.8.11, < 2)
Expand Down Expand Up @@ -81,12 +81,10 @@ GEM
hashie (>= 3.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
kaminari-core (1.2.2)
kaminari-grape (1.0.1)
grape
kaminari-core (~> 1.0)
language_server-protocol (3.17.0.3)
minitest (5.20.0)
multi_json (1.15.0)
multipart-post (2.3.0)
Expand All @@ -98,7 +96,7 @@ GEM
otr-activerecord (2.0.3)
activerecord (>= 4.0, < 7.1)
hashie-forbidden_attributes (~> 0.1)
pagy (6.1.0)
pagy (6.2.0)
pagy_cursor (0.6.1)
activerecord (>= 5)
pagy (>= 6, < 7)
Expand All @@ -107,7 +105,7 @@ GEM
ast (~> 2.4.1)
racc
pg (1.2.3)
public_suffix (5.0.3)
public_suffix (5.0.4)
puma (5.5.2)
nio4r (~> 2.0)
racc (1.7.3)
Expand Down Expand Up @@ -145,20 +143,17 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.56.1)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
rubocop (0.89.1)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 2.7.1.1)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
regexp_parser (>= 1.7)
rexml
rubocop-ast (>= 0.3.0, < 1.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (0.8.0)
parser (>= 2.7.1.5)
rubocop-performance (1.7.1)
rubocop (>= 0.82.0)
ruby-progressbar (1.13.0)
Expand Down Expand Up @@ -199,7 +194,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unicode-display_width (2.5.0)
unicode-display_width (1.8.0)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand All @@ -223,7 +218,7 @@ DEPENDENCIES
rack (= 2.2.3.1)
rack-test
rspec
rubocop (= 1.56.1)
rubocop (= 0.89.1)
rubocop-performance (= 1.7.1)
simplecov
sinatra (= 2.0.8.1)
Expand Down
15 changes: 15 additions & 0 deletions lib/slack/slash_commands/bamboo_ci/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def run(params, user_id)
subscribe
when 'settings'
settings
when 'running'
running
when 'help'
Slack::BambooCi::Help.text
else
Expand Down Expand Up @@ -81,6 +83,19 @@ def settings
request('/slack/settings', payload)
end

def running
return 'GitHub name must be fill' if @param.nil? or @param.empty?

payload =
{
event: 'running',
github_user: @param,
slack_user_id: @user_id
}

request('/slack', payload)
end

def request(url, payload)
resp = post_request(URI("#{ENV.fetch('HTTP_URL', nil)}/#{url}"), body: payload)

Expand Down
3 changes: 3 additions & 0 deletions lib/slack/slash_commands/bamboo_ci/help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class Help
Enabled notification for PR 6 when it passes
Subscribed to status of all PRs by Github User mwinter-osr
/ci running <github_name>
Returns all running PRs for a GitHub User
/ci help
(i.e this)
'
Expand Down

0 comments on commit 3144339

Please sign in to comment.