-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Generate json schema #1644
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
Generate json schema #1644
Conversation
Signed-off-by: David Gageot <[email protected]>
Also check a test time that schema are up to date. Signed-off-by: David Gageot <[email protected]>
77a2282
to
20afeca
Compare
Codecov Report
@@ Coverage Diff @@
## master #1644 +/- ##
=========================================
+ Coverage 46.95% 47.76% +0.8%
=========================================
Files 119 120 +1
Lines 5143 5337 +194
=========================================
+ Hits 2415 2549 +134
- Misses 2480 2532 +52
- Partials 248 256 +8
Continue to review full report at Codecov.
|
# schema generation | ||
|
||
.PHONY: generate-schemas | ||
generate-schemas: |
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.
How are you going to keep this file up to date?
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.
+1 we should write a script similar to hack/check-docs.sh that runs the generate-schemas target on schema changes and if there are changes then fails the build.
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.
ignore me - there is a unit test for that - https://github.com/GoogleContainerTools/skaffold/pull/1644/files#diff-075a0df1686535f0bc3a3408646079c6
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.
yes, there's a unit test. That'll do it for now. Another option would be to generate those files only on a release.
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.
it looks good to me, a minor thing though, generating a new config version breaks now, as the schema file doesn't exist yet - either the new_config script should take care of this or I'd rather have the schema generation take it as an empty file and generate a new one:
--- FAIL: TestSchemas (0.01s)
main_test.go:26: unable to check json schemas: unable to read existing schema for version skaffold/v1beta6: open ../schemas/v1beta6.json: no such file or directory
# schema generation | ||
|
||
.PHONY: generate-schemas | ||
generate-schemas: |
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.
+1 we should write a script similar to hack/check-docs.sh that runs the generate-schemas target on schema changes and if there are changes then fails the build.
Signed-off-by: David Gageot <[email protected]>
@balopat This should be better now |
Signed-off-by: David Gageot <[email protected]>
Make sure a json schema is generated for each version of the
skaffold.yaml