Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deny merge in CI take 2 #106333

Closed
wants to merge 3 commits into from

Conversation

Noratrieb
Copy link
Member

@Noratrieb Noratrieb commented Dec 31, 2022

Taking up #105058 which was reverted in #106320 because it caused build failures in bors builds.

https://github.com/rust-lang-ci/rust/actions/runs/3810081096/jobs/6481927643#logs

This will prevent users with the pre-push hook from pushing a merge
commit.

Exceptions are added for subtree updates. These exceptions are a little
hacky and may be non-exhaustive but can be extended in the future.

Checkout `master` branch in CI

Add `build_helper` crate to share code between tidy and bootstrap
@rustbot
Copy link
Collaborator

rustbot commented Dec 31, 2022

r? @jyn514

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Dec 31, 2022
@Noratrieb
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Dec 31, 2022

⌛ Trying commit a677f5b57934bdc495cb514429f4f7f536a7cd6b with merge 4567d33aa10280ffe6ffe1633d718320a14f33e1...

@bors
Copy link
Contributor

bors commented Dec 31, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 31, 2022
@Noratrieb
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Dec 31, 2022

⌛ Trying commit fcc7c55 with merge 45c789a001deef1184c065548f06295984523f33...

@bors
Copy link
Contributor

bors commented Dec 31, 2022

☀️ Try build successful - checks-actions
Build commit: 45c789a001deef1184c065548f06295984523f33 (45c789a001deef1184c065548f06295984523f33)

@Noratrieb
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Dec 31, 2022

⌛ Trying commit 5705d73 with merge 1b281d09bc758176d60aeb66ffcd4fb5f97697ce...

@ehuss
Copy link
Contributor

ehuss commented Dec 31, 2022

I think this may not work if the contributor adds any commits after the merge commit, since the fetch depth is only 2. That might be unlikely, but something to be aware of.

@bors
Copy link
Contributor

bors commented Dec 31, 2022

☀️ Try build successful - checks-actions
Build commit: 1b281d09bc758176d60aeb66ffcd4fb5f97697ce (1b281d09bc758176d60aeb66ffcd4fb5f97697ce)

@jyn514
Copy link
Member

jyn514 commented Dec 31, 2022

I think this may not work if the contributor adds any commits after the merge commit, since the fetch depth is only 2. That might be unlikely, but something to be aware of.

False negatives are ok, at worst it means a reviewer needs to tell the author to get rid of the merge, like today. False positives are worse since tidy gives a hard error.

That said we can increase the fetch depth if we need to, I expect ~20 commits will be enough in practice. But let's avoid doing that until we figure out why this broke when it merged last time.

@Mark-Simulacrum
Copy link
Member

It's probably worth seeing if enabling GitHub's "require linear history" would give a visual warning here. I think it is maybe true that bors can be setup to bypass that, in which case we might get something relatively reasonable.

@jyn514
Copy link
Member

jyn514 commented Dec 31, 2022

@Mark-Simulacrum I think you and Pietro are the only ones with access to those settings - do you have time to look into it? I can see about trying this on a personal repo if not so I can link you the exact setting.

We should also make sure that only shows up for merge commits and not when the merge-base for the PR is based on a old commit of master.

@Mark-Simulacrum
Copy link
Member

I can, yes. I'll need a chunk of time around a bors merge so we can fix bors if it goes wrong; it might be best to do it on some other repo (e.g., crater?) that also uses bors.

I can try to make that happen soon.

@Mark-Simulacrum
Copy link
Member

It looks like getting bors to bypass that might be trickier than expected -- so let's assume that strategy won't work for now.

@rust-log-analyzer

This comment has been minimized.

@Noratrieb
Copy link
Member Author

gonna close this, either someone else picks it up or i may continue at some point

@Noratrieb Noratrieb closed this Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants