Commit Graph

705 Commits

Author SHA1 Message Date
Łukasz Mierzwa
c7fb8db98d Drop Release() from SilenceMapper
Not used
2018-01-22 11:26:36 -08:00
Łukasz Mierzwa
1f89ba05fe Migrate rest of the code to new mapper and transport packages 2018-01-22 11:26:36 -08:00
Łukasz Mierzwa
6124196b0f Finish refactoring mapper package
Fix bugs, add docstrings and let each mapper give us full url since it doesn't handle any http requests now (it just maps text to objects now)
2018-01-22 11:26:36 -08:00
Łukasz Mierzwa
2cf9253d3c Refactor transport package
With this change we'll initialize Transport object for each Alertmanager and just call Read() on it when we need to use this transport to read from upstream Alertmanager
2018-01-22 11:26:35 -08:00
Łukasz Mierzwa
0b30a23c2a Refactor mapper package responsibilities
Mapper should only take input, decode it and map onto internal model instances
2018-01-22 11:26:35 -08:00
Łukasz Mierzwa
1981898bd0 Merge pull request #218 from cloudflare/travis-build-only-master
Tell Travis CI to only build on pushes to the master branch
2018-01-21 17:47:08 -08:00
Łukasz Mierzwa
15a8446588 Tell Travis CI to only build on pushes to the master branch
I've noticed that Travis runs 2 builds for each open PR, that's because one build is triggered on push to a branch and another on opening  the PR. It's possible to disable both triggers in Travis web UI but both option are desired, it's just that the push trigger should only fire on a push to the master so that we always run a build after any merge

See travis-ci/travis-ci#1147 for details
2018-01-21 17:35:12 -08:00
Łukasz Mierzwa
ab62379846 Merge pull request #217 from cloudflare/slim-travis
Make .travis.yml more DRY
2018-01-21 17:33:34 -08:00
Łukasz Mierzwa
fafe6d7bf1 Move lint docs stage closer to other lint stages 2018-01-20 23:19:58 -08:00
Łukasz Mierzwa
4fb7afa0bb Use 'generic' language for docker stage 2018-01-20 23:08:01 -08:00
Łukasz Mierzwa
33f5d91044 Drop go_import_path from .travis.yml
Travis linter doesn't recognize this key and it's a global, which makes no sense with stages and anchors
2018-01-20 23:07:35 -08:00
Łukasz Mierzwa
a01cfd0f95 Use YAML anchors to deduplicate common stage variables 2018-01-20 23:05:44 -08:00
Łukasz Mierzwa
28e656fb48 Merge pull request #215 from cloudflare/markdown-lint
Markdown linter
2018-01-20 18:00:06 -08:00
Łukasz Mierzwa
68d58a24c1 Fix docs issues found by markdown linter 2018-01-20 13:10:31 -08:00
Łukasz Mierzwa
25e796f2ac Add a make target and Travis CI stage for linting docs
Nobody wants borked markdown syntax in docs
2018-01-20 12:54:45 -08:00
Łukasz Mierzwa
764ccc2147 Merge pull request #214 from cloudflare/setup-proxy-via-env
Add a 'simplified mode' for configuration that can be used with only …
2018-01-15 16:58:33 -08:00
Łukasz Mierzwa
36178ee1ba Add a 'simplified mode' for configuration that can be used with only one Alertmanager instance 2018-01-14 21:15:43 -08:00
Łukasz Mierzwa
63a0799263 Merge pull request #211 from cloudflare/am-0.13.0
Add Alertmanager 0.13.0 mock resposes for testing
2018-01-13 11:13:31 -08:00
Łukasz Mierzwa
c7a1c9b865 Add Alertmanager 0.13.0 mock resposes for testing
0.13.0 was released, add it to the list of tested versions
2018-01-12 15:47:38 -08:00
Łukasz Mierzwa
cfdd38c312 Merge pull request #209 from cloudflare/update-package-lock
Update package-lock.json using latest LTS nodejs/npm
2018-01-08 17:47:53 -08:00
Łukasz Mierzwa
4584a046ea Update package-lock.json using latest LTS nodejs/npm
This adds optional deps that only work on OSX back to the lock file, previous npm versions were only adding it when run on OSX, now that it's fixed we should update the lock file so it doesn't show any diff when working on OSX
2018-01-08 16:25:19 -08:00
Łukasz Mierzwa
a3af1ec32d Merge pull request #202 from cloudflare/proxy
Add support for proxying user connection to Alertmanager
2018-01-08 16:23:50 -08:00
Łukasz Mierzwa
983c7f50ee Refactor NewAlertmanager() to not register new instance by default
This makes it easier to test code
2018-01-08 14:28:28 -08:00
Łukasz Mierzwa
efda91f542 Rename Alertmanager.Timeout -> Alertmanager.RequestTimeout 2018-01-08 13:51:38 -08:00
Łukasz Mierzwa
c8b7b3bcd0 Implement functional options, this time for real 2018-01-08 13:30:46 -08:00
Łukasz Mierzwa
2176c44ba7 Drop names in slices 2018-01-06 17:39:19 -08:00
Łukasz Mierzwa
6aec8bf5d1 Cleanup path setup a bit 2018-01-06 17:35:02 -08:00
Łukasz Mierzwa
db0d86f339 Don't modify path in the proxy, strip prefix in the handler 2018-01-06 17:28:03 -08:00
Łukasz Mierzwa
3eb28b3a6f Use functional options pattern when creating Alertmanager instances 2018-01-06 17:19:05 -08:00
Łukasz Mierzwa
b6dd993c2b Add support for proxying user connection to Alertmanager
Fixes #190.

