Skip to content
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

feat: add warning for olm.properties being defined when validating csv #217

Conversation

tylerslaton
Copy link
Contributor

@tylerslaton tylerslaton commented Jan 18, 2022

Summary

To sufficiently address this BZ, this PR adds a warning when a user has defined the same property in the CSV's olm.properties annotation as well as in a properties.yaml. This will act as a soft barrier to users doing this in the future.

Why this is needed

As the olm.properties annotation currently exists to just maintain backwards compatibility, we should warn newly created bundles from using it. Instead, it is a good idea to push them to use the metadata/properties.yaml file.

Copy link
Member

@kevinrizza kevinrizza left a comment

Choose a reason for hiding this comment

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

Just a small nit, otherwise this lgtm

pkg/validation/internal/community.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ankitathomas ankitathomas left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 20, 2022
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

Looking good. Just one small request.

@tylerslaton tylerslaton force-pushed the properties-annotation-warning branch from e533f1c to 2b2ce7a Compare January 20, 2022 20:51
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 20, 2022
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jan 20, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu, tylerslaton

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 20, 2022
Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/hold

  1. Could we not address this one by:

a) In the CSV validator check if properties are defined and then if yes warning asking to use the file properties instead?
b) In the bundle validator check if the CSV and the properties file are defining the same property? If yes, then raise an error because the bundle is defining the same value twice.

After some thoughts about this scenario, I think that it should not be specific to the max OCP version and we could generalize better this one. Also, by doing the above suggestions seems that we would be able to properly solve the BZ by not allowing any duplications.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 23, 2022
@tylerslaton tylerslaton force-pushed the properties-annotation-warning branch from 2b2ce7a to fbd3d5f Compare January 24, 2022 15:21
@tylerslaton
Copy link
Contributor Author

/hold

  1. Could we not address this one by:

a) In the CSV validator check if properties are defined and then if yes warning asking to use the file properties instead? b) In the bundle validator check if the CSV and the properties file are defining the same property? If yes, then raise an error because the bundle is defining the same value twice.

After some thoughts about this scenario, I think that it should not be specific to the max OCP version and we could generalize better this one. Also, by doing the above suggestions seems that we would be able to properly solve the BZ by not allowing any duplications.

Hi Camilla, so a couple of things.

  1. I believe that this PR already satisfies your first point. If you define olm.properties in the CSV's annotation then a warning will be thrown asking the user to define it in metadata/properties.yaml instead.
  2. With this ^ in mind, would it make sense to get this PR merged and then address your second point?

@camilamacedo86
Copy link
Contributor

/hold cancel

@tylerslaton
You are right
/lgtm
/approved

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 25, 2022
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 25, 2022
@openshift-merge-robot openshift-merge-robot merged commit 82aa2d4 into operator-framework:master Jan 25, 2022
@tylerslaton tylerslaton deleted the properties-annotation-warning branch January 26, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants