2929REPOS_URL = 'https://raw.githubusercontent.com/ros2/ros2/{}/ros2.repos'
3030DEFAULT_TARGET = 'master'
3131CI_SERVER = 'https://ci.ros2.org'
32+ SERVER_RETRIES = 2
3233
3334
3435def panic (msg : str ) -> None :
@@ -189,6 +190,7 @@ def run_jenkins_build(
189190 gist_url : str ,
190191 github_login : str ,
191192 github_token : str ,
193+ target_release : str ,
192194) -> str :
193195 """
194196 Run a ci_launcher build for the selected packages, with the given gist as sources.
@@ -198,7 +200,7 @@ def run_jenkins_build(
198200 from jenkinsapi .jenkins import Jenkins
199201 logger .info ('Connecting to Jenkins server' )
200202 jenkins = Jenkins (CI_SERVER , username = github_login , password = github_token , use_crumb = True )
201- retries_remaining = 1
203+ retries_remaining = SERVER_RETRIES
202204 build_job = None
203205 while retries_remaining >= 0 :
204206 try :
@@ -219,6 +221,7 @@ def run_jenkins_build(
219221 }
220222 # augment with specific values for this PR
221223 build_params ['CI_ROS2_REPOS_URL' ] = gist_url
224+ build_params ['CI_ROS_DISTRO' ] = target_release
222225 build_params ['CI_BUILD_ARGS' ] += f' { build_args } '
223226 build_params ['CI_TEST_ARGS' ] += f' { test_args } '
224227
@@ -327,8 +330,14 @@ def main():
327330 comment_texts .append (format_ci_details (gist_url , extra_build_args , extra_test_args ))
328331 if parsed .build :
329332 user = github_instance .get_user ().login
330- comment_texts .append (run_jenkins_build (
331- extra_build_args , extra_test_args , gist_url , user , github_access_token ))
333+ comment_texts .append (
334+ run_jenkins_build (
335+ extra_build_args ,
336+ extra_test_args ,
337+ gist_url ,
338+ user ,
339+ github_access_token ,
340+ target_release = parsed .target ))
332341
333342 comment_results (parsed .comment , '\n ' .join (comment_texts ), chosen_pulls )
334343
0 commit comments