53 Commits

Author SHA1 Message Date
Łukasz Mierzwa
0c94d7f5ba feat(backend): add alertmanager v0.17.0 mock files for testing
file:// scheme is not supported so we need some changes to always use mocks
2019-05-10 21:08:16 +01:00
Łukasz Mierzwa
9f2492d30e chore(backend): switch jarcoal/httpmock imports to use github
This is to use v1.0.0 that was just released, gopkg.in doesn't work anymore
2019-03-17 20:17:20 +01:00
Łukasz Mierzwa
af9e55032e feat(api): use metrics to detect Alertmanager version
We need to know upstream version to decide which API endpoints we can use, metrics don't change between versions so they allow us to do that without any prior knowlage or assumptions
2019-01-30 17:57:02 +00:00
Łukasz Mierzwa
a3ef1dd40e chore(api): drop counters from API response
Not used by any UI code, remove it.
2019-01-05 11:52:45 +00:00
Łukasz Mierzwa
f03887b56c feat(api): add @silence_id filter
This allows to filter alerts by silence ID, only matches silenced alerts
2018-10-08 23:02:38 +01:00
Łukasz Mierzwa
9c16ffa447 chore(project): rename from unsee to karma
Fixes prymitive/unsee#23
2018-09-09 14:12:26 +01:00
Łukasz Mierzwa
129ffb7e17 fix(test): use httptest.newRequest instead of (incorrect) http.newRequest
httptest.newRequest is suppose to be used for testing request handing, http.newRequest is for preparing outgoing requests, this allows to fix cache key selection and increase test coverage
2018-08-21 09:35:49 +01:00
Łukasz Mierzwa
c61e3fe945 fix(style): check for json.Unmarshal error returns in tests
Also drop .tests dir, not needed anymore
2018-08-11 22:40:55 +01:00
Łukasz Mierzwa
32e3f946ab refactor(backend): turn index.html back into Go template
There are a few config keys that needs to be passed to ui code before react app starts, we'll render them in the index.html as template
2018-07-19 23:38:11 +02:00
Łukasz Mierzwa
be8806c22f feat(ui): remove old /help view, this is now fully managed by the ui 2018-07-19 23:38:11 +02:00
Łukasz Mierzwa
8b060054d7 refactor(api): expect filter query args as an array instead of a single string
Using a single string separated by ',' means that we cannot use ',' in labels. Use arrays instead to fix that
2018-07-19 23:38:11 +02:00
Łukasz Mierzwa
a4a20ea3ef feat(ui): new UI written in React 2018-07-19 23:38:11 +02:00
Łukasz Mierzwa
b71883f1ef Migrate to new repo
Forked unsee from cloudflare, so import paths needs to be updated
2018-06-07 15:30:57 +02:00
Łukasz Mierzwa
9a5909a4ab Log Alertmanager version used for testing
There's ever growing list of tested Alertmanager releases, print version so it's more obvious what do we actually test against
2018-02-13 22:52:43 +00:00
Łukasz Mierzwa
1ff002f979 Update tests to use new envs instead of legacy 2018-02-01 21:09:36 -08:00
Łukasz Mierzwa
65a27b39df Move label coloring config options from 'color' to 'labels' section 2017-12-03 10:09:17 -08:00
Łukasz Mierzwa
a1eab56649 Migrate all old env usages to the new naming scheme 2017-12-02 21:55:43 -08:00
Łukasz Mierzwa
aa606eff12 Migrate tests to new annotation scheme 2017-09-07 12:15:32 -07:00
Łukasz Mierzwa
38339c887e Use gzip middlerware to compress responses if client can accept compressed content
Some alert.json responses are going to be big, compress it to save bandwidth
2017-08-08 11:28:17 -07:00
Łukasz Mierzwa
5d4ae47888 Convert all packages to be internal
Internal packages are supported by Go 1.5+, any package in /internal/ dir is only importable from the same repo. This will cleanup main dir a bit and provide better namespace for unsee subpackages
2017-08-04 16:21:27 -07:00
Łukasz Mierzwa
b6d5a5614e Run end-to-end tests for unsee.js
This will allow to test entire alerts flow - get alerts.json response (via mocks) and render alerts
2017-07-30 21:08:11 -07:00
Łukasz Mierzwa
f202232be8 Version all bundles
This will tell webpack to add a hash to all bundles filenames, we generate script tags for loading those and inject them as templates. No more forced cache bypassing
2017-07-29 16:19:48 -07:00
Łukasz Mierzwa
4a75acfdc1 Fix asset paths in tests 2017-07-29 13:53:40 -07:00
Łukasz Mierzwa
8f5c246297 Move to fully webpack managed assets 2017-07-29 13:52:07 -07:00
Łukasz Mierzwa
deaae332ec Add strict API response test to catch any drift 2017-07-06 22:27:13 -07:00
Łukasz Mierzwa
71c0dce1f6 Vendor renamed Sirupsen/logrus to sirupsen/logrus, fix imports 2017-07-02 10:12:33 -07:00
Łukasz Mierzwa
cb69029c4f Add @alertmanager filter 2017-07-01 14:02:03 -07:00
Łukasz Mierzwa
95ac702274 Fix tests to not use un-exported fields 2017-07-01 10:08:02 -07:00
Łukasz Mierzwa
2420212eb0 Fix tests to setup upstreams only once 2017-06-30 23:01:54 -07:00
Łukasz Mierzwa
612a0e817f Rename ALERTMANAGER_URI to ALERTMANAGER_URIS
This will make upgrade more explicit since there is a syntax change
2017-06-28 22:36:26 -07:00
Łukasz Mierzwa
c5724bb751 Handle per Alertmanager instance errors in the API and the UI 2017-06-28 22:36:25 -07:00
Łukasz Mierzwa
16be1627ed Move all *InSlice functions into a slices package 2017-06-28 22:36:25 -07:00
Łukasz Mierzwa
26d14d1bd2 Refactor Alertmanager API client code to use multiple upstream instances
Alerts are stored per instance and deduplicated on read.
2017-06-28 22:35:16 -07:00
Łukasz Mierzwa
23f70880dc Reverse sort on autocomplete data
This way =~ hints will be first, instead of !=. It probably makes sense to have smarter ordering, but this will do for now.
2017-06-13 09:37:34 -07:00
Łukasz Mierzwa
64b0a09f9a Generate regex ac hints only when substrings are present 2017-06-06 21:34:56 -07:00
Łukasz Mierzwa
275c0a7e03 Update tests 2017-06-06 21:34:56 -07:00
Łukasz Mierzwa
8a77d620fd Rename @status to @state
Fixes #104

