Skip to content

OPRUN-3795: Initial implementation for catalog consistency tests #320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Apr 17, 2025

This PR introduces the initial implementation to allow us to begin testing the catalogues.

The following is the output of its execution.

latest_results.txt

c/c @grokspawn @dtfranz @joelanford

@camilamacedo86 camilamacedo86 changed the title Catalog sync second poc OPRUN-3795: Catalog-Sync Initial implementation to validate catalogs Apr 17, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 17, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 17, 2025

@camilamacedo86: This pull request references OPRUN-3795 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@camilamacedo86 camilamacedo86 changed the title OPRUN-3795: Catalog-Sync Initial implementation to validate catalogs OPRUN-3795: Catalog-Sync Initial implementation to validate catalogs (POC 2.0) Apr 17, 2025
Copy link
Contributor

openshift-ci bot commented Apr 17, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: camilamacedo86
Once this PR has been reviewed and has the lgtm label, please assign oceanc80 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@camilamacedo86 camilamacedo86 force-pushed the catalog-sync-second-poc branch from 44d12e9 to 963c77f Compare April 17, 2025 20:11
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 17, 2025

@camilamacedo86: This pull request references OPRUN-3795 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

In response to this:

This PR introduces the initial implementation to allow us to begin testing the catalogues.

Following attached output of its execution

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 17, 2025

@camilamacedo86: This pull request references OPRUN-3795 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

In response to this:

This PR introduces the initial implementation to allow us to begin testing the catalogues.

The following is the output of its execution.

