SasanAhmadi commented on a change in pull request #22421:
URL: https://github.com/apache/airflow/pull/22421#discussion_r832556711
##########
File path: airflow/providers/jenkins/hooks/jenkins.py
##########
@@ -46,3 +47,24 @@ def __init__(self, conn_id: str = default_conn_name) -> None:
def get_jenkins_server(self) -> jenkins.Jenkins:
"""Get jenkins server"""
return self.jenkins_server
+
+ def get_build_building_state(self, job_name: str, build_number: int) ->
bool:
+ """Get build building state"""
+ try:
+ if not build_number:
+ self.log.info(f"Build number not specified, getting latest
build info from Jenkins")
+ job_info = self.jenkins_server.get_job_info(self.job_name)
+ build_number_to_check = job_info['lastBuild']['number']
+ else:
+ build_number_to_check = self.build_number
Review comment:
my bad, fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]