687 Commits

Author SHA1 Message Date
Frank Hamand
0e92f3ff43 Merge pull request #560 from arachnys/add-autocomplete
Add cloudwatch check plugin to default plugins
2017-09-14 14:44:27 +01:00
Frank Hamand
22ba9b5e41 Add custom checks to service list 2017-09-14 14:34:29 +01:00
Frank Hamand
3ab0c67ed8 Bump cloudwatch plugin 0.11.6b3 2017-09-14 12:30:00 +01:00
Frank Hamand
f5be35ac23 Remove form media from compress
Compress doesn't work properly as form media is dynamic
0.11.6b2
2017-09-14 12:17:22 +01:00
Frank Hamand
30451d6ddf Add cloudwatch check plugin to default plugins
The cloudwatch check plugin needs django autocomplete light -
eventually we can use this for other plugins too (e.g. getting
the available jenkins jobs for jenkins check)
0.11.6b1
2017-09-14 11:05:22 +01:00
Frank Hamand
ae00284b3b Merge pull request #558 from arachnys/refactor-check-plugin-architecture
Refactor check plugin architecture
2017-09-14 10:47:48 +01:00
Frank Hamand
26712a40bf Remove failing plugin tests 2017-09-13 17:59:41 +01:00
Frank Hamand
0f9c94d1f9 Enable custom icons for custom checks 2017-09-13 17:59:41 +01:00
Frank Hamand
5b732cfac2 Refactor custom check plugin architecture
Change to not have separate check plugins and other plugin env variable,
also revert changes to the initial migration - migrations should be
created in the plugins themselves.
2017-09-13 17:59:41 +01:00
Frank Hamand
1afc97b65a 0.11.5 0.11.5 2017-09-11 14:07:51 +01:00
Frank Hamand
6b4645382f Fix multiple jenkins configs not working properly 2017-09-11 13:58:26 +01:00
Frank Hamand
290f798da5 0.11.4 0.11.4 2017-09-07 16:04:01 +01:00
Frank Hamand
46df071d0f Update CHANGES to include jenkinsapi switch 2017-09-07 16:03:52 +01:00
Frank Hamand
13cb71213e Merge pull request #553 from arachnys/switch-jenkins-api
Switch from jenkinsapi to python-jenkins
2017-09-07 16:02:55 +01:00
Frank Hamand
e0498b5c15 Fix linting error 2017-09-07 15:54:59 +01:00
Jean-Fred Berthelot
34efe86c0c Update tests after move to python-jenkins 2017-09-07 15:35:59 +01:00
Frank Hamand
d6f32eaf19 Switch from jenkinsapi to python-jenkins
jenkinsapi has terrible performance (between 4 and 14seconds for a
jenkins check) - switch to the openstack library which is lower level.
2017-09-07 11:23:48 +01:00
Frank Hamand
7af05facd8 0.11.3 0.11.3 2017-09-07 10:04:12 +01:00
Frank Hamand
58089b4373 Update CHANGES 2017-09-06 17:44:21 +01:00
Jean-Fred Berthelot
99f046be56 Set queued_job_number when job is queued
This is so that when a job is running, Cabot notifications
will link to the running job rather than the last completed job.
2017-09-06 17:23:22 +01:00
Jean-Fred Berthelot
84568a9074 Fix JenkinsCheck result status for in-progress builds
If a build is in progress, then every JenkinsCheck was marked as failed.

Here we fetch the last_completed build, instead of the last_build,
because that is really what we are interested in, and we are not
relying on last_build to figure out whether a build is in progress.

Closes #551
2017-09-06 17:23:22 +01:00
Frank Hamand
aa332138c7 Add .tox to gitignore 2017-09-06 15:24:13 +01:00
Frank Hamand
6e0fbbff0f 0.11.2 0.11.2 2017-09-06 12:49:51 +01:00
Frank Hamand
fa2de6dc74 0.11.1 0.11.1 2017-09-06 12:31:25 +01:00
Frank Hamand
39cd729f9e Merge pull request #550 from arachnys/fix-jenkins-migrations
Fix jenkins check migrations
2017-09-06 12:28:57 +01:00
Frank Hamand
4659e60ea5 Fix status check shortcut not working properly 2017-09-06 12:11:55 +01:00
Frank Hamand
8edc3f0b89 Fix migration recreating all checks instead of just jenkins 2017-09-06 11:30:04 +01:00
Frank Hamand
24bc441513 Save check before migrating many to many fields
It doesn't work if the check doesn't already have an id
2017-09-06 10:18:52 +01:00
Frank Hamand
dd370f68b2 Fix not migrating services/instances on jenkins checks 2017-09-06 10:02:59 +01:00
Frank Hamand
6e19dad41c Fix migration requiring jenkins environment variables are set 2017-09-06 10:02:38 +01:00
Frank Hamand
89e9290200 Add InstanceStatusSnapshot to cleanup db task
These are also piling up and should be deleted
2017-09-05 15:35:15 +01:00
Frank Hamand
d0edb89030 Sort status check results before cleaning
Currently it could delete relevant status check results (e.g. the last
one)
2017-09-05 14:16:31 +01:00
Frank Hamand
6d05e19d96 Reduce time to store old check results to 7 days 2017-09-05 13:58:28 +01:00
Frank Hamand
9b165b1e3f 0.11.0 0.11.0 2017-08-22 11:07:12 +01:00
Frank Hamand
8b98468840 Merge pull request #541 from arachnys/jenkins-config
Allow jenkins checks to look at different jenkins backends
2017-08-22 11:06:45 +01:00
Frank Hamand
e84bd90068 Update changes for jenkins check backends 2017-08-22 10:45:13 +01:00
Frank Hamand
b03c4589c4 Allow multiple Jenkins backends for JenkinsStatusCheck
We added a JenkinsConfig model to store configs (atm only editable in
django admin - to be moved to some sort of plugins options page)

