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

feat(hipchat): hipchat is now removed, this is a breaking change #2703

Open
wants to merge 5 commits 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
21 changes: 2 additions & 19 deletions alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
alertservice "github.com/influxdata/kapacitor/services/alert"
"github.com/influxdata/kapacitor/services/bigpanda"
"github.com/influxdata/kapacitor/services/discord"
"github.com/influxdata/kapacitor/services/hipchat"
"github.com/influxdata/kapacitor/services/httppost"
"github.com/influxdata/kapacitor/services/kafka"
"github.com/influxdata/kapacitor/services/mqtt"
Expand Down Expand Up @@ -339,24 +338,8 @@ func newAlertNode(et *ExecutingTask, n *pipeline.AlertNode, d NodeDiagnostic) (a
n.IsStateChangesOnly = true
}

for _, hc := range n.HipChatHandlers {
c := hipchat.HandlerConfig{
Room: hc.Room,
Token: hc.Token,
}
h := et.tm.HipChatService.Handler(c, ctx...)
an.handlers = append(an.handlers, h)
}
if len(n.HipChatHandlers) == 0 && (et.tm.HipChatService != nil && et.tm.HipChatService.Global()) {
c := hipchat.HandlerConfig{}
h := et.tm.HipChatService.Handler(c, ctx...)
an.handlers = append(an.handlers, h)
}
// If HipChat has been configured with state changes only set it.
if et.tm.HipChatService != nil &&
et.tm.HipChatService.Global() &&
et.tm.HipChatService.StateChangesOnly() {
n.IsStateChangesOnly = true
for range n.HipChatHandlers {
an.handlers = append(an.handlers, et.tm.RemovedService)
}

for _, k := range n.KafkaHandlers {
Expand Down
3 changes: 3 additions & 0 deletions alert/topics.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ type bufHandler struct {
}

func newHandler(h Handler, bufferSize int) *bufHandler {
if h == nil {
panic("here h is nil")
}
if bufferSize < MinimumEventBufferSize {
bufferSize = DefaultEventBufferSize
}
Expand Down
10 changes: 8 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ def run_tests(race, parallel, timeout, verbose):
if timeout is not None:
logging.info("Using timeout: {}".format(timeout))



test_command = "go test --failfast"
if verbose:
test_command += " -v"
Expand All @@ -209,10 +211,14 @@ def run_tests(race, parallel, timeout, verbose):
test_command += " -parallel {}".format(parallel)
if timeout is not None:
test_command += " -timeout {}".format(timeout)
test_command += " ./..."
test_command += " -p 1 {}"
logging.info("Running tests...")
logging.info("Test command: " + test_command)
output = run(test_command, printOutput=logging.getLogger().getEffectiveLevel() == logging.DEBUG)
packages = run("go list ./...", printOutput=logging.getLogger().getEffectiveLevel() == logging.DEBUG)

for package in packages.split():
if package.strip() != "":
run(test_command.format(package), printOutput=logging.getLogger().getEffectiveLevel() == logging.DEBUG)
return True

def package_udfs(version, dist_dir):
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BUILD_NUM=${BUILD_NUM-$RANDOM}
# Home dir of the docker user
HOME_DIR=/root

GO_VERSION=1.17.1
GO_VERSION=1.18.4

imagename=kapacitor-builder-img-$BUILD_NUM

Expand Down
2 changes: 1 addition & 1 deletion checkfmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ for file in $(go list -f '{{$dir := .Dir}}{{range .GoFiles}}{{printf "%s/%s\n" $
# Only print this once.
HAS_FMT_ERR=1
echo 'Commit includes files that are not gofmt-ed' && \
echo 'run "make fmt"' && \
echo 'run "fmt ./..."' && \
echo ''
fi
echo "$FMT_OUT" # Print output and continue, so developers don't fix one file at a t
Expand Down
21 changes: 0 additions & 21 deletions etc/kapacitor/kapacitor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -512,27 +512,6 @@ default-retention-policy = ""
# meaning alerts will only be sent if the alert state changes.
state-changes-only = false

[hipchat]
# Configure HipChat.
enabled = false
# The HipChat API URL. Replace subdomain with your
# HipChat subdomain.
# url = "https://subdomain.hipchat.com/v2/room"
# Visit https://www.hipchat.com/docs/apiv2
# for information on obtaining your room id and
# authentication token.
# Default room for messages
room = ""
# Default authentication token
token = ""
# If true then all alerts will be sent to HipChat
# without explicitly marking them in the TICKscript.
global = false
# Only applies if global is true.
# Sets all alerts in state-changes-only mode,
# meaning alerts will only be sent if the alert state changes.
state-changes-only = false

[[kafka]]
# Configure Kafka
enabled = false
Expand Down
Loading