kubernetes / kube-openapi

Kubernetes OpenAPI spec generation & serving
Apache License 2.0
317 stars 205 forks source link

Use gengo/v2 in kube-openapi #458

Closed thockin closed 7 months ago

thockin commented 7 months ago

This is needed to support Go workspaces in k/k.

This is done as several small commits so each step can be seen. It has the unfortunate effect of not compiling at each step.

@liggitt @alexzielenski @jpbetz

liggitt commented 7 months ago

hmm, integration test CI looks unhappy

thockin commented 7 months ago

Yeah, I am looking at it.

TL;DR: it seems to run openapi-gen and then re-run it witrh --verify. I must be misunderstanding it.

Jefftree commented 7 months ago

We have a separate go.mod file for the integration test directory. I'm assuming the go.mod there needs to be updated as well

thockin commented 7 months ago

Test should pass now.

The integration test at HEAD is B-R-O-K-E-N. Running it man ually leaves uncommitted changes, but the test passes. The test itself runs openapi-gen (which generates a delta) then runs a verify against the fresh delta, which passes. The test could literally never fail (unless it exits non-zero).

I don't know why the delta exists. It seems to be a regression in formatting? See https://github.com/kubernetes/kube-openapi/pull/458/commits/d1213fd88d6d30090194811a5edbb2b6392237e8

If the delta is expected, it's fixed here. If not, someone show me why?

This PR now changes the test to generate code into the temp dir and diff, just like it does for the reports and other files.

liggitt commented 7 months ago

/lgtm

liggitt commented 7 months ago

/approve /hold for good kube-openapi output in the k/k PR that pulls this in

thockin commented 7 months ago

I can't really fix k/k until this merges, but almost all of these commits came straight out of my k/k tree

/remove-hold

thockin commented 7 months ago

/unhold

alexzielenski commented 7 months ago

/hold cancel

alexzielenski commented 7 months ago

/approve

k8s-ci-robot commented 7 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexzielenski, liggitt, thockin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes/kube-openapi/blob/master/OWNERS)~~ [alexzielenski] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment