From c3bed3cc62ba480e4b57439cabef51f3343249ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Wed, 5 Apr 2017 23:47:57 -0700 Subject: [PATCH] Add a note about writing new mappers --- CONTRIBUTING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d23a75af..2af4908b6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,3 +58,15 @@ When running docker image via `make run-docker` with `DEBUG` make variable set to `true` volume mapping will be added (in read-only mode), so that unsee instance running inside the docker can read asset files from the sources directory. + +## Adding support for new Alertmanager release + +To support a new release that breaks API following changes needs to be done: + +* Verify that `GetVersion()` function can still correctly read remote + Alertmanager version via `/api/v1/status` endpoint, adapt it if needed. +* Create a new mapper package implementing unmarshaling of alerts and/or + silences (depending if both need a new code) under mapper/vXY (X major + Alertmanager version, Y minor version). +* Register new mapper in the `init()` function in the + `alertmanager/alertmanager.go` file.