Skip to content

Commit

Permalink
fix: refining incoming actions (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
armiiller authored Aug 15, 2022
1 parent 44084e6 commit 57f6e4f
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
pager_tree-integrations (1.1.0)
pager_tree-integrations (1.1.1)
rails (>= 7.0.1)

GEM
Expand Down
2 changes: 1 addition & 1 deletion app/models/pager_tree/integrations/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def adapter_incoming_can_defer?
true
end

# Returns :create, :acknowledge, :resolve, or :other
# Returns :create, :resolve, or :other
def adapter_action
:other
end
Expand Down
2 changes: 0 additions & 2 deletions app/models/pager_tree/integrations/logic_monitor/v3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ def adapter_action
case alert_status
when "active", "test"
:create
# when "ack"
# :acknowledge
when "clear"
:resolve
else
Expand Down
2 changes: 0 additions & 2 deletions app/models/pager_tree/integrations/new_relic/v3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def adapter_action

if event_type == "INCIDENT_OPEN" || (event_type == "INCIDENT" && current_state == "open")
:create
# elsif event_type == "INCIDENT_ACKNOWLEDGED" || (event_type == "INCIDENT" && current_state == "acknowledged")
# :acknowledge
elsif event_type == "INCIDENT_RESOLVED" || (event_type == "INCIDENT" && current_state == "closed")
:resolve
else
Expand Down
2 changes: 0 additions & 2 deletions app/models/pager_tree/integrations/webhook/v3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ def adapter_action
case adapter_incoming_request_params.dig("event_type").to_s.downcase.strip
when "create"
:create
# when "acknowledge"
# :acknowledge
when "resolve"
:resolve
else
Expand Down
2 changes: 0 additions & 2 deletions app/models/pager_tree/integrations/zendesk/v3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ def adapter_action
case adapter_incoming_request_params.dig("event_type")
when "create"
:create
when "acknowledge"
:acknowledge
when "resolve"
:resolve
else
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/integration/templates/model.rb.tt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module PagerTree::Integrations
adapter_incoming_request_params.dig("id")
end

# TODO: Returns :create, :acknowledge, :resolve, or :other
# TODO: Returns :create, :resolve, or :other
def adapter_action
:other
end
Expand Down

0 comments on commit 57f6e4f

Please sign in to comment.