result.txt

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@camilamacedo86 camilamacedo86 force-pushed the catalog-sync-second-poc branch 2 times, most recently from eaea787 to 680d4cf Compare April 22, 2025 08:50
Comment on lines 84 to 95
// Required to allow run the tests on Mac
sysCtx := &types.SystemContext{
OSChoice: "linux",
ArchitectureChoice: "amd64",
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-disposing containers/image to a particular OS and arch will interfere with our ability to evaluate the image at the OCI level.

We want to actually evaluate the root reference. We don't want containers/image automatically de-referencing a manifest list/index and giving us just one of the underlying manifests.

This reminds me: for each root reference, we:

  1. expect it to be a manifest list or index (I'm not sure which, we should figure that out and then require either manifest list or index, not either).
  2. will have N filesystem and FBC checks to run, where N is the number of manifests in the manifest list/index.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we’re still able to handle manifest lists—we can loop through the items and run checks as expected.

This change was mostly to make tests work on Mac. Without setting the OS, I was getting this error:

err: <*errors.errorString>{
    s: "no image found in manifest list for architecture \"arm64\", variant \"v8\", OS \"darwin\"", <== see looking for darwin :-( 
}

I cleaned it up a bit and added a comment. Hope that’s okay!

Thanks!

@camilamacedo86 camilamacedo86 force-pushed the catalog-sync-second-poc branch 3 times, most recently from 0775f31 to 0185984 Compare April 23, 2025 13:12
// }
sysCtx := &types.SystemContext{
OSChoice: "linux",
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joelanford ^ See the comment and update to clarify it better.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 24, 2025

@camilamacedo86: This pull request references OPRUN-3795 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

In response to this:

This PR introduces the initial implementation to allow us to begin testing the catalogues.

The following is the output of its execution.

result.txt

c/c @grokspawn @dtfranz @joelanford

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Comment on lines 22 to 28
var images = []string{
"registry.redhat.io/redhat/community-operator-index:v4.18",
"registry.redhat.io/redhat/redhat-marketplace-index:v4.18",
"registry.redhat.io/redhat/certified-operator-index:v4.18",
"registry.redhat.io/redhat/redhat-operator-index:v4.18",
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now it is okay for these to be hardcoded, but let's change these to 4.19 tags. We are technically now in 4.20 development window, but I don't think 4.20 catalogs have been bootstrapped.

As soon as this merges, we should open a PR to bump these to 4.20 (which will fail), and then we go hound the pipelines to get the 4.20 bootstrapping done.

As a follow-up to this PR, we should avoid maintaining this list separately. We already have a set of default catalogs in our openshift manifests, so it would be nice to derive this list from our existing default ClusterCatalog objects.

Copy link
Contributor Author

@camilamacedo86 camilamacedo86 Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I updated to 4.19 and we can track this need.
We do that in a follow up.


var _ = Describe("Catalog Image Validation Suite", func() {
for _, url := range images {
name := getImageNameFrom(url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some reason we need to do the name remapping? It could be useful if the entire ref shows up in the test name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are showing the name of the image
Do we need more than that?
I think the full URL is too long
WDYT

@@ -0,0 +1,3 @@
.PHONY: test-catalog-sync
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning behind adding a whole new Makefile? Does it not make sense to just add this to openshift/Makefile? It would make it easier to run the commands through the openshift/release CI if they're all using the same Makefile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests aren't directly related to OLMv1 components or its release.

The idea behind placing them under the catalog-sync directory was to keep everything related to those tests self-contained. That way, if we ever need to move or remove them in the future, it’ll be easier to manage without impacting other parts of the project. It also helps with maintainability and clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On top of that, we might need to add more targets in the future.

@camilamacedo86 camilamacedo86 force-pushed the catalog-sync-second-poc branch 6 times, most recently from efd4a53 to bf6e08e Compare April 25, 2025 02:23
Comment on lines 14 to 15
CatalogHasValidMetadata(),
CatalogHasValidMetadataForChannelHeads(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I think we flew past each other in yesterday's review I left in this area.

The metadata check should be:

  1. All channel heads have olm.csv.metadata
  2. Nothing has olm.bundle.object

We have no opinion (yet) about whether non-channel heads have olm.csv.metadata

Copy link
Contributor Author

@camilamacedo86 camilamacedo86 Apr 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @joelanford

OK. I am changing for that. However, that does not seems the check that we have in : https://github.com/konflux-ci/build-definitions/blob/main/task/fbc-validation/0.1/fbc-validation.yaml#L236-L253

(Code shared ^ when we did our first meeting) I mean, looking the code above I understand that we should check

				var hasCSV, hasObject bool
				for _, prop := range bundle.Properties {
					if prop.Type == "olm.csv.metadata" {
						hasCSV = true
					}
					if prop.Type == "olm.bundle.object" {
						hasObject = true
					}
				}
				if (hasCSV && hasObject) || (!hasCSV && !hasObject) {
					errs = append(errs, fmt.Errorf("bundle %q in package %q has both or "+
						"neither of olm.bundle.object / olm.csv.metadata", bundle.Name, bundle.Package))
				}

Instead of ensuring that all bundles do not have :

					if prop.Type == "olm.bundle.object" {
						hasObject = true
					}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neverless it is done as requested now 👍 So, addressed.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 27, 2025

@camilamacedo86: This pull request references OPRUN-3795 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

In response to this:

This PR introduces the initial implementation to allow us to begin testing the catalogues.

The following is the output of its execution.

latest_results.txt

c/c @grokspawn @dtfranz @joelanford

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@camilamacedo86 camilamacedo86 force-pushed the catalog-sync-second-poc branch from b88bfe4 to 354800a Compare April 27, 2025 09:48
@camilamacedo86 camilamacedo86 force-pushed the catalog-sync-second-poc branch from 354800a to dbf3a57 Compare April 27, 2025 10:03
@camilamacedo86 camilamacedo86 changed the title OPRUN-3795: Catalog-Sync Initial implementation to validate catalogs (POC 2.0) OPRUN-3795: Initial implementation for catalog consistency tests Apr 27, 2025
@camilamacedo86
Copy link
Contributor Author

/test openshift-e2e-aws

Copy link
Contributor

openshift-ci bot commented Apr 28, 2025

@camilamacedo86: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn dbf3a57 link false /test okd-scos-e2e-aws-ovn
ci/prow/openshift-e2e-aws-techpreview dbf3a57 link false /test openshift-e2e-aws-techpreview
ci/prow/openshift-e2e-aws dbf3a57 link true /test openshift-e2e-aws

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants