Remove hipchat (#5486)

* Remove hipchat
* Remove hipchat logo

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
This commit is contained in:
Naka Masato
2023-07-21 18:23:15 +09:00
committed by GitHub
parent e4302d9163
commit c8eb445ce9
4 changed files with 1 additions and 60 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -15,7 +15,7 @@ describe("Create Destination", () => {
cy.getByTestId("PreviewItem") cy.getByTestId("PreviewItem")
.then($previewItems => Cypress.$.map($previewItems, item => Cypress.$(item).attr("data-test-type"))) .then($previewItems => Cypress.$.map($previewItems, item => Cypress.$(item).attr("data-test-type")))
.then(availableTypes => expect(availableTypes).not.to.contain.members(this.deprecatedTypes)); .then(availableTypes => expect(availableTypes).not.to.contain.oneOf(this.deprecatedTypes));
cy.getByTestId("CreateSourceDialog").should("contain", "Email"); cy.getByTestId("CreateSourceDialog").should("contain", "Email");
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting

View File

@@ -1,58 +0,0 @@
import logging
import requests
from redash.destinations import BaseDestination, register
from redash.models import Alert
from redash.utils import deprecated, json_dumps
colors = {
Alert.OK_STATE: "green",
Alert.TRIGGERED_STATE: "red",
Alert.UNKNOWN_STATE: "yellow",
}
@deprecated()
class HipChat(BaseDestination):
@classmethod
def configuration_schema(cls):
return {
"type": "object",
"properties": {
"url": {
"type": "string",
"title": "HipChat Notification URL (get it from the Integrations page)",
}
},
"secret": ["url"],
"required": ["url"],
}
@classmethod
def icon(cls):
return "fa-comment-o"
def notify(self, alert, query, user, new_state, app, host, options):
try:
alert_url = "{host}/alerts/{alert_id}".format(host=host, alert_id=alert.id)
query_url = "{host}/queries/{query_id}".format(host=host, query_id=query.id)
message = '<a href="{alert_url}">{alert_name}</a> changed state to {new_state} (based on <a href="{query_url}">this query</a>).'.format(
alert_name=alert.name,
new_state=new_state.upper(),
alert_url=alert_url,
query_url=query_url,
)
data = {"message": message, "color": colors.get(new_state, "green")}
headers = {"Content-Type": "application/json"}
response = requests.post(options["url"], data=json_dumps(data), headers=headers, timeout=5.0)
if response.status_code != 204:
logging.error("Bad status code received from HipChat: %d", response.status_code)
except Exception:
logging.exception("HipChat Send ERROR.")
register(HipChat)

View File

@@ -355,7 +355,6 @@ default_destinations = [
"redash.destinations.email", "redash.destinations.email",
"redash.destinations.slack", "redash.destinations.slack",
"redash.destinations.webhook", "redash.destinations.webhook",
"redash.destinations.hipchat",
"redash.destinations.mattermost", "redash.destinations.mattermost",
"redash.destinations.chatwork", "redash.destinations.chatwork",
"redash.destinations.pagerduty", "redash.destinations.pagerduty",