Skip to content

Commit

Permalink
Update to v0.16.0
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
  • Loading branch information
simonpasquier committed Jan 21, 2019
2 parents 34c1125 + 73bdd96 commit 9de328f
Show file tree
Hide file tree
Showing 770 changed files with 121,898 additions and 8,498 deletions.
61 changes: 33 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
---
version: 2
version: 2.1

jobs:
test:
executors:
# Whenever the Go version is updated here, .travis.yml and .promu.yml
# should also be updated.
golang:
docker:
- image: circleci/golang:1.10
- image: circleci/golang:1.11
# errcheck requires to be executed from GOPATH for now.
working_directory: /go/src/github.com/prometheus/alertmanager

jobs:
test:
executor: golang

steps:
- checkout
- setup_remote_docker
- run: make promu
- run: make
- run: git diff --exit-code
- store_artifacts:
path: alertmanager
destination: /build/alertmanager
- store_artifacts:
path: amtool
destination: /build/amtool
- run: rm -v alertmanager amtool

build:
Expand All @@ -26,15 +40,12 @@ jobs:
root: .
paths:
- .build
- store_artifacts:
path: .build
destination: /build

docker_hub_master:
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/prometheus/alertmanager

environment:
DOCKER_IMAGE_NAME: prom/alertmanager
QUAY_IMAGE_NAME: quay.io/prometheus/alertmanager
executor: golang

steps:
- checkout
Expand All @@ -43,22 +54,16 @@ jobs:
at: .
- run: ln -s .build/linux-amd64/alertmanager alertmanager
- run: ln -s .build/linux-amd64/amtool amtool
- run: make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME
- run: make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME
- run: make docker
- run: make docker DOCKER_REPO=quay.io/prometheus
- run: docker images
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
- run: docker push $DOCKER_IMAGE_NAME
- run: docker push $QUAY_IMAGE_NAME
- run: make docker-publish
- run: make docker-publish DOCKER_REPO=quay.io/prometheus

docker_hub_release_tags:
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/prometheus/alertmanager

environment:
DOCKER_IMAGE_NAME: prom/alertmanager
QUAY_IMAGE_NAME: quay.io/prometheus/alertmanager
executor: golang

steps:
- checkout
Expand All @@ -77,17 +82,17 @@ jobs:
destination: releases
- run: ln -s .build/linux-amd64/alertmanager alertmanager
- run: ln -s .build/linux-amd64/amtool amtool
- run: make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
- run: make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
- run: make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG
- run: make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG DOCKER_REPO=quay.io/prometheus
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
- run: |
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
docker tag "$DOCKER_IMAGE_NAME:$CIRCLE_TAG" "$DOCKER_IMAGE_NAME:latest"
docker tag "$QUAY_IMAGE_NAME:$CIRCLE_TAG" "$QUAY_IMAGE_NAME:latest"
make docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG"
make docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=quay.io/prometheus
fi
- run: docker push $DOCKER_IMAGE_NAME
- run: docker push $QUAY_IMAGE_NAME
- run: make docker-publish
- run: make docker-publish DOCKER_REPO=quay.io/prometheus

workflows:
version: 2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
!/circle.yml
!/.travis.yml
!/.promu.yml
!/api/v2/openapi.yaml
4 changes: 4 additions & 0 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
go:
# Whenever the Go version is updated here, .travis.yml and
# .circle/config.yml should also be updated.
version: 1.11
repository:
path: github.com/prometheus/alertmanager
build:
Expand Down
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
sudo: false
language: go
go_import_path: github.com/prometheus/alertmanager

services:
- docker

# Whenever the Go version is updated here, .circleci/config.yml and .promu.yml
# should also be updated.
go:
- 1.10.x
- 1.11.x

script:
# test front-end
- make clean
- cd ui/app/ && make && cd ../..
- make assets
- make assets apiv2
- git diff --exit-code
# test back-end
- make
- git diff --exit-code
55 changes: 54 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
## 0.16.0 / 2019-01-17

This release introduces a new API v2, fully generated via the OpenAPI project
[1]. At the same time with this release the previous API v1 is being
deprecated. API v1 will be removed with Alertmanager release v0.18.0.

