-
Notifications
You must be signed in to change notification settings - Fork 113
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 json schema validation with ajv #1167
Conversation
@@ -0,0 +1,17 @@ | |||
// eslint-disable-next-line @typescript-eslint/no-var-requires |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't know how to use import
here
src/parser.ts
Outdated
assert(valid, | ||
chalk` | ||
Invalid gitlab-ci configuration! It have failed the json schema validation. Dump the following to the pipeline editor to debug: | ||
${yaml.dump(gitlabData)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently only dumping out the yaml...
can't really find a nice way to parse the validate.errors that catches all scenarios
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure I saw a way to pretty print AJV errors somewhere, let me dig around.
… collision in json schema
3cfb58d
to
b5f6e38
Compare
MR should be ready now. the ajv will be a second layer check... Main motivation is that the ajv will make Given the following gitlab-ci.yml input: default:
tags:
- 1
foo:
image: bash
script:
- echo
|
Quality Gate passedIssues Measures |
@ANGkeith I've approved, I'll test and publish a new version tomorrow, if you have merged this by then. |
fixes #859
Main motivation is that the ajv will make
gitlab-ci-local
less likely to produce false positive