Skip to content

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

Merged
openshift-merge-robot merged 1 commit into
operator-framework:masterfrom
tylerslaton:properties-annotation-warning
Jan 25, 2022
Merged

feat: add warning for olm.properties being defined when validating csv#217
openshift-merge-robot merged 1 commit into
operator-framework:masterfrom
tylerslaton:properties-annotation-warning

Conversation

@tylerslaton

@tylerslaton tylerslaton commented Jan 18, 2022

Copy link
Copy Markdown
Contributor

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.

@kevinrizza kevinrizza left a comment

Copy link
Copy Markdown
Member

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

Comment thread pkg/validation/internal/community.go Outdated

@ankitathomas ankitathomas left a comment

Copy link
Copy Markdown
Contributor

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

@dinhxuanvu dinhxuanvu left a comment

Copy link
Copy Markdown
Member

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

@dinhxuanvu dinhxuanvu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/approve

@openshift-ci

openshift-ci Bot commented Jan 20, 2022

Copy link
Copy Markdown

[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

Details 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
Comment thread pkg/validation/internal/community.go Outdated

@camilamacedo86 camilamacedo86 left a comment

Copy link
Copy Markdown
Contributor

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
Signed-off-by: Tyler Slaton <tyslaton@redhat.com>
@tylerslaton
tylerslaton force-pushed the properties-annotation-warning branch from 2b2ce7a to fbd3d5f Compare January 24, 2022 15:21
@tylerslaton

Copy link
Copy Markdown
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
Copy Markdown
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