@@ -45,7 +45,6 @@ def create_pr_preview_command(
4545
4646 apps_git .checkout (pr_branch )
4747 logging .info ("App repo PR branch %s checkout successful" , pr_branch )
48- preview_id = hashlib .sha256 (pr_branch .encode ("utf-8" )).hexdigest ()[:8 ]
4948 git_hash = apps_git .get_last_commit_hash ()
5049 create_preview_command (
5150 username ,
@@ -57,8 +56,8 @@ def create_pr_preview_command(
5756 git_provider ,
5857 git_provider_url ,
5958 git_hash ,
60- preview_id ,
61- create_deployment_replaced_callback (parent_id , pr_id ),
59+ hashlib . sha256 ( pr_branch . encode ( "utf-8" )). hexdigest ()[: 8 ] ,
60+ create_deployment_already_up_to_date_callback (parent_id , pr_id ),
6261 create_deployment_exist_callback (parent_id , pr_id , pr_branch ),
6362 create_deployment_new_callback (parent_id , pr_id , pr_branch ),
6463 )
@@ -67,16 +66,16 @@ def create_pr_preview_command(
6766 delete_tmp_dir (root_tmp_dir )
6867
6968
70- def create_deployment_replaced_callback (parent_id , pr_id ):
71- def deployment_replaced_callback (apps_git , new_image_tag ):
69+ def create_deployment_already_up_to_date_callback (parent_id , pr_id ):
70+ def deployment_already_up_to_date_callback (apps_git , new_image_tag ):
7271 logging .info ("The image tag %s has already been deployed. Doing nothing." , new_image_tag )
7372 pr_comment_text = f"""
7473 The version `{ new_image_tag } ` has already been deployed. Nothing to do here.
7574 """
7675 logging .info ("Creating PullRequest comment for pr with id %s and content: %s" , pr_id , pr_comment_text )
7776 apps_git .add_pull_request_comment (pr_id , pr_comment_text , parent_id )
7877
79- return deployment_replaced_callback
78+ return deployment_already_up_to_date_callback
8079
8180
8281def create_deployment_new_callback (parent_id , pr_id , pr_branch ):
0 commit comments