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(cmd): Add validate subcommand to opm cmd to validate config files #618

Merged
merged 2 commits into from
Apr 9, 2021

Conversation

dinhxuanvu
Copy link
Member

Description of the change:
Validate declarative config (JSON) files in a given directory. The validation
is using the validation library from declcfg, model and property packages.

Signed-off-by: Vu Dinh [email protected]
Motivation for the change:
Allow users to validate their config files.

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

Sorry, something went wrong.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 31, 2021
@codecov
Copy link

codecov bot commented Mar 31, 2021

Codecov Report

Merging #618 (a4520ff) into master (3bc6bf5) will decrease coverage by 0.06%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #618      +/-   ##
==========================================
- Coverage   52.16%   52.10%   -0.07%     
==========================================
  Files          81       81              
  Lines        6397     6403       +6     
==========================================
- Hits         3337     3336       -1     
- Misses       2403     2409       +6     
- Partials      657      658       +1     
Impacted Files Coverage Δ
internal/declcfg/declcfg_to_model.go 86.76% <80.00%> (-10.12%) ⬇️
internal/model/model.go 91.66% <100.00%> (+0.14%) ⬆️

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 3bc6bf5...a4520ff. Read the comment docs.

@dinhxuanvu dinhxuanvu force-pushed the declcfg-validate branch 5 times, most recently from 1bfdc95 to 81bea83 Compare April 8, 2021 04:27
@dinhxuanvu dinhxuanvu changed the title feat(cmd): Add validate subcommand to index cmd to validate config files feat(cmd): Add validate subcommand to opm cmd to validate config files Apr 8, 2021
@timflannagan
Copy link
Member

LGTM but holding for someone that's more up-to-date on this effort.

/lgtm
/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 8, 2021
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2021
@dinhxuanvu
Copy link
Member Author

Folks, please feel free to lgtm and approve but keep the hold in for now. We try to line up the 3 config PRs for merging today and this one should go last to avoid unnecessary rebase. Thanks.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 8, 2021

@dinhxuanvu: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-aws dd63253 link /test 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/test-infra repository. I understand the commands that are listed here.

@ecordell
Copy link
Member

ecordell commented Apr 8, 2021

/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [dinhxuanvu,ecordell]

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

@openshift-ci-robot
Copy link

@dinhxuanvu: PR needs rebase.

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/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 9, 2021
Validate declarative config (JSON) files in a given directory. The validation
is using the validation library from declcfg, model and property packages.

Signed-off-by: Vu Dinh <[email protected]>
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2021
@dinhxuanvu
Copy link
Member Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 9, 2021
1. Missing `defaultChannel` doesn’t get caught and error out as an
empty channel issue which is incorrect.
2. Missing `package` property will result out of bound error
3. Bundles without channel is allowed which will lead to orphaned bundles
4. Bundle without a bundle image is valid when it shouldn’t be. Bundle
must either have bundle image or bundle data (objects).

Signed-off-by: Vu Dinh <[email protected]>
@anik120
Copy link
Contributor

anik120 commented Apr 9, 2021

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2021
@dinhxuanvu dinhxuanvu removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 9, 2021
@joelanford
Copy link
Member

/lgtm
/override codecov/project

@openshift-ci-robot
Copy link

@joelanford: /override requires a failed status context to operate on.
The following unknown contexts were given:

  • codecov/project

Only the following contexts were expected:

  • tide

In response to this:

/lgtm
/override codecov/project

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/test-infra repository.

@timflannagan
Copy link
Member

/override codecov/patch
/override codecov/project

@timflannagan
Copy link
Member

Hmm, it looks like it's possible to override but you may need higher permissions: #611 (comment)?

@openshift-ci-robot
Copy link

@timflannagan: /override requires a failed status context to operate on.
The following unknown contexts were given:

  • codecov/patch
  • codecov/project

Only the following contexts were expected:

  • tide

In response to this:

/override codecov/patch
/override codecov/project

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/test-infra repository.

@dinhxuanvu
Copy link
Member Author

/override codecov/project

@openshift-ci-robot
Copy link

@dinhxuanvu: /override requires a failed status context to operate on.
The following unknown contexts were given:

  • codecov/project

Only the following contexts were expected:

  • tide

In response to this:

/override codecov/project

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/test-infra repository.

@dinhxuanvu
Copy link
Member Author

The PR passed all tests so manually merge this to bypass the codecov.

@dinhxuanvu dinhxuanvu merged commit 1b885c5 into operator-framework:master Apr 9, 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. feat/declarative-config lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants