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(constraint): Add constraint type validation to bundle validation #888

Merged
merged 2 commits into from
Dec 15, 2021

Conversation

dinhxuanvu
Copy link
Member

Description of the change:

A new type of dependency named constraint (olm.constraint) which uses
CEL expression is introduced in OLM. This new type is added to
dependencies.json file in the bundle just like gvk and package
dependencies. As a result, a new validation for constraint type
is added to ensure this type will be validated for bundle
dependencies.

Signed-off-by: Vu Dinh vudinh@outlook.com

Motivation for the change:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 15, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu

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 Dec 15, 2021
@dinhxuanvu dinhxuanvu force-pushed the cel-val-3 branch 2 times, most recently from 7512c57 to c649224 Compare December 15, 2021 15:36
anik120 added a commit to anik120/operator-registry that referenced this pull request Dec 15, 2021
In PR operator-framework#888, there's vendoring of the cel-go package, one of which
is named "debug" (github.com/google/cel-go/common/debug). Due to
the .gitignore file ignoring all [Dd]bug folders, the vendored
package isn't being checked in by git, causing the build to fail.
This PR removes the instruction to ignore [Dd]bug/ folders.
@anik120 anik120 mentioned this pull request Dec 15, 2021
5 tasks
anik120 added a commit to anik120/operator-registry that referenced this pull request Dec 15, 2021
In PR operator-framework#888, there's vendoring of the cel-go package, one of which
is named "debug" (github.com/google/cel-go/common/debug). Due to
the .gitignore file ignoring all [Dd]bug folders, the vendored
package isn't being checked in by git, causing the build to fail.
This PR removes the instruction to ignore [Dd]bug/ folders.

Signed-off-by: Anik Bhattacharjee <anikbhattacharya93@gmail.com>
anik120 added a commit to anik120/operator-registry that referenced this pull request Dec 15, 2021
In PR operator-framework#888, there's vendoring of the cel-go package, one of which
is named "debug" (github.com/google/cel-go/common/debug). Due to
the .gitignore file ignoring all [Dd]bug folders, the vendored
package isn't being checked in by git, causing the build to fail.
This PR removes the instruction to ignore [Dd]bug/ folders.

Signed-off-by: Anik Bhattacharjee <anikbhattacharya93@gmail.com>
anik120 added a commit to anik120/operator-registry that referenced this pull request Dec 15, 2021
In PR operator-framework#888, there's vendoring of the cel-go package, one of which
is named "debug" (github.com/google/cel-go/common/debug). Due to
the .gitignore file ignoring all [Dd]bug folders, the vendored
package isn't being checked in by git, causing the build to fail.
This PR removes the instruction to ignore [Dd]bug/ folders.

Signed-off-by: Anik Bhattacharjee <anikbhattacharya93@gmail.com>
openshift-merge-robot pushed a commit that referenced this pull request Dec 15, 2021
In PR #888, there's vendoring of the cel-go package, one of which
is named "debug" (github.com/google/cel-go/common/debug). Due to
the .gitignore file ignoring all [Dd]bug folders, the vendored
package isn't being checked in by git, causing the build to fail.
This PR removes the instruction to ignore [Dd]bug/ folders.

Signed-off-by: Anik Bhattacharjee <anikbhattacharya93@gmail.com>
A new type of dependency named constraint (olm.constraint) which uses
CEL expression is introduced in OLM. This new type is added to
dependencies.json file in the bundle just like gvk and package
dependencies. As a result, a new validation for constraint type
is added to ensure this type will be validated for bundle
dependencies.

Signed-off-by: Vu Dinh <vudinh@outlook.com>

Vendor the constraints pkg from api repo

Signed-off-by: Vu Dinh <vudinh@outlook.com>
@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #888 (df7fcfd) into master (7a09b48) will increase coverage by 0.01%.
The diff coverage is 60.00%.

❗ Current head df7fcfd differs from pull request most recent head 0e30ae2. Consider uploading reports for the commit 0e30ae2 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #888      +/-   ##
==========================================
+ Coverage   52.06%   52.07%   +0.01%     
==========================================
  Files         103      103              
  Lines        9072     9092      +20     
==========================================
+ Hits         4723     4735      +12     
- Misses       3441     3449       +8     
  Partials      908      908              
Impacted Files Coverage Δ
pkg/lib/bundle/validate.go 60.17% <0.00%> (-0.53%) ⬇️
pkg/registry/types.go 28.40% <66.66%> (+9.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a09b48...0e30ae2. Read the comment docs.

Signed-off-by: Vu Dinh <vudinh@outlook.com>
Copy link
Contributor

@anik120 anik120 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 Dec 15, 2021
@openshift-merge-robot openshift-merge-robot merged commit 384af6b into operator-framework:master Dec 15, 2021
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.

3 participants