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

fix(schema): use anyOf for ruleset matching #288

Merged
merged 1 commit into from
May 9, 2023
Merged

Conversation

plyr4
Copy link
Contributor

@plyr4 plyr4 commented May 8, 2023

fixes an issue when using rulesets that match both the normal and the "flattened" props.

Steps to Reproduce

provide the schema to VSCode YAML extension (or use Yaml › Schema Store: Enable) and use the following pipeline syntax:

version: "1"
steps:
  - name: anything
     image: golang
     ruleset:
       continue: true
     commands:
     - "echo hello"

the continue tag within ruleset will match both objects provided in the Ruleset block based on the oneOf matcher.

error:

Matches multiple schemas when only one must validate.yaml-schema: Vela Pipeline Configuration

Note: im not sure if the bug exists for the other blocks using oneOf, i just see the error in ruleset because i apply continues when debugging.

@plyr4 plyr4 requested a review from a team as a code owner May 8, 2023 16:55
@codecov
Copy link

codecov bot commented May 8, 2023

Codecov Report

Merging #288 (abe3f10) into main (a4eb94b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #288   +/-   ##
=======================================
  Coverage   96.90%   96.90%           
=======================================
  Files          57       57           
  Lines        6329     6329           
=======================================
  Hits         6133     6133           
  Misses        145      145           
  Partials       51       51           

1 similar comment
@codecov
Copy link

codecov bot commented May 8, 2023

Codecov Report

Merging #288 (abe3f10) into main (a4eb94b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #288   +/-   ##
=======================================
  Coverage   96.90%   96.90%           
=======================================
  Files          57       57           
  Lines        6329     6329           
=======================================
  Hits         6133     6133           
  Misses        145      145           
  Partials       51       51           

Copy link
Collaborator

@wass3r wass3r left a comment

Choose a reason for hiding this comment

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

lgtm

@plyr4 plyr4 merged commit 1203118 into main May 9, 2023
@plyr4 plyr4 deleted the fix/schema-ruleset branch May 9, 2023 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants