702 Commits

Author SHA1 Message Date
Adrien Delle Cave
7c1ca6aa24 Merge remote-tracking branch 'upstream/master' 2018-04-23 21:01:20 +02:00
Frank Hamand
2c8bb9d9af Update changes 2018-04-23 11:50:27 +01:00
Frank Hamand
2ab96556bc Change multi_line_output mode to 0 for consistency with existing code 2018-04-23 10:31:44 +01:00
Frank Hamand
68f826f7f5 Change default section to third party instead of manual 2018-04-23 10:31:44 +01:00
Frank Hamand
e09ec7a15d
Merge pull request #561 from arachnys/isort-config
Add isort configuration to sort imports
2018-04-23 11:30:41 +02:00
Frank Hamand
c62ab99337 Update changes 2018-04-23 10:27:31 +01:00
David Buxton
36d63a5de2
Merge pull request #616 from hartwork/fix-order-public-services-listing
Make public services listing list in case insensitive order
2018-04-22 12:32:48 +01:00
Sebastian Pipping
82c64d3f2b Make public services listing list in case insensitive order 2018-04-22 02:25:31 +02:00
Frank Hamand
241096408b
Merge pull request #614 from hartwork/issue-608-approach-django-bootstrap-form
Style forms using django-bootstrap-form 3.4
2018-04-20 15:50:06 +02:00
Sebastian Pipping
21454d000c Style forms using django-bootstrap-form 3.4 (#608)
Potentially one of the least invasive approaches to apply Bootstrap3 styling.

Project home:
- https://github.com/tzangms/django-bootstrap-form
- https://pypi.org/project/django-bootstrap-form/
2018-04-20 01:23:31 +02:00
David Buxton
71b32a2d0a
Merge pull request #610 from hartwork/issue-607-fix-http-check
Fix HTTP check for websites serving non-UTF-8 content
2018-04-18 22:08:31 +01:00
Sebastian Pipping
0b92e49aae Store unicode reply for HTTP checks (#607)
Django would try convert to unicode when saving the
raw_data TextField.  So we save time and potential trouble
with non-standard encodings.

Docs:
https://docs.djangoproject.com/en/1.11/ref/unicode/#models
2018-04-18 22:54:27 +02:00
Sebastian Pipping
3659692211 Fix HTTP check for websites serving non-UTF-8 content (#607)
Response.content is of type `str` and needs decoding.
In contrast, Response.text is of type `unicode`, already.
This way, we no longer need to mis-assume UTF-8.

Docs:
http://docs.python-requests.org/en/master/user/quickstart/#response-content
2018-04-18 22:54:24 +02:00
David Buxton
3aa95667d7 Add test to check that failures properly tagged on HttpCheck (#607) 2018-04-18 22:54:21 +02:00
David Buxton
8a2cab5786 Create mocks for text in addition to content (#607) 2018-04-18 22:54:21 +02:00
Adrien Delle Cave
725b039f2c Merge remote-tracking branch 'upstream/master' 2018-04-18 20:13:53 +02:00
David Buxton
a9dc61cd39
Merge pull request #590 from davidjb/patch-1
Cabot sends `None` string in HTTP status checks in auth header for username or password
2018-04-17 10:52:14 +01:00
David Beitey
bca6ee150c Pass empty auth strs to requests instead of None
This solves / works around
https://github.com/requests/requests/issues/4465 until that behaviour is
made explicit or otherwise resolved.
2018-04-17 18:58:58 +10:00
Adrien Delle Cave
d587433243 Merge remote-tracking branch 'upstream/master' 2018-04-17 10:27:50 +02:00
David Buxton
9ba585dfd9
Merge pull request #609 from hartwork/issue-605-prevent-http-check-auth-autofill
Prevent auto-fill of saved credentials into HTTP auth fields
2018-04-17 08:02:00 +01:00
Sebastian Pipping
69a65d3409 Prevent auto-fill of saved credentials into HTTP auth fields (issue #605)
Tried with Firefox 58, Chromium 63, Chrome 66.
2018-04-16 23:15:00 +02:00
Adrien Delle Cave
d398ec78ac Merge remote-tracking branch 'upstream/master' 2018-04-16 15:06:37 +02:00
David Buxton
b5844aa446
Merge pull request #606 from hartwork/fix-menu-lack-spacing
Fix lack of spacing in far right user dropdown menu
2018-04-16 08:59:36 +01:00
David Buxton
570b7049d8
Merge pull request #604 from hartwork/fix-http-spelling
Fix spelling of "Http" to "HTTP"
2018-04-16 08:56:13 +01:00
Sebastian Pipping
067d36afba menu: Add missing space between icon and label
Affected items:
* Profile settings
* Plugin settings
2018-04-16 01:07:25 +02:00
Sebastian Pipping
d5da2c0f52 Fix spelling of "Http" to "HTTP" 2018-04-16 00:59:05 +02:00
Sebastian Pipping
1b1c0eddc3 views.py: Fix flake8 issue
cabot/cabotapp/views.py:1013:5: E301 expected 1 blank line, found 0
2018-04-16 00:59:05 +02:00
Adrien Delle Cave
249ea3f665 Added pagination in page statuscheck_detail.html 2018-04-09 17:56:38 +02:00
Adrien Delle Cave
5dd7ccc0c8 Fixed glyphicon in menu for custom check plugins 2018-04-09 15:54:09 +02:00
Adrien Delle Cave
edc7ea6d3a Added capfirst in status check list 2018-03-24 08:31:22 +01:00
Adrien Delle Cave
a99798def6 Missed custom check plugins list in many views 2018-03-24 08:13:17 +01:00
Frank Hamand
20fada0aff 0.11.12 0.11.12 2018-03-21 11:22:36 +00:00
Frank Hamand
fd2befbf33 Update changelog 2018-03-21 11:22:35 +00:00
Jean-Fred Berthelot
9c3f4f9161 Debounce JenkinsCheck on the number of job failures
Debounce is “the number of successive failures
permitted before check will be marked as failed”.
It is very useful to avoid alerts on expected hiccups.

For checks whose retry logic lies in Cabot using `frequency`
(which is the case for Graphite, HTTP, and ICMP checks),
it makes sense that the debounce is about how often Cabot retried things.

For JenkinsChecks, however, we have no control over
how often Cabot checks the job. This means that even a
debounce of eg 5 can trigger an alert over 1 job failure.

A simpler implementation of this was to loop over the
recent results, count how many distinct jobs have failed,
(using the job number stored in the `status_check_result`),
and set the status to fail if this is higher than the debounce.
However, Cabot only considers the last 10 results (hardcoded value).
Since Cabot checks the job at fairly high frequency (or at least a
frequency higher than the Jenkins run frequency), this can mean
the status would switch to pass after 10 checks of a single check failure.

We thus need to enrich the StatusCheckResult data model
to store that information.

- Add field `consecutive_failures` to StatusCheckResult model
  (and associated migration).

- Retrieve from Jenkins the last good build, and compute from
  that the number of consecutive failures

- Also display the consecutive failures in the Check results page

Closes #537
2018-03-21 11:22:35 +00:00
Jean-Fred Berthelot
337e359130 Add unit tests for Jenkins
Add unit tests covering
- when there is no build of the job at all
- when there is no good build (ie, only failing builds)
2018-03-21 10:59:51 +00:00
Jean-Fred Berthelot
cbb3be5093 Move calculate_debounced_passing as StatusCheck method
We want to override `calculate_debounced_passing` for the JenkinsCheck.
2018-03-21 10:59:51 +00:00
Jean-Fred Berthelot
f2dfb21f2b Bump Django to 1.11.11
There are vulnerabilities for the intermediate versions.

Changelog: https://docs.djangoproject.com/en/2.0/releases/#id1
2018-03-21 10:59:51 +00:00
Frank Hamand
535e14463b 0.11.11 0.11.11 2018-03-09 17:12:32 +00:00
Frank Hamand
9a4a44a9fc Fix /api/oncall endpoint not working with basic auth 2018-03-09 17:12:16 +00:00
Frank Hamand
f6fd5aba03 0.11.10 0.11.10 2018-03-09 15:10:44 +00:00
Frank Hamand
ccadade420 Remove redundant python requirement
This was installed by django ldap anyway, and the version was clashing
2018-03-09 15:10:44 +00:00
Frank Hamand
e935cb9082 Add /api/oncall endpoint
A new endpoint to return the currently on call users

Also added a serialize method to plugins to allow plugin data (e.g.
slack alias) to get returned with the method.
2018-03-09 15:10:44 +00:00
Frank Hamand
b5dca88ef9 0.11.9 2018-03-09 15:10:43 +00:00
Frank Hamand
b1bc576595 Fix issue where Jenkins variables were required on first launch 2017-11-22 09:58:36 +00:00
Jean-Frédéric
ead3f98487
Pass-through SOCIAL_AUTH_REDIRECT_IS_HTTPS from environment variables (#578)
This is needed when running behind a reverse proxy,
otherwise we get redirected to plain HTTP which does
not match the expected URL in the provider.

Per the python-social-auth documentation:
```
On projects behind a reverse proxy that uses HTTPS, the redirect
URIs can have the wrong schema (http:// instead of https://) if
the request lacks the appropriate headers, which might cause
errors during the auth process.
To force HTTPS in the final URIs set this setting to True
```
https://python-social-auth-docs.readthedocs.io/en/latest/configuration/settings.html
2017-11-10 10:57:00 +00:00
Jean-Fred Berthelot
7baede72a6 Ignore Flake8 E722
E722 is "do not use bare except", of which we have four violations
in `models/base.py`.

Let's ignore these for now to get the build working again.
2017-11-09 15:01:38 +00:00
Jean-Fred Berthelot
af66cc806d Add test for graphite.parse_metric when exception is raised
Add test for when the API call to Graphite throws an exception.
2017-10-17 17:45:07 +01:00
Jean-Fred Berthelot
bc58675cd5 Add tests for public view page
In cb2fc2e8 was added a public page, which lists services
marked as public.

This adds tests for this page, covering all cases.
2017-10-17 17:35:55 +01:00
Jean-Fred Berthelot
62e8c4b5cd Bump Django to latest 1.11.6
Django 1.11.6 was released on October 5, 2017.
We are still using 1.11 released on April 4, 2017.

Also bump all Django-related dependencies.
2017-10-17 16:43:55 +01:00
Jean-Fred Berthelot
7781f5c223 Add isort configuration to sort imports
isort is a Python utility to  to sort imports alphabetically,
and automatically separated into sections.

This config matches the Django coding style:
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#imports
```
Put imports in these groups: future, standard library, third-party libraries,
other Django components, local Django component, try/excepts.
```

This also adds a tox target, not yet executed by default,
which can be used to easily apply isort (`tox -e isort -- --apply`)
2017-10-17 10:50:45 +01:00