Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop HipChat notifier #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## lastest(master branch)
- Drop HipChat notifier

## v0.8.0
- Upgrade Rails to v7.0
- Support Ruby 3.2
Expand Down
1 change: 0 additions & 1 deletion app/controllers/kuroko2/api/job_definitions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def definition_params(params)
:description,
:script,
:notify_cancellation,
:hipchat_room,
:hipchat_notify_finished,
:suspended,
:prevent_multi,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/kuroko2/job_definitions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def admin_id_params
end

def definition_params
params.require(:job_definition).permit(:name, :description, :script, :notify_cancellation, :hipchat_room, :hipchat_notify_finished, :suspended, :prevent_multi, :prevent_multi_on_failure, :hipchat_additional_text, :text_tags, :api_allowed, :slack_channel, :webhook_url)
params.require(:job_definition).permit(:name, :description, :script, :notify_cancellation, :hipchat_notify_finished, :suspended, :prevent_multi, :prevent_multi_on_failure, :hipchat_additional_text, :text_tags, :api_allowed, :slack_channel, :webhook_url)
end

def query_params
Expand Down
3 changes: 3 additions & 0 deletions app/models/kuroko2/job_definition.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
class Kuroko2::JobDefinition < Kuroko2::ApplicationRecord
include Kuroko2::TableNameCustomizable

# TODO: Drop column in the next release
self.ignored_columns += %i[hipchat_room]

module PreventMultiStatus
NONE = 0
WORKING_OR_ERROR = 1
Expand Down
5 changes: 1 addition & 4 deletions app/views/kuroko2/job_definitions/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
' Allow API execution of this job

label Notification
.form-group
label Hipchat Room Name
= form.text_field :hipchat_room, class: 'form-control', placeholder: 'Hipchat Room name'
.form-group
label Slack Channel
= form.text_field :slack_channel, class: 'form-control', placeholder: '#slack-channel'
Expand All @@ -36,7 +33,7 @@
.checkbox
label
= form.check_box :hipchat_notify_finished
' Notify all event to Slack/Hipchat/Webhook
' Notify all event to Slack/Webhook

.checkbox
label
Expand Down
10 changes: 4 additions & 6 deletions app/views/kuroko2/job_definitions/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,28 @@
h3 Options
h4 Notification
ul
- if @definition.hipchat_room.present? || @definition.slack_channel.present?
- if @definition.slack_channel.present?
- if @definition.hipchat_notify_finished?
li
'Notify all event to Slack/Hipchat/Webhook
'Notify all event to Slack/Webhook
ul
li webhook url: #{@definition.webhook_url}
li hipchat room: #{@definition.hipchat_room}
li slack channel: #{@definition.slack_channel}
- if @definition.hipchat_additional_text
li Failure notification text: #{@definition.hipchat_additional_text}
- else
li
'Notify failure event to Slack/Hipchat/Webhook
'Notify failure event to Slack/Webhook
ul
li webhook url: #{@definition.webhook_url}
li hipchat room: #{@definition.hipchat_room}
li slack channel: #{@definition.slack_channel}
- if @definition.hipchat_additional_text
li Failure notification text: #{@definition.hipchat_additional_text}

- if @definition.notify_cancellation
li Notify administrators when the job is cancelled by system.

- if !@definition.hipchat_room.present? && !@definition.slack_channel && [email protected]_cancellation
- if [email protected]_channel && [email protected]_cancellation
li None

h4 Next Job Execution
Expand Down
5 changes: 0 additions & 5 deletions app_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
mail_to: "[email protected]"
slack:
webhook_url: 'https://localhost/test/slack'
hipchat:
api_token: 'token'
options:
# api_version: 'v2'
# server_url: 'https://api.example.com'
webhook:
secret_token: '<%= ENV["WEBHOOK_SECRET_TOKEN"] %>'
api_basic_authentication_applications:
Expand Down
7 changes: 3 additions & 4 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- Name ... The name of the job.
- Description ... A description of the job.
- Script ... Definition of a workflow, will be explained later.
- Slack channel / Hipchat room ... A chat room to send a message.
- Slack channel ... A chat room to send a message.
- Next Job Execution ... Check if you want to prevent multiple instances of same jobs.

![](images/kuroko2_job_form.png)
Expand Down Expand Up @@ -92,16 +92,15 @@ Kuroko2 notifies job statuses by below methods.

- Mail
- Slack
- Hipchat
- Webhook

### Notifications Frequency Options

You can configurable notifications frequency.

#### Notify all event to Slack/Hipchat/Webhook
#### Notify all event to Slack/Webhook

If you enable this option, Kuroko2 notifies all events by Slack/Hipchat/Webhook (except Email) that jobs state is changed,
If you enable this option, Kuroko2 notifies all events by Slack/Webhook (except Email) that jobs state is changed,
Events is below.

- The job is launched
Expand Down
2 changes: 0 additions & 2 deletions kuroko2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ Gem::Specification.new do |s|
s.add_dependency 'rinku'
s.add_dependency 'visjs-rails'

s.add_dependency 'hipchat', '~> 1.3.0'

s.add_dependency 'the_garage'
s.add_dependency 'weak_parameters'

Expand Down
120 changes: 0 additions & 120 deletions lib/autoload/kuroko2/workflow/notifier/hipchat.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/kuroko2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
require 'retryable'
require 'faraday'
require 'html/pipeline'
require 'hipchat'
require 'omniauth-google-oauth2'
require 'omniauth/rails_csrf_protection'

Expand Down
3 changes: 0 additions & 3 deletions spec/dummy/config/kuroko2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ default: &default
mail_to: "[email protected]"
slack:
webhook_url: 'https://localhost/test/slack'
hipchat:
api_token: 'token'
options:
webhook:
secret_token: 'secret_token'
api_basic_authentication_applications:
Expand Down
7 changes: 0 additions & 7 deletions spec/requests/api/job_definitions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
description: "description",
script: "noop:",
notify_cancellation: 1,
hipchat_room: "",
hipchat_notify_finished: 1,
suspended: false,
prevent_multi: 1,
Expand Down Expand Up @@ -108,7 +107,6 @@
description: "description",
script: "noop:",
notify_cancellation: 1,
hipchat_room: "",
hipchat_notify_finished: 1,
suspended: false,
prevent_multi: 1,
Expand Down Expand Up @@ -232,7 +230,6 @@
description: "description",
script: "noop:",
notify_cancellation: 1,
hipchat_room: "",
hipchat_notify_finished: 1,
suspended: false,
prevent_multi: 1,
Expand Down Expand Up @@ -286,7 +283,6 @@
description: "description",
script: "echo: Hello",
notify_cancellation: 1,
hipchat_room: "",
hipchat_notify_finished: 1,
suspended: false,
prevent_multi: 1,
Expand All @@ -310,7 +306,6 @@
description: "description",
script: "echo: Hello",
notify_cancellation: 1,
hipchat_room: "",
hipchat_notify_finished: 1,
suspended: false,
prevent_multi: 1,
Expand Down Expand Up @@ -340,7 +335,6 @@
description: "description",
script: "noop",
notify_cancellation: 1,
hipchat_room: "",
hipchat_notify_finished: 1,
suspended: false,
prevent_multi: 1,
Expand All @@ -364,7 +358,6 @@
description: "description",
script: "echo: Hello",
notify_cancellation: 1,
hipchat_room: "",
hipchat_notify_finished: 1,
suspended: false,
prevent_multi: 1,
Expand Down
Loading