Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #7204/afeeb89a backport][stable-7] Improvements to the jenkins_build module and new jenkins_build_info module #7234

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Sep 10, 2023

This is a backport of PR #7204 as merged into main (afeeb89).

SUMMARY

Note: This PR actually includes three separate changes, if you prefer to have them in separate PRs just ask!

Due to some special requirements on our part, we needed (and added) the following:

  • New option "detach" for the "jenkins_build" module, which allows the module to exit successfully as long as the build is created (default functionality is still waiting for the build to end before exiting).
  • New option "time_between_checks" for the "jenkins_build" module, which allows to configure the wait time between requests to the Jenkins server (this value has to be higher that the quiet time for the Jenkins job, so if it was higher than 10 it will always fail).
  • New module "jenkins_build_info" to get information about a specific Jenkins build (or the last one of a job).

Tested with Jenkins 2.235.5 and 2.401.3.

ISSUE TYPE
  • Feature Pull Request
  • New Module/Plugin Pull Request
COMPONENT NAME

jenkins_build and jenkins_build_info

ADDITIONAL INFORMATION

For a bit of context, we are dealing with an external Jenkins server that randomly fails. This means that due to how the jenkins_build module works we were getting random errors on our Ansible playbook (although the Jenkins build would actually continue).

With these changes we are able to craft a playbook that, even if the server returns an error sometimes, is able to retry and actually check if the build kept going.

…odule (#7204)

* Add detach option so the task doesn't wait until the Jenkins job is finished

* Add new time_between_checks to be able to configure the sleep time between requests

* New jenkins_build_info to get information about a specific build

* Add version_added to the new module

* Add changelog fragment for jenkins_build changes

* Fix tests that required the python-jenkins module

* Remove tests that failed

Doesn't really make sense to test that with a mock

* Fix pep8 error

* Update maintainers for the jenkins_build and jenkins_build_info modules

* Improve format and add link to PR

* Move version_added documentation to the right file

* Fix incorrect examples

* Improve text format

* Fix incorrect code style

* Fix incorrect YAML for documentation

* Add version_added documentation to the new options

(cherry picked from commit afeeb89)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests unit tests/unit labels Sep 10, 2023
@felixfontein felixfontein merged commit 0186451 into stable-7 Sep 11, 2023
@felixfontein felixfontein deleted the patchback/backports/stable-7/afeeb89af6ad977ea16606f37b915e5b35ef0a7a/pr-7204 branch September 11, 2023 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests unit tests/unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants