controller-tools icon indicating copy to clipboard operation
controller-tools copied to clipboard

:sparkles: Markers can now indicate their priority when applying

Open dprotaso opened this issue 3 years ago • 5 comments

There's a need for more control over when SchemaMarkers are applied to a Schema. Right now there are two levels - 'First' and everything else. The iteration over the markers within this level is non-deterministic because we're iterating over a golang map type.

As an alternative we now collect all the markers and sort them based on a new priority. Markers can signal their priority by implementing the optional interface


type ApplyPriority int64

type ApplyPriorityMarker interface {
 	ApplyPriority() ApplyPriority
 }

This change is backwards compatible - downstream markers that implement ApplyFirst() will behave the same as before.

dprotaso avatar Jul 15 '22 17:07 dprotaso

Welcome @dprotaso!

It looks like this is your first PR to kubernetes-sigs/controller-tools 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/controller-tools has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Jul 15 '22 17:07 k8s-ci-robot

Hi @dprotaso. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jul 15 '22 17:07 k8s-ci-robot

/assign @vincepri @alvaroaleman

dprotaso avatar Jul 15 '22 17:07 dprotaso

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dprotaso To complete the pull request process, please ask for approval from alvaroaleman after the PR has been reviewed.

The full list of commands accepted by this bot can be found 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 Jul 15 '22 18:07 k8s-ci-robot

/ok-to-test

vincepri avatar Aug 24 '22 02:08 vincepri

Hey folks, just following up - is there anything else needed for this PR?

dprotaso avatar Oct 17 '22 14:10 dprotaso

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dprotaso Once this PR has been reviewed and has the lgtm label, please ask for approval from alvaroaleman by writing /assign @alvaroaleman in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 Dec 05 '22 18:12 k8s-ci-robot

@camilamacedo86 done - take a look

dprotaso avatar Dec 05 '22 18:12 dprotaso

Hi - folks just following up

dprotaso avatar Jan 17 '23 20:01 dprotaso

bump @vincepri @alvaroaleman

dprotaso avatar Feb 03 '23 14:02 dprotaso

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 24 '23 18:05 k8s-triage-robot

Seems like prow is broken?

/retest

dprotaso avatar May 29 '23 13:05 dprotaso

/test pull-controller-tools-test-master

dprotaso avatar May 29 '23 13:05 dprotaso

/retest

dprotaso avatar Jun 19 '23 23:06 dprotaso

Prow started working again

@vincepri and/or @alvaroaleman PTAL

dprotaso avatar Jun 19 '23 23:06 dprotaso

The Kubernetes project currently lacks enough active 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 rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

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

/lifecycle rotten

k8s-triage-robot avatar Jul 20 '23 00:07 k8s-triage-robot

@vincepri and/or @alvaroaleman PTAL

dprotaso avatar Aug 18 '23 00:08 dprotaso

@vincepri @alvaroaleman can you take a look please?

dprotaso avatar Oct 23 '23 14:10 dprotaso

/lifecycle frozen

dprotaso avatar Jan 15 '24 15:01 dprotaso

@dprotaso: The lifecycle/frozen label cannot be applied to Pull Requests.

In response to this:

/lifecycle frozen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jan 15 '24 15:01 k8s-ci-robot

/remove-lifecycle rotten

dprotaso avatar Jan 15 '24 15:01 dprotaso

@vincepri @joelanford @alvaroaleman @sbueringer - is there anything holding up this PR? I've addressed the initial PR reviews.

dprotaso avatar Jan 15 '24 15:01 dprotaso

Thank you!

/lgtm

/assign @alvaroaleman @vincepri

sbueringer avatar Jan 31 '24 18:01 sbueringer

LGTM label has been added.

Git tree hash: 8f0d552eda3a900ac0aaf3c11be5cc66565bc7ce

k8s-ci-robot avatar Jan 31 '24 18:01 k8s-ci-robot

/approve

Thank you very much!

sbueringer avatar Feb 05 '24 10:02 sbueringer

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, sbueringer

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 Feb 05 '24 10:02 k8s-ci-robot