Add json/protobuf/yaml fixtures#78309
Conversation
8551412 to
d515c9f
Compare
smarterclayton
left a comment
There was a problem hiding this comment.
Some structural things
|
addressed comments required for initial merge. I want to get this in asap to get primary API types protected, and do the additional API dirs as follow-ups |
|
/priority important-soon |
|
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
|
/hold cancel merge queue is emptyish. will need to update this for a few API PRs that merged |
|
/test pull-kubernetes-bazel-test |
|
/retest Review the full test history for this PR. Silence the bot with an |
--- FAIL: TestCompatibility/core.v1.ListOptions/v1.14.0 (0.02s)
compatibility.go:472: proto differs
compatibility.go:474: strings.Join({
... // 10 identical lines
" 7: 6780787122834727873",
` 8: "5"`,
+ " 9: 0",
"}",
`3: ""`,
... // 2 identical lines
}, "\n")
Caused by https://github.com/kubernetes/kubernetes/pull/74074/files#diff-eca3b8d856fa2e661f6da91b61de5e76R364
--- FAIL: TestCompatibility/admission.k8s.io.v1beta1.AdmissionReview/v1.14.0 (0.02s)
compatibility.go:460: json differs
compatibility.go:461: strings.Join({
... // 31 identical lines
` "object": {"apiVersion":"example.com/v1","kind":"CustomType","spec":{"replicas":1},"status":{"available":1}},`,
` "oldObject": {"apiVersion":"example.com/v1","kind":"CustomType","spec":{"replicas":1},"status":{"available":1}},`,
- ` "dryRun": true`,
+ ` "dryRun": true,`,
+ ` "options": null`,
" },",
` "response": {`,
... // 33 identical lines
}, "\n")
compatibility.go:466: yaml differs
compatibility.go:467: strings.Join({
... // 23 identical lines
" available: 1",
" operation: 祈¡ıŵDz廔ȇ{sŊƏp饏姥呄鐊",
+ " options: null",
" resource:",
` group: "5"`,
... // 38 identical lines
}, "\n")
compatibility.go:472: proto differs
compatibility.go:474: strings.Join({
... // 37 identical lines
" }",
" 11: 1",
+ ` 12: ""`,
+ ` 15: ""`,
" }",
" 2 {",
... // 36 identical lines
}, "\n")
Null `options` in json and additional proto tag 12 caused by kubernetes#77563 (comment)
Proto tag 15 caused by https://github.com/kubernetes/kubernetes/pull/78135/files#diff-3bc4acaf71b6b50648da046287017c54R82
|
New changes are detected. LGTM label has been removed. |
|
rebased/regenerated fixtures for master |
|
retagging after rebase |
|
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
|
/retest Review the full test history for this PR. Silence the bot with an |
|
/retest |
|
/retest Review the full test history for this PR. Silence the bot with an |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Adds roundtrip testing to/from persisted fixtures we can snapshot per release.
This will give us confidence bumps of proto libraries aren't breaking backwards compatibility with old serialized data.
Special notes for your reviewer:
Follow-ups:
make update- Add helper script to regenerate API compatibility data, testdata README #78656add fixtures for apiextensions (CRD and ConversionReview types - fuzzing needs some special casing)tracked in Add serialization fixtures for apiextensions (CRD and ConversionReview types) #79026add fixtures for kube-aggregator (APIService types)tracked in Add serialization fixtures for kube-aggregator (APIService type) #79027add fixtures for table output (PartialObjectMetadata, Table types - fuzzing needs some special casing)tracked in Add serialization fixtures for meta APIs (PartialObjectMetadata, Table types) #79028git checkout v1.15.0 cp -fr ./staging/src/k8s.io/api/testdata/HEAD/ ./staging/src/k8s.io/api/testdata/v1.15.0 git checkout master git add ./staging/src/k8s.io/api/testdata/v1.15.0 git commit -m "Add API compatibility data for v1.15.0Fix RawExtension normalization in yaml->json which causes DeepEqual failuretracked in RawExtension yaml/json doesn't roundtrip to equal objects - causes ControllerRevisions that can break update validation #73655Does this PR introduce a user-facing change?:
/sig api-machinery
/sig architecture
/cc @smarterclayton