test-infra icon indicating copy to clipboard operation
test-infra copied to clipboard

Retain LGTM through squashes for kubernetes/kubernetes repo

Open gdsoumya opened this issue 3 years ago • 38 comments

Signed-off-by: Soumya Ghosh Dastidar [email protected]

Closes kubernetes/kubernetes#103096

gdsoumya avatar Jun 23 '21 09:06 gdsoumya

Welcome @gdsoumya!

It looks like this is your first PR to kubernetes/test-infra 🎉. 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/test-infra 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 Jun 23 '21 09:06 k8s-ci-robot

Hi @gdsoumya. Thanks for your PR.

I'm waiting for a kubernetes 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 Jun 23 '21 09:06 k8s-ci-robot

/ok-to-test

MadhavJivrajani avatar Jun 23 '21 10:06 MadhavJivrajani

/sig contributor-experience

sftim avatar Jun 23 '21 16:06 sftim

Ironically, my only nit would be to squash the two commits :)

/approve /hold for nit

chases2 avatar Jun 23 '21 16:06 chases2

/hold cancel (The LGTM's already lost anyway)

chases2 avatar Jun 23 '21 16:06 chases2

/hold

Has this been brought up to contribex yet?

cc @nikhita

cblecker avatar Jun 23 '21 16:06 cblecker

@cblecker, @BenTheElder brought it up yesterday, thanks!

MadhavJivrajani avatar Jun 24 '21 09:06 MadhavJivrajani

LGTM, FWIW

sftim avatar Jun 24 '21 10:06 sftim

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, chases2, gdsoumya

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 Jun 24 '21 20:06 k8s-ci-robot

/label tide/merge-method-squash

MadhavJivrajani avatar Jun 25 '21 04:06 MadhavJivrajani

This was originally enabled in test-infra but disabled in https://github.com/kubernetes/test-infra/pull/14426. The only reason mentioned is this :grimacing:

Also disable the tree hash thing that doesn't seem to be useful

@BenTheElder since you had lgtm'd that PR, do you recall specific reasons why this isn't being used in test-infra today?

I would just feel more confident rolling this out in k/k if k/test-infra endorsed it :smile:

nikhita avatar Jun 30 '21 11:06 nikhita

For what it's worth, this config option will only retain lgtm when the existing commits in a PR are squashed but NOT when the PR is rebased because that will change the tree hash. This seems like a safe option so I'm not really opposed to enabling this but I'm still interested to know why test-infra disabled it.

nikhita avatar Jun 30 '21 11:06 nikhita

Yep, if your rebase does anything except a squash against the same merge base then an existing LGTM still gets cancelled.

sftim avatar Jun 30 '21 11:06 sftim

Memory is hazy but I recall it wasn't working (in a harmless lgtm is still lost on squash kind of way) at one point and hadn't seen it work in test-infra. sftim reports it working in website, I'm happy to enable it in test-infra and kind first and do more testing if we need but I also trust sftim.

Perhaps we can reference an example of WAI?

BenTheElder avatar Jun 30 '21 15:06 BenTheElder

I'll see if I can find a PR where we've seen it work.

sftim avatar Jun 30 '21 16:06 sftim

That's not quite the same thing, but I added an empty commit and then squashed it out with no trouble.

sftim avatar Jun 30 '21 16:06 sftim

Lgtm from me, but would also ack from @cblecker.

/assign @cblecker

We'll also need to send a notice to k-dev once this is rolled out.

nikhita avatar Jul 14 '21 10:07 nikhita

/cc @cblecker Could you PTAL?

MadhavJivrajani avatar Sep 23 '21 05:09 MadhavJivrajani

I have a feeling that the initial implementation didn't work right, but it's been behaving as advertised in k/website for some time.

sftim avatar Nov 22 '21 13:11 sftim

/test pull-test-infra-verify-lint /lgtm

So I did a bunch of testing on this, and the plugin does work as expected. I tried to get around it in a bunch of ways and was unable to. I think this is relatively safe.

I know it definitely wasn't working as expected back in 2018/2019 when @matthyx originally wrote the code.. I don't know if @nikhita's cleanup (https://github.com/kubernetes/test-infra/pull/10579) helped it, although I can't see exactly why. The only other thing I can think of is GitHub fixed some sort of bug in the tree hash they were returning.

We still need a roll out plan with communications, but I have no technical objections to moving this forward.

cblecker avatar Dec 12 '21 02:12 cblecker

For sure @nikhita magic helped <3

matthyx avatar Dec 12 '21 09:12 matthyx

If we can confirm it's now a solid foundation, I'll check whether we can skip CI using the same mechanism... Thanks for following up on this @cblecker

matthyx avatar Dec 12 '21 09:12 matthyx

Anyone want to blog about this on https://k8s.dev/? (if so, there are folks who can help make that happen)

sftim avatar Dec 12 '21 21:12 sftim

/retest

@cblecker @BenTheElder @nikhita what do we do with this?

dims avatar Apr 14 '22 13:04 dims

I am +1 in concept. I don't have context on it working or not currently or what process / approvals we need. cc @mrbobbytables

BenTheElder avatar Apr 14 '22 15:04 BenTheElder

I am +1 on the idea as well. We should get comms rolling and maybe time it after 1.24 code thaw? Thoughts?

mrbobbytables avatar Apr 14 '22 18:04 mrbobbytables

1.24 has been delayed a bit but thaw is coming ...

BenTheElder avatar May 02 '22 06:05 BenTheElder

/easycla

BenTheElder avatar May 02 '22 06:05 BenTheElder

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: gdsoumya / name: Soumya Ghosh Dastidar (f8b688eea890edb0c25b814bbdab992ddbafc5d3, f1a6ce56d5da44c7b630ceba4ea4c04f1bca3fc0)