Generate json schema#1644
Conversation
Signed-off-by: David Gageot <david@gageot.net>
Also check a test time that schema are up to date. Signed-off-by: David Gageot <david@gageot.net>
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.
How are you going to keep this file up to date?
There was a problem hiding this comment.
+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.
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.
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.
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.
+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 <david@gageot.net>
|
@balopat This should be better now |
Signed-off-by: David Gageot <david@gageot.net>
Make sure a json schema is generated for each version of the
skaffold.yaml