With this feature unsee can be configured to proxy requests to selected Alertmanager instances, if it's enabled unsee silence form will send a request via unsee rather than directly. This allows users to manage silences in environments where they have access to unsee but not to Alertmanager. Only silences endpoints on Alertmanager API are proxied.
2018-01-03 16:17:58 -08:00
Łukasz Mierzwa
4667b9e34c Merge pull request #206 from cloudflare/silence-id
Show silence ID in the UI
2018-01-03 16:17:03 -08:00
Łukasz Mierzwa
2c53b323aa Add missing depenency for test-js
npm install isn't run when test-js is executed on a fresh clone, so travis fails
2018-01-03 16:03:18 -08:00
Łukasz Mierzwa
c6288d27a2 Show silence ID in the UI
This adds silence ID to the list of rendered silence elements, clicking on it will allow to copy it to the clipboard. Fixes #203
2018-01-03 13:15:19 -08:00
Łukasz Mierzwa
f174ff2571 Merge pull request #205 from cloudflare/am-0.12
Add mock files for Alertmanager 0.12.0
2018-01-03 13:07:48 -08:00
Łukasz Mierzwa
a3fdaff4ba Add mock files for Alertmanager 0.12.0
Adds 0.12.0 to test coverage
2017-12-22 22:15:38 +01:00
Łukasz Mierzwa
d9b80930ff Merge pull request #201 from cloudflare/3-stage-build
3 stage build
2017-12-05 09:47:58 -08:00
Łukasz Mierzwa
e11dde89c5 Disable default install targets for Travis, this adds 2x ~17s since travis runs npm install and then we run it too 2017-12-05 09:23:18 -08:00
Łukasz Mierzwa
ffa0caf6eb Split build into NodeJS and Go parts
Go docker image uses old nodejs, split build into 2 stages so we can have better control over used nodejs and Go images
2017-12-05 09:23:18 -08:00
Łukasz Mierzwa
3e6343daa9 Cleanup make targets a bit
Reduce number of targets used internally for building and use less confusing names. Add webpack target that will be needed for node only docker build stage.
2017-12-05 09:23:18 -08:00
Łukasz Mierzwa
c6ee74ab91 Merge pull request #200 from cloudflare/sanitize-sentry-secrets
Hide sentry secrets in startup logs
2017-12-05 07:43:22 -08:00
Łukasz Mierzwa
1789e43631 Hide sentry secrets in startup logs
No need to leak sentry secrets in the internal DSN
2017-12-04 16:10:19 -08:00
Łukasz Mierzwa
af7db67791 Merge pull request #199 from cloudflare/travis-build-stages
Travis build stages
2017-12-04 14:08:39 -08:00
Łukasz Mierzwa
336f74e48e Use travis build stages
Split each test target into a dedicated job, add docker build tests
2017-12-04 13:17:19 -08:00
Łukasz Mierzwa
52f0f42aa5 Split test and lint make targets, add a target for generating fake binary assets 2017-12-04 13:17:19 -08:00
Łukasz Mierzwa
527dbd48b0 Merge pull request #197 from cloudflare/viper
Rewrite flags & env handling, add a config file
2017-12-04 08:22:46 -08:00
Łukasz Mierzwa
188b02695c Fix wrong defaults in config docs 2017-12-03 11:55:59 -08:00
Łukasz Mierzwa
4b8a93426f Add docs on passing config file path to unsee 2017-12-03 11:50:15 -08:00
Łukasz Mierzwa
99507cf023 Allow --config.* flags to be also passed via env variables 2017-12-03 11:46:14 -08:00
Łukasz Mierzwa
76b4012db7 Cleanup Go dep files and update deps 2017-12-03 11:38:22 -08:00
Łukasz Mierzwa
7fa4230a1d More config test coverage for both legacy and current paths 2017-12-03 11:34:12 -08:00