Skip to content

Commit daed299

Browse files
committed
pr feedback
1 parent 38f3659 commit daed299

1 file changed

Lines changed: 10 additions & 15 deletions

File tree

gitopscli/commands/create_pr_preview.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def create_pr_preview_command(
5656
git_provider,
5757
git_provider_url,
5858
git_hash,
59-
hashlib.sha256(pr_branch.encode("utf-8")).hexdigest()[:8],
59+
pr_branch,
6060
create_deployment_already_up_to_date_callback(parent_id, pr_id),
6161
create_deployment_exist_callback(parent_id, pr_id, pr_branch),
6262
create_deployment_new_callback(parent_id, pr_id, pr_branch),
@@ -69,9 +69,7 @@ def create_pr_preview_command(
6969
def create_deployment_already_up_to_date_callback(parent_id, pr_id):
7070
def deployment_already_up_to_date_callback(apps_git, new_image_tag):
7171
logging.info("The image tag %s has already been deployed. Doing nothing.", new_image_tag)
72-
pr_comment_text = f"""
73-
The version `{new_image_tag}` has already been deployed. Nothing to do here.
74-
"""
72+
pr_comment_text = f"The version `{new_image_tag}` has already been deployed. Nothing to do here."
7573
logging.info("Creating PullRequest comment for pr with id %s and content: %s", pr_id, pr_comment_text)
7674
apps_git.add_pull_request_comment(pr_id, pr_comment_text, parent_id)
7775

@@ -80,10 +78,9 @@ def deployment_already_up_to_date_callback(apps_git, new_image_tag):
8078

8179
def create_deployment_new_callback(parent_id, pr_id, pr_branch):
8280
def deployment_new_callback(apps_git, gitops_config, route_host):
83-
pr_comment_text = f"""
84-
New preview environment for `{gitops_config.application_name}` and branch `{pr_branch}` created successfully. Access it here:
85-
https://{route_host}
86-
"""
81+
pr_comment_text = f"""\
82+
New preview environment for `{gitops_config.application_name}` and branch `{pr_branch}` created successfully. Access it here:
83+
https://{route_host}"""
8784
logging.info("Creating PullRequest comment for pr with id %s and content: %s", pr_id, pr_comment_text)
8885
apps_git.add_pull_request_comment(pr_id, pr_comment_text, parent_id)
8986

@@ -92,10 +89,9 @@ def deployment_new_callback(apps_git, gitops_config, route_host):
9289

9390
def create_deployment_exist_callback(parent_id, pr_id, pr_branch):
9491
def deployment_exist_callback(apps_git, gitops_config, route_host):
95-
pr_comment_text = f"""
96-
Preview environment for `{gitops_config.application_name}` and branch `{pr_branch}` updated successfully. Access it here:
97-
https://{route_host}
98-
"""
92+
pr_comment_text = f"""\
93+
Preview environment for `{gitops_config.application_name}` and branch `{pr_branch}` updated successfully. Access it here:
94+
https://{route_host}"""
9995
logging.info("Creating PullRequest comment for pr with id %s and content: %s", pr_id, pr_comment_text)
10096
apps_git.add_pull_request_comment(pr_id, pr_comment_text, parent_id)
10197

@@ -104,9 +100,8 @@ def deployment_exist_callback(apps_git, gitops_config, route_host):
104100

105101
def __create_pullrequest(branch, gitops_config, root_git):
106102
title = "Updated preview environment for " + gitops_config.application_name
107-
description = f"""
108-
This Pull Request is automatically created through [gitopscli](https://github.com/baloise/gitopscli).
109-
"""
103+
description = f"""\
104+
This Pull Request is automatically created through [gitopscli](https://github.com/baloise/gitopscli)."""
110105
pull_request = root_git.create_pull_request(branch, "master", title, description)
111106
logging.info("Pull request created: %s", {root_git.get_pull_request_url(pull_request)})
112107
return pull_request

0 commit comments

Comments
 (0)