lp:~hashar/python-jenkins/fast-job-existence-check
- Get this branch:
- bzr branch lp:~hashar/python-jenkins/fast-job-existence-check
Branch merges
- Python Jenkins Developers: Pending requested
-
Diff: 50 lines (+21/-4)1 file modifiedjenkins/__init__.py (+21/-4)
Branch information
Recent revisions
- 19. By Antoine "hashar" Musso
-
speed up job existence test by fetching less informations
The job_exists() methods rely on an API call that cause Jenkins to LazyLoad the
build history. Whenever a job has a huge build history, that would be awfully
slow. The API let you fetch only a subset of the information you need by using
the 'tree' parameter, by requesting only the name of the job, we ensure the
server is only going to do a very simple operation.It is then only a matter of checking the job name returned the API is equal to
the one requested, that validates the job exists and is accessible.Tested out on a dev setup with a job having a million builds:
import jenkins
from pprint import pprintj = jenkins.Jenkins('https:/
/localhost: 8080/') for job_name in ['huge-history', 'Idonotexist']:
print "Getting job name of %s" % job_name
pprint(j.get_job_ name(job_ name))
print "Does it exist?"
pprint(j.job_exists( job_name) ) Output:
Getting job name of huge-history
u'huge-history'
Does it exist?
True
Getting job name of Idonotexist
None
Does it exist?
None - 18. By Antoine "hashar" Musso
-
overhaul the sphinx documentation
Sphinx:
* Build dir is now named `build` and the files are under `source`.
* MakeFile learned texinfo, info and gettext targets
* include __init__ documentation (autoclass_content)
* keep file ordering for methods (autodoc_member_ order)
* comment out html_static_path to get rid of a warningDoc:
* Index is now... an index! Takes advantage of :glob: to automatically
create a complete table of content.
* Creates API reference which list the documentation directly from the
jenkins/__init_ _.py file. That will avoid the documentation duplication
and some out of sync documentation.
* insert the module in the path to document it
* the example were both in index.rst and __init__.py create a new section
with example.rst. That can be later be improved with some typical use
cases.
* A couple documentation update to some methods. The inline documentation
was out of sync though the index.rst got updated. - 17. By Antoine "hashar" Musso
-
pass pep8 on all files
pep8 is the python style standard. I have ignored long lines though.
- 16. By James Page
-
Merged new node management features including using SSH and Windows slaves plus cancel job/queue methods
- 12. By Ken Conley <email address hidden>
-
Documentation updates. Sphinx no longer uses automodule. Filled in some missing API methods. Corrected references
to Hudson in doc strings.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)