Merge lp://staging/~hashar/python-jenkins/fast-job-existence-check into lp://staging/~python-jenkins-developers/python-jenkins/trunk

Proposed by Antoine "hashar" Musso
Status: Merged
Merged at revision: 19
Proposed branch: lp://staging/~hashar/python-jenkins/fast-job-existence-check
Merge into: lp://staging/~python-jenkins-developers/python-jenkins/trunk
Diff against target: 50 lines (+21/-4)
1 file modified
jenkins/__init__.py (+21/-4)
To merge this branch: bzr merge lp://staging/~hashar/python-jenkins/fast-job-existence-check
Reviewer Review Type Date Requested Status
Python Jenkins Developers Pending
Review via email: mp+171303@code.staging.launchpad.net

Description of the change

Branch contains a single patch that aims to speed up job existence test by lowering the amount of work that need to be done on the server side.

Previously job_exists() was calling get_job_info() which does an API call to 'job/%(name)s/api/json?depth=0'. That forces the Jenkins server to load all the build history which is potentially a long operation with a cold cache and definitely unneeded when we just want to verify whether a job exist.

Another step would be to update the other methods to rely on job_exists() instead of get_job_info(). Maybe with a new method like requireExistingJob() that will throw an exception whenever job_exists() returns None.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches