utils icon indicating copy to clipboard operation
utils copied to clipboard

Align set with k/k apimachinery

Open skitt opened this issue 1 year ago • 15 comments

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This aligns the features of generic Set with the version in apimachinery. The main change is that sets can be instantiated with any comparable type, not only ordered types; as a result, SortedList() can no longer be implemented as a method, and is replaced by the List() function to match apimachinery.

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Release note:

sets.Set accepts any comparable type; the sets.SortedList method is replaced with a sets.List function, to match the apimachinery implementation, and to allow unordered sets to be converted to ordered slices.

skitt avatar Nov 23 '23 14:11 skitt

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: logicalhan, skitt

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:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Nov 23 '23 16:11 k8s-ci-robot

Thanks @logicalhan! There’s a failure in apidiff but I don’t think it’s significant — the changes are expected (or bugs in apidiff).

skitt avatar Nov 23 '23 16:11 skitt

/hold

logicalhan avatar Nov 23 '23 16:11 logicalhan

Thanks @logicalhan! There’s a failure in apidiff but I don’t think it’s significant — the changes are expected (or bugs in apidiff).

It is significant because we don't know who's using this.

logicalhan avatar Nov 23 '23 16:11 logicalhan

It is significant because we don't know who's using this.

The changes are listed as follows:

- KeySet: changed from func(map[E]A) Set[E] to func(map[E]A) Set[E]
- New: changed from func(...E) Set[E] to func(...E) Set[E]
- Set: changed from Set[E ordered] to Set[E comparable]

The first two aren’t changes. The last one is fine because comparable is a superset of ordered, so any existing Set will still build.

skitt avatar Nov 23 '23 16:11 skitt

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Feb 21 '24 16:02 k8s-triage-robot

/remove-lifecycle stale

skitt avatar Feb 21 '24 16:02 skitt

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar May 21 '24 17:05 k8s-triage-robot

/remove-lifecycle stale

skitt avatar May 22 '24 07:05 skitt

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 20 '24 08:08 k8s-triage-robot

/remove-lifecycle stale

skitt avatar Aug 20 '24 11:08 skitt