@status filter was added to the master branch to support new status key from Alertmanager >=0.6.1
status ended up being nested in Alertmanager (it was added to solve AM issue 609 and that was a long PR with lots of changes), current unsee implementation ended being slightly off with how Alertmanager is naming this, it should actually be @state rather than @status.
2017-05-23 21:52:08 +01:00
Łukasz Mierzwa
0d55311a9d Replace @silenced & @inhibited filters with @status
Now that Alertmanager provides status=(unprocessed|suppressed|active) in the API it doesn't make sense to keep having separate filters for each value, merge @silenced & @inhibited into a single filter, update docs and UI
2017-05-05 13:56:48 +01:00
Łukasz Mierzwa
cee9b2bef6 Generate mock data using livemock.py
Generate mock data for all Alertmanager releases that we can support (0.4 - 0.6) and switch tests to use them instead of old files
Fixes #67
2017-05-02 10:28:40 +01:00
Łukasz Mierzwa
b42953e87f Add validation tests 2017-05-01 22:20:12 +01:00
Łukasz Mierzwa
72808c0002 Add 0.6.1 mock data 2017-05-01 22:20:12 +01:00
Łukasz Mierzwa
0af0401c6d Add @inhibited filter 2017-04-17 16:01:52 -07:00
Łukasz Mierzwa
10ef33afdf Expose number of inhibited alerts in the /alerts.json response
This is so that the UI can take use of it
2017-04-17 14:06:30 -07:00
Łukasz Mierzwa
f0579b087b Rename models, strip Unsee prefix
Now that models package contains only unsee specific models rename everything stripping Unsee prefix from names
2017-04-06 19:24:48 -07:00
Łukasz Mierzwa
ea50d334f0 Migrate test to per version mock data 2017-04-06 19:24:47 -07:00
Łukasz Mierzwa
eaf617c9aa Mocking alerts isn't needed for static file tests 2017-04-06 19:24:47 -07:00
Łukasz Mierzwa
4bb629455b Merge pull request #23 from tcolgate/am051
Fixes for 0.5.1
2017-04-01 10:41:16 -07:00
Łukasz Mierzwa
0d82cffd79 Add -web.prefix / WEB_PREFIX option
This allows people to use unsee with a sub uri setup, which is pretty common usa case, fixes #22
2017-03-30 19:35:52 +01:00
Tristan Colgate
b7dd9d088e Fixes for 0.5.1 2017-03-29 08:40:14 +01:00
Łukasz Mierzwa
54d67cbbaa Add more tests for views
We moved static file handling to binary assets, add some tests so we can spot issues with this code
2017-03-28 10:26:13 -07:00