kubernetes / kube-openapi

Kubernetes OpenAPI spec generation & serving
Apache License 2.0
319 stars 208 forks source link

bugfix: resolve non-determinism in deduplicating enum comments #460

Closed alexzielenski closed 8 months ago

alexzielenski commented 8 months ago

649db6989aaecdd64cc4ea16b76e0d0067664001 included a bugfix for duplicated enum values, but did not account for the re-exported enum values not having identical comments. This led to non-deterministic iteration order over the enum types and an output that would change descriptions almost every time you ran it

This PR is a simple fix by applying a deterministic tie breaker (length). If length is equal, then we take the alphabetically lower godoc.

k8s-ci-robot commented 8 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexzielenski

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
thockin commented 8 months ago

Confirmedt that this fixes my problem, and I no longer see it flipping.

thockin commented 8 months ago

/lgtm