Skip to content

Commit

Permalink
[ISV-1594] Update the PR status to 'merged' in test results (#221)
Browse files Browse the repository at this point in the history
* [ISV-1594] Update the PR status to 'merged' in test results

* [ISV-1594] Update the PR status to 'merged' in test results

* Add the when condition

Co-authored-by: haripate <>
  • Loading branch information
haripate authored Jan 14, 2022
1 parent ea4e10a commit f6c5eea
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ spec:
subPath: results

# link pull request details to test results
- name: link-pull-request
- name: link-pull-request-with-open-status
runAfter:
- get-ci-results
taskRef:
Expand All @@ -803,7 +803,7 @@ spec:
# Query Hydra API for status of the pre-certification checklist
- name: query-publishing-checklist
runAfter:
- link-pull-request
- link-pull-request-with-open-status
- verify-ci-results
taskRef:
name: query-publishing-checklist
Expand Down Expand Up @@ -845,6 +845,34 @@ spec:
workspace: repository
subPath: src

# link pull request details to test results
- name: link-pull-request-with-merged-status
runAfter:
- merge-pr
when:
- input: $(tasks.merge-pr.results.pr_merged)
operator: in
values: ["true"]
taskRef:
name: link-pull-request
params:
- name: pipeline_image
value: "$(params.pipeline_image)"
- name: test_result_id
value: "$(tasks.get-ci-results.results.test_result_id)"
- name: pyxis_url
value: "$(tasks.set-env.results.pyxis_url)"
- name: pyxis_ssl_secret_name
value: "$(params.pyxis_ssl_secret_name)"
- name: pyxis_ssl_cert_secret_key
value: "$(params.pyxis_ssl_cert_secret_key)"
- name: pyxis_ssl_key_secret_key
value: "$(params.pyxis_ssl_key_secret_key)"
- name: pull_request_url
value: "$(params.git_pr_url)"
- name: pull_request_status
value: "merged"

finally:

# Upload the logs of this pipeline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spec:
- name: source
results:
- name: bool_merge
- name: pr_merged
steps:
- name: check-if-merge
image: "$(params.pipeline_image)"
Expand Down Expand Up @@ -78,6 +79,7 @@ spec:
if [ "$BOOL_MERGE" = "false" ]; then
echo "merge explicitly set to false- not merging the Pull Request"
echo -n "false" | tee $(results.pr_merged.path)
exit 0
fi
Expand All @@ -96,3 +98,4 @@ spec:
$API_URL
echo "Merge request has been merged!"
echo -n "true" | tee $(results.pr_merged.path)

0 comments on commit f6c5eea

Please sign in to comment.