Skip to content

Commit f6c5eea

Browse files
authored
[ISV-1594] Update the PR status to 'merged' in test results (#221)
* [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 <>
1 parent ea4e10a commit f6c5eea

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

ansible/roles/operator-pipeline/templates/openshift/pipelines/operator-hosted-pipeline.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ spec:
777777
subPath: results
778778

779779
# link pull request details to test results
780-
- name: link-pull-request
780+
- name: link-pull-request-with-open-status
781781
runAfter:
782782
- get-ci-results
783783
taskRef:
@@ -803,7 +803,7 @@ spec:
803803
# Query Hydra API for status of the pre-certification checklist
804804
- name: query-publishing-checklist
805805
runAfter:
806-
- link-pull-request
806+
- link-pull-request-with-open-status
807807
- verify-ci-results
808808
taskRef:
809809
name: query-publishing-checklist
@@ -845,6 +845,34 @@ spec:
845845
workspace: repository
846846
subPath: src
847847

848+
# link pull request details to test results
849+
- name: link-pull-request-with-merged-status
850+
runAfter:
851+
- merge-pr
852+
when:
853+
- input: $(tasks.merge-pr.results.pr_merged)
854+
operator: in
855+
values: ["true"]
856+
taskRef:
857+
name: link-pull-request
858+
params:
859+
- name: pipeline_image
860+
value: "$(params.pipeline_image)"
861+
- name: test_result_id
862+
value: "$(tasks.get-ci-results.results.test_result_id)"
863+
- name: pyxis_url
864+
value: "$(tasks.set-env.results.pyxis_url)"
865+
- name: pyxis_ssl_secret_name
866+
value: "$(params.pyxis_ssl_secret_name)"
867+
- name: pyxis_ssl_cert_secret_key
868+
value: "$(params.pyxis_ssl_cert_secret_key)"
869+
- name: pyxis_ssl_key_secret_key
870+
value: "$(params.pyxis_ssl_key_secret_key)"
871+
- name: pull_request_url
872+
value: "$(params.git_pr_url)"
873+
- name: pull_request_status
874+
value: "merged"
875+
848876
finally:
849877

850878
# Upload the logs of this pipeline.

ansible/roles/operator-pipeline/templates/openshift/tasks/merge-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ spec:
1818
- name: source
1919
results:
2020
- name: bool_merge
21+
- name: pr_merged
2122
steps:
2223
- name: check-if-merge
2324
image: "$(params.pipeline_image)"
@@ -78,6 +79,7 @@ spec:
7879
7980
if [ "$BOOL_MERGE" = "false" ]; then
8081
echo "merge explicitly set to false- not merging the Pull Request"
82+
echo -n "false" | tee $(results.pr_merged.path)
8183
exit 0
8284
fi
8385
@@ -96,3 +98,4 @@ spec:
9698
$API_URL
9799
98100
echo "Merge request has been merged!"
101+
echo -n "true" | tee $(results.pr_merged.path)

0 commit comments

Comments
 (0)