Skip to content

Commit 028be9c

Browse files
authored
[ISV-4829] Release pipeline skips catalog build and distribution for FBC (#696)
Signed-off-by: Maurizio Porrato <[email protected]>
1 parent a207bbc commit 028be9c

File tree

9 files changed

+227
-94
lines changed

9 files changed

+227
-94
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ spec:
219219
params:
220220
- name: pipeline_image
221221
value: "$(params.pipeline_image)"
222-
- name: bundle_path
223-
value: "$(params.bundle_path)"
222+
- name: operator_path
223+
value: "$(tasks.bundle-path-validation.results.package_path)"
224224
workspaces:
225225
- name: source
226226
workspace: pipeline

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

Lines changed: 80 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ spec:
148148
optional: true
149149
- name: registry-credentials
150150
- name: registry-credentials-all
151-
description: Storage space for the result of merging certification project and
151+
description:
152+
Storage space for the result of merging certification project and
152153
pipeline service account registry tokens.
153154
tasks:
154-
155155
# extract the PR number from the PR URL
156156
- name: get-pr-number
157157
taskRef:
@@ -309,12 +309,35 @@ spec:
309309
workspace: results
310310
subPath: changes
311311

312+
- name: yaml-lint
313+
runAfter:
314+
- detect-changes
315+
taskRef:
316+
name: yaml-lint
317+
when:
318+
- input: "$(tasks.detect-changes.results.bundle_path)"
319+
operator: notin
320+
values: [""]
321+
params:
322+
- name: pipeline_image
323+
value: "$(params.pipeline_image)"
324+
- name: args
325+
value:
326+
[
327+
"-d {extends: default, rules: {line-length: {max: 180, level: warning}, indentation: {indent-sequences: whatever}}}",
328+
"$(tasks.detect-changes.results.bundle_path)",
329+
]
330+
workspaces:
331+
- name: shared-workspace
332+
workspace: repository
333+
subPath: src
334+
312335
- name: check-permissions
313336
taskRef:
314337
name: check-permissions
315338
kind: Task
316339
runAfter:
317-
- detect-changes
340+
- yaml-lint
318341
params:
319342
- name: pipeline_image
320343
value: "$(params.pipeline_image)"
@@ -388,16 +411,35 @@ spec:
388411
workspace: results
389412
subPath: summary
390413

414+
- name: resolve-pr-type
415+
taskRef:
416+
name: resolve-pr-type
417+
kind: Task
418+
runAfter:
419+
- read-config
420+
params:
421+
- name: pipeline_image
422+
value: "$(params.pipeline_image)"
423+
- name: bundle_path
424+
value: "$(tasks.detect-changes.results.bundle_path)"
425+
- name: affected_catalogs
426+
value: "$(tasks.detect-changes.results.affected_catalogs)"
427+
- name: affected_catalog_operators
428+
value: "$(tasks.detect-changes.results.affected_catalog_operators)"
429+
- name: fbc-enabled
430+
value: "$(tasks.read-config.results.fbc-enabled)"
431+
391432
- name: validate-catalog-format
392433
taskRef:
393434
name: validate-catalog-format
394435
kind: Task
395436
runAfter:
396437
# This is just a temporary location until we have a proper
397438
# FCB branch based on config
398-
- read-config
399-
when: &catalogChange
400-
- input: "$(tasks.detect-changes.results.affected_catalogs)"
439+
- resolve-pr-type
440+
when:
441+
- &catalogFileChange
442+
input: "$(tasks.detect-changes.results.affected_catalogs)"
401443
operator: notin
402444
values: [""]
403445
params:
@@ -420,7 +462,8 @@ spec:
420462
# This is just a temporary location until we have a proper
421463
# FCB branch based on config
422464
- validate-catalog-format
423-
when: *catalogChange
465+
when:
466+
- *catalogFileChange
424467
params:
425468
- name: pipeline_image
426469
value: "$(params.pipeline_image)"
@@ -443,8 +486,9 @@ spec:
443486
kind: Task
444487
runAfter:
445488
- build-fragment-images
446-
when: &bundleAdded
447-
- input: "$(tasks.detect-changes.results.added_bundle)"
489+
when:
490+
- &bundleAdded
491+
input: "$(tasks.detect-changes.results.added_bundle)"
448492
operator: notin
449493
values: [""]
450494
params:
@@ -542,8 +586,9 @@ spec:
542586
- get-pyxis-certification-data
543587
taskRef:
544588
name: verify-project
545-
when: &certProjectExists
546-
- input: "$(tasks.certification-project-check.results.certification_project_id)"
589+
when:
590+
- &certProjectExists
591+
input: "$(tasks.certification-project-check.results.certification_project_id)"
547592
operator: "notin"
548593
values: [""]
549594
params:
@@ -563,7 +608,8 @@ spec:
563608
- verify-project
564609
taskRef:
565610
name: update-cert-project-status
566-
when: *certProjectExists
611+
when:
612+
- *certProjectExists
567613
params:
568614
- name: pipeline_image
569615
value: "$(params.pipeline_image)"
@@ -588,7 +634,8 @@ spec:
588634
- update-cert-project-status
589635
taskRef:
590636
name: reserve-operator-name
591-
when: *certProjectExists
637+
when:
638+
- *certProjectExists
592639
params:
593640
- name: pipeline_image
594641
value: "$(params.pipeline_image)"
@@ -662,25 +709,6 @@ spec:
662709
workspace: results
663710
subPath: summary
664711

665-
- name: yaml-lint
666-
runAfter:
667-
- static-tests-results
668-
taskRef:
669-
name: yaml-lint
670-
when: &operatorOrBundleChange
671-
- input: "$(tasks.detect-changes.results.affected_catalogs)"
672-
operator: in
673-
values: [""]
674-
params:
675-
- name: pipeline_image
676-
value: "$(params.pipeline_image)"
677-
- name: args
678-
value: ["-d {extends: default, rules: {line-length: {max: 180, level: warning}, indentation: {indent-sequences: whatever}}}", "$(tasks.detect-changes.results.bundle_path)"]
679-
workspaces:
680-
- name: shared-workspace
681-
workspace: repository
682-
subPath: src
683-
684712
# Merge user's registry tokens with service account credentials
685713
# used elsewhere by this pipeline.
686714
#
@@ -690,7 +718,7 @@ spec:
690718
# our credentials for that registry will be omitted.
691719
- name: merge-registry-credentials
692720
runAfter:
693-
- yaml-lint
721+
- static-tests-results
694722
taskRef:
695723
name: merge-registry-credentials
696724
params:
@@ -783,7 +811,11 @@ spec:
783811
- name: make-bundle-repo-public
784812
runAfter:
785813
- build-bundle
786-
when: *operatorOrBundleChange
814+
when:
815+
- &operatorOrBundleChange
816+
input: "$(tasks.detect-changes.results.affected_catalogs)"
817+
operator: in
818+
values: [""]
787819
taskRef:
788820
name: set-quay-repo-visibility
789821
params:
@@ -818,7 +850,8 @@ spec:
818850
# This is just a temporary location until we have a proper
819851
# FCB branch based on config
820852
- get-supported-versions
821-
when: *catalogChange
853+
when:
854+
- *catalogFileChange
822855
taskRef:
823856
name: add-fbc-fragments-to-index
824857
params:
@@ -851,10 +884,9 @@ spec:
851884
- add-fbc-fragments-to-index
852885
when:
853886
# Run only when a bundle is added and it doesn't use FBC
854-
- input: "$(tasks.detect-changes.results.affected_catalogs)"
855-
operator: in
856-
values: [""]
857-
- input: "$(tasks.read-config.results.fbc-enabled)"
887+
- *bundleAdded
888+
- &isNotFBC
889+
input: "$(tasks.read-config.results.fbc-enabled)"
858890
operator: notin
859891
values: ["true"]
860892
taskRef:
@@ -892,10 +924,9 @@ spec:
892924
- add-fbc-fragments-to-index
893925
when:
894926
# Run only when a bundle is added and it uses FBC
895-
- input: "$(tasks.detect-changes.results.affected_catalogs)"
896-
operator: in
897-
values: [""]
898-
- input: "$(tasks.read-config.results.fbc-enabled)"
927+
- *bundleAdded
928+
- &isFBC
929+
input: "$(tasks.read-config.results.fbc-enabled)"
899930
operator: in
900931
values: ["true"]
901932
taskRef:
@@ -931,7 +962,8 @@ spec:
931962
runAfter:
932963
- add-bundle-to-index
933964
- build-fbc-scratch-catalog
934-
when: *operatorOrBundleChange
965+
when:
966+
- *operatorOrBundleChange
935967
taskRef:
936968
name: set-quay-repo-visibility
937969
params:
@@ -1247,14 +1279,14 @@ spec:
12471279
value: "merged"
12481280

12491281
finally:
1250-
12511282
# Upload the logs of this pipeline.
12521283
# Dependencies on other task results should be minimized. If any
12531284
# of those tasks fail, it'll prevent this task from executing.
12541285
- name: upload-pipeline-logs
12551286
taskRef:
12561287
name: upload-pipeline-logs
1257-
when: *certProjectExists
1288+
when:
1289+
- *certProjectExists
12581290
params:
12591291
- name: pipeline_image
12601292
value: "$(params.pipeline_image)"
@@ -1318,7 +1350,8 @@ spec:
13181350
- name: github-add-connect-url-comment
13191351
taskRef:
13201352
name: github-add-comment
1321-
when: *certProjectExists
1353+
when:
1354+
- *certProjectExists
13221355
params:
13231356
- name: pipeline_image
13241357
value: "$(params.pipeline_image)"

0 commit comments

Comments
 (0)