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
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
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.
* 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
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
The alert test function was dangerous, as if it was called without
manually wrapping in a transaction and rolling back it could corrupt
the database. Make sure it's always rolled back
By default, Django doesn't render field value for PasswordInput widgets, which means the password field will get overwritten
by an empty string every time a check is edited.
To fix this, we check whether the input is empty and don't modify the password if it is.