* [CHANGE] Deprecate API v1
* [CHANGE] Remove `api/v1/alerts/groups` GET endpoint (#1508 & #1525)
* [CHANGE] Revert Alertmanager working directory changes in Docker image back to `/alertmanager` (#1435)
* [CHANGE] Using the recommended label syntax for maintainer in Dockerfile (#1533)
* [CHANGE] Change `alertmanager_notifications_total` to count attempted notifications, not only successful ones (#1578)
* [CHANGE] Run as nobody inside container (#1586)
* [CHANGE] Support `w` for weeks when creating silences, remove `y` for year (#1620)
* [FEATURE] Introduce OpenAPI generated API v2 (#1352)
* [FEATURE] Lookup parts in strings using regexp.MatchString in templates (#1452)
* [FEATURE] Support image/thumb url in attachment in Slack notifier (#1506)
* [FEATURE] Support custom TLS certificates for the email notifier (#1528)
* [FEATURE] Add support for images and links in the PagerDuty notification config (#1559)
* [FEATURE] Add support for grouping by all labels (#1588)
* [FEATURE] [amtool] Add timeout support to amtool commands (#1471)
* [FEATURE] [amtool] Added `config routes` tools for vizualization and testing routes (#1511)
* [FEATURE] [amtool] Support adding alerts using amtool (#1461)
* [ENHANCEMENT] Add support for --log.format (#1658)
* [ENHANCEMENT] Add CORS support to API v2 (#1667)
* [ENHANCEMENT] Support HTML, URL title and custom sounds for Pushover (#1634)
* [ENHANCEMENT] Update Alert compact view (#1698)
* [ENHANCEMENT] Support adding custom fields to VictorOps notifications (#1420)
* [ENHANCEMENT] Add help link in UI to Alertmanager documentation (#1522)
* [ENHANCEMENT] Enforce HTTP or HTTPS URLs in Alertmanager config (#1567)
* [ENHANCEMENT] Make OpsGenie API Key a templated string (#1594)
* [ENHANCEMENT] Add name, value and SlackConfirmationField to action in Slack notifier (#1557)
* [ENHANCEMENT] Show more alert information on silence form and silence view pages (#1601)
* [ENHANCEMENT] Add cluster peers DNS refresh job (#1428)
* [BUGFIX] Fix unmarshalling of secret URLs in config (#1663)
* [BUGFIX] Do not write groupbyall and groupby when marshaling config (#1665)
* [BUGFIX] Make a copy of firing alerts with EndsAt=0 when flushing (#1686)
* [BUGFIX] Respect regex matchers when recreating silences in UI (#1697)
* [BUGFIX] Change DefaultGlobalConfig to a function in Alertmanager configuration (#1656)
* [BUGFIX] Fix email template typo in alert-warning style (#1421)
* [BUGFIX] Fix silence redirect on silence creation UI page (#1548)
* [BUGFIX] Add missing `callback_id` parameter in Slack notifier (#1592)
* [BUGFIX] Throw error if no auth mechanism matches in email notifier (#1608)
* [BUGFIX] Use quoted-printable transfer encoding for the email notifier (#1609)
* [BUGFIX] Do not merge expired gossip messages (#1631)
* [BUGFIX] Fix "PLAIN" auth during notification via smtp-over-tls on port 465 (#1591)
* [BUGFIX] [amtool] Support for assuming first label is alertname in silence add and query (#1693)
* [BUGFIX] [amtool] Support assuming first label is alertname in alert query with matchers (#1575)
* [BUGFIX] [amtool] Fix config path check in amtool (#1538)
* [BUGFIX] [amtool] Fix rfc3339 example texts (#1526)
* [BUGFIX] [amtool] Fixed issue with loading path of a default configs (#1529)

[1] https://github.com/prometheus/alertmanager#api

## 0.15.3 / 2018-11-09

* [BUGFIX] Fix alert merging supporting both empty and set EndsAt property for firing alerts send by Prometheus (#1611)
Expand All @@ -24,7 +77,7 @@
* [BUGFIX] Catch templating errors in Wechat Notify (#1436)
* [BUGFIX] Fail when no private address can be found for cluster (#1437)
* [BUGFIX] Make sure we don't miss the first pushPull when joining cluster (#1456)
* [BUGFIX] Fix concurrent read and wirte group error in dispatch (#1447)
* [BUGFIX] Fix concurrent read and write group error in dispatch (#1447)

## 0.15.0 / 2018-06-22

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.rhel7
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM rhel7:7-released
LABEL maintainer="OpenShift Development <dev@lists.openshift.redhat.com>" \
com.redhat.component="golang-github-prometheus-alertmanager-docker" \
name="openshift3/prometheus-alertmanager" \
version="v0.15.3" \
version="v0.16.0" \
architecture=x86_64

# The appropriate yum repos are enabled at build time by the CI system
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Stuart Nelson <stuartnelson3@gmail.com>
* Max Inden <IndenML@gmail.com>
74 changes: 43 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,61 @@

include Makefile.common

FRONTEND_DIR = $(BIN_DIR)/ui/app
FRONTEND_DIR = $(BIN_DIR)/ui/app
DOCKER_IMAGE_NAME ?= alertmanager
ERRCHECK_BINARY := $(FIRST_GOPATH)/bin/errcheck

ifdef DEBUG
bindata_flags = -debug
endif

STATICCHECK_IGNORE = \
github.com/prometheus/alertmanager/notify/notify.go:SA6002
STATICCHECK_IGNORE =

# Go modules needs the bzr binary because of the dependency on launchpad.net/gocheck.
$(eval $(call PRECHECK_COMMAND_template,bzr))
PRECHECK_OPTIONS_bzr = version

.PHONY: build-all
# Will build both the front-end as well as the back-end
build-all: assets build
build-all: assets apiv2 build

assets: go-bindata ui/bindata.go template/internal/deftmpl/bindata.go
assets: ui/app/script.js ui/app/index.html ui/app/lib template/default.tmpl
cd $(PREFIX)/asset && $(GO) generate
@$(GOFMT) -w ./asset

go-bindata:
-@$(GO) get -u github.com/jteeuwen/go-bindata/...
ui/app/script.js: $(shell find ui/app/src -iname *.elm) api/v2/openapi.yaml
cd $(FRONTEND_DIR) && $(MAKE) script.js

template/internal/deftmpl/bindata.go: template/default.tmpl
@go-bindata $(bindata_flags) -mode 420 -modtime 1 -pkg deftmpl -o template/internal/deftmpl/bindata.go template/default.tmpl
@$(GO) fmt ./template/internal/deftmpl
.PHONY: apiv2
apiv2: api/v2/models api/v2/restapi test/with_api_v2/api_v2_client/models test/with_api_v2/api_v2_client/client

ui/bindata.go: ui/app/script.js ui/app/index.html ui/app/lib
# Using "-mode 420" and "-modtime 1" to make assets make target deterministic.
# It sets all file permissions and time stamps to 420 and 1
@go-bindata $(bindata_flags) -mode 420 -modtime 1 -pkg ui -o \
ui/bindata.go ui/app/script.js \
ui/app/index.html \
ui/app/favicon.ico \
ui/app/lib/...
@$(GO) fmt ./ui
SWAGGER = docker run \
--user=$(shell id -u $(USER)):$(shell id -g $(USER)) \
--rm \
-v $(shell pwd):/go/src/github.com/prometheus/alertmanager \
-w /go/src/github.com/prometheus/alertmanager quay.io/goswagger/swagger:0.16.0

ui/app/script.js: $(shell find ui/app/src -iname *.elm)
cd $(FRONTEND_DIR) && $(MAKE) script.js
api/v2/models api/v2/restapi: api/v2/openapi.yaml
-rm -r api/v2/{models,restapi}
$(SWAGGER) generate server -f api/v2/openapi.yaml --exclude-main -A alertmanager --target api/v2/

.PHONY: proto
proto:
scripts/genproto.sh
test/with_api_v2/api_v2_client/models test/with_api_v2/api_v2_client/client: api/v2/openapi.yaml
-rm -r test/with_api_v1/api_v2_client; mkdir -p test/with_api_v2/api_v2_client
$(SWAGGER) generate client -f api/v2/openapi.yaml --target test/with_api_v2/api_v2_client

.PHONY: clean
clean:
rm template/internal/deftmpl/bindata.go
rm ui/bindata.go
cd $(FRONTEND_DIR) && $(MAKE) clean
- rm -f asset/assets_vfsdata.go
- rm -r api/v2/models api/v2/restapi test/with_api_v2/api_v2_client/models test/with_api_v2/api_v2_client/client
- cd $(FRONTEND_DIR) && $(MAKE) clean

.PHONY: test
test: common-test $(ERRCHECK_BINARY)
@echo ">> running errcheck with exclude file scripts/errcheck_excludes.txt"
$(ERRCHECK_BINARY) -verbose -exclude scripts/errcheck_excludes.txt -ignoretests ./...

$(ERRCHECK_BINARY):
# Get errcheck from a temporary directory to avoid modifying the local go.{mod,sum}.
# See https://github.com/golang/go/issues/27643.
tmpModule=$$(mktemp -d 2>&1) && \
mkdir -p $${tmpModule}/staticcheck && \
cd "$${tmpModule}"/staticcheck && \
GO111MODULE=on $(GO) mod init example.com/staticcheck && \
GO111MODULE=on GOOS= GOARCH= $(GO) get -u github.com/kisielk/errcheck && \
rm -rf $${tmpModule};

0 comments on commit 9de328f

Please sign in to comment.