Skip to content

Commit e5f3804

Browse files
authored
Fix operator_path for catalog-only changes (#730)
* Fix operator_path for catalog-only changes --------- Signed-off-by: Maurizio Porrato <[email protected]>
1 parent 4ae45f1 commit e5f3804

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ spec:
628628
name: reserve-operator-name
629629
when:
630630
- *certProjectExists
631+
- *bundleAdded
631632
params:
632633
- name: pipeline_image
633634
value: "$(params.pipeline_image)"

ansible/roles/operator-pipeline/templates/openshift/tasks/parse-repo-changes.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ spec:
7070
--output-file changes.json \
7171
--verbose
7272
73+
cat changes.json
74+
7375
operator_name="$(jq -r '.operator_name' < changes.json)"
7476
echo -n $operator_name > "$(results.added_operator.path)"
7577

operator-pipeline-images/operatorcert/parsed_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def enrich_result(result: dict[str, Any]) -> None:
204204
if affected_catalog_operators and operator_name == "":
205205
# Even if the change affects only files in catalogs/ we still need to know
206206
# what operator is affected by the change when accessing info in the operator's ci.yaml
207-
operator_name = affected_catalog_operators[0][1]
207+
_, operator_name = affected_catalog_operators[0].split("/", 1)
208208

209209
result["operator_name"] = operator_name
210210
result["bundle_version"] = bundle_version

operator-pipeline-images/tests/entrypoints/test_detect_changed_operators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,12 +779,12 @@ def test_ParserRules_validate_removal_fbc_fail(
779779
{
780780
"affected_bundles": [],
781781
"affected_operators": [],
782-
"affected_catalog_operators": [("v4.16", "operator-e2e")],
782+
"affected_catalog_operators": ["v4.16/operator-e2e"],
783783
},
784784
{
785785
"affected_bundles": [],
786786
"affected_operators": [],
787-
"affected_catalog_operators": [("v4.16", "operator-e2e")],
787+
"affected_catalog_operators": ["v4.16/operator-e2e"],
788788
"operator_name": "operator-e2e",
789789
"bundle_version": "",
790790
"operator_path": "operators/operator-e2e",

0 commit comments

Comments
 (0)