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

chore(config): add Json/Cue schema #1196

Merged
merged 20 commits into from
Dec 7, 2022
Merged

chore(config): add Json/Cue schema #1196

merged 20 commits into from
Dec 7, 2022

Conversation

markphelps
Copy link
Collaborator

@markphelps markphelps commented Dec 6, 2022

Closes: #1195

Adds JSON schema that can be used to validate YAML config files as well (using yaml-lang-server https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) annotations

Also add cue spec from importing the JSON schema like:

cue import -f -p flipt -l '#FliptSpec:' ./config/flipt.schema.json

(https://cuetorials.com/first-steps/convert-jsonschema/)

Validated Ex:

flipt/config - » cue vet ./production.yml ./flipt.schema.cue -d "#FliptSpec"

@markphelps markphelps requested a review from a team as a code owner December 6, 2022 01:56
@markphelps markphelps marked this pull request as draft December 6, 2022 01:57
@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2022

Codecov Report

Merging #1196 (3cb6cbc) into main (0c5478a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1196   +/-   ##
=======================================
  Coverage   79.87%   79.87%           
=======================================
  Files          38       38           
  Lines        2758     2758           
=======================================
  Hits         2203     2203           
  Misses        451      451           
  Partials      104      104           
Impacted Files Coverage Δ
internal/config/config.go 82.30% <ø> (ø)
internal/config/log.go 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pull-request-size pull-request-size bot added size/XL and removed size/L labels Dec 6, 2022
@markphelps markphelps changed the title chore: add Json schema chore: add Json/Cue schema Dec 6, 2022
@markphelps markphelps marked this pull request as ready for review December 6, 2022 20:29
@markphelps markphelps changed the title chore: add Json/Cue schema chore(config): add Json/Cue schema Dec 7, 2022
@@ -0,0 +1,112 @@
package flipt

#FliptSpec: {
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Copy link
Contributor

@GeorgeMac GeorgeMac left a comment

Choose a reason for hiding this comment

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

This is great!

@markphelps markphelps merged commit 18ede65 into main Dec 7, 2022
@markphelps markphelps deleted the json-schema branch December 7, 2022 14:22
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.

[FLI-104] Create JSON Schema for YAML config
3 participants