If no JenkinsConfig are available, one will be created from the current
environment variables (JENKINS_URL etc)

Refactor JenkinsStatusCheck to have its own table instead of being a
proxy model. This is because we're moving to a plugin architecture
for status checks so we can't keep adding every new field to the base
model.
2017-08-22 10:45:13 +01:00
Frank Hamand
e0b36009d2 Merge pull request #543 from arachnys/fix-jenkinsapi-performance
Cache jenkins client and make it lazy
2017-08-22 10:35:09 +01:00
Frank Hamand
94b2cb1ca3 Cache jenkins client and make it lazy
Without lazy=True, it polls for information on initialise
2017-08-22 10:34:45 +01:00
Jean-Fred Berthelot
139048a7b4 Update ChangeLog with recent changes 2017-08-22 09:57:27 +01:00
Frank Hamand
046cc3bed6 Minor docker-compose fixes 2017-08-21 18:04:12 +01:00
Jean-Fred Berthelot
bc0e0486d6 Fail Jenkins check if job is unknown
Currently, if there is there is no Jenkins job matching
the Cabot check, the check always succeeds.

This is particularly bad when jobs are renamed on Jenkins,
as Cabot stops monitoring it and never alerts on this.

Although Cabot is currently very relaxed when dealing with
Jenkins errors, since 94dcdf9 Cabot did fail on missing job.
This must have stopped working following a Jenkins API change.

Here, we catch the `jenkinsapi` `UnknownJob` exception and
set `status_code` to the value expected by the `run` method.
Also add a unit-test for that behaviour.

This is a quick fix ; but in general the entire run method
may need refactoring to not use `status_code` anymore,
We may want to consider dealiing with the `jenkinsapi` exceptions
in the `run` method rather than catching them in `get_job_status`
and setting the `status_code`.

Closes #537
2017-08-18 13:01:38 +01:00
Frank Hamand
95da5e54f3 Don't have LDAP enabled by default 2017-08-18 11:47:08 +01:00
Jean-Frédéric
382a480b56 Merge pull request #525 from arachnys/jenkins-api
Use Jenkinsapi to communicate with Jenkins
2017-08-17 16:12:00 +01:00
Jean-Fred Berthelot
d0229a75d3 Use jenkinsapi to talk to Jenkins
Instead of hitting the Jenkins API directly using `requests`,
we delegate this to the `jenkinsapi` package, which provides
useful abstractions for that.

Also add unit tests for that new method
2017-08-17 15:46:41 +01:00
Jean-Fred Berthelot
436135d829 Replace JenkinsCheck tests mock
To test the JenkinsCheck logic, we were going
as deep as mocking the Jenkins HTTP response.

This changes to mock the `get_job_status` response,
paving the way to change the Jenkins access layer
without impacting these tests.
2017-08-17 15:40:28 +01:00
Pablo González
cb2fc2e896 Add google login and view for public services (#533)
* add login using google login
* Add `is_public flag` to services
* Add public view for services marked as public
* Add base_public.html for unauthenticated users and use that with authenticated views
* fix first time setup issue. change setup.html and about.html to extend from base_public.html template and redirect from home to setup if necessary

Pull-request #533
2017-08-15 14:28:41 +01:00
Sergey
4034d98a37 Add custom check plugins system
PR: https://github.com/arachnys/cabot/pull/527
2017-07-18 16:39:51 +01:00
Jean-Fred Berthelot
2258511c18 Remove deprecated Shell and Fabric scripts
We have deeply revamped the deployment process of Cabot
(docker setup and Pypi packaging) which has deprecated
the provisioning scripts and the Fabric script.

Closes #493
2017-07-05 10:33:33 +02:00
Jean-Frédéric
190c8fcec1 Move freezegun to requirements dev (#521)
`freezegun` is a test dependency and thus belons to `requirements-dev`
Also bumps it from 0.3.8 to latest 0.3.9.
2017-06-06 13:03:09 +01:00