-
Notifications
You must be signed in to change notification settings - Fork 13.3k
CI: Verify commits in beta & stable are in upstream branches. #87604
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pietroalbini (or someone else) soon. Please see the contribution instructions for more information. |
I'll soon go on vacation and I won't have time to review PRs then. r? @Mark-Simulacrum? |
866316f
to
ec8937a
Compare
Could you add some documentation indicating what the outputs are / limitations here etc? For example, it looks like there are a number of commits different between the branches, but it's not quite clear to me what the expectations are for when those need to be updated and such. We'll also want to be careful to avoid a situation where editing these files to include a commit is "impossible" because that would change the commit hash. At a quick glance, it seems like this could be a problem. Maybe instead of a single file tracking this information, we would prefer to ensure that each commit on the beta and stable branches have a line in them indicating the corresponding hash on the master branch, e.g.,
|
1317a42
to
3524ac6
Compare
This comment has been minimized.
This comment has been minimized.
3524ac6
to
44e6ea7
Compare
@Mark-Simulacrum That all makes sense. I've implemented your Edit: Thought about it some more... This works fine if a single commit requires conflict resolution. However, if you merge an entire branch into (e.g.) |
This comment has been minimized.
This comment has been minimized.
44e6ea7
to
c85586b
Compare
Yeah, this is expected. I usually cherry-pick commits one by one anyway, so it shouldn't really be a big deal. Can we add a script like src/tools/cherry-pick.sh which is essentially a wrapper around git cherry-pick but additionally edits the commit message after picking to include the backport-of line? I'd suggest using the git cherry-pick -x option, but it looks like that doesn't include the upstream commit hash if the commit has conflicts when cherry picking, so it won't quite work for us... |
b3544af
to
78fc6c7
Compare
78fc6c7
to
18cd4d2
Compare
src/tools/cherry-pick.sh
Outdated
git cherry-pick $sha | ||
git commit \ | ||
--amend \ | ||
--file <(commit_message_with_backport_note $sha) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you refactor this to take multiple parameters (and just cherry-pick each in turn, just like the normal cherry pick)?
18cd4d2
to
cbc1b96
Compare
Update: It's fixed, and should be good to review / possibly merge. ✔️ |
cbc1b96
to
8a36b7a
Compare
@Mark-Simulacrum If I understand your comment correctly, I don't think this script works if your cherry-pick has a conflict. You get dumped into the conflict resolution phase and the subsequent This gets worse if you have a conflict in the middle of a long series of commits, as the first n commits may be successfully applied, but n+1 breaks. I don't see how to fix this easily. |
Hm. Yes, I see your point. I think it might be possible that we can make it work using
But I'm not sure whether that file is documented anywhere or if editing it is in anyway feasible. It's probably not a huge deal for us to manually deal with conflicts and amend commits after the fact; CI will yell at us after all... |
I think if we can get it to work via GIT_EDITOR somehow, then let's try that, but if not, then no big deal. |
Let's stick with the present approach. I've just tested it and |
Oh, one more thought: we will have commits on beta/stable that are specific to those branches, such as 56397e9 -- those will want their own annotation like "backport-of: nothing" or something, still explicitly denoted. Could you add that support? I think that's the last thing. |
4da9770
to
f19ba35
Compare
@bors r+ rollup Thanks! Looking forward to seeing this work in practice so we can see how effective/painful it is. |
📌 Commit f19ba35 has been approved by |
Thanks for reviewing. Feel free to tag me in followup work if it would be helpful. |
Rollup of 13 pull requests Successful merges: - rust-lang#87604 (CI: Verify commits in beta & stable are in upstream branches.) - rust-lang#88057 (Update RELEASES to clarify attribute macro values.) - rust-lang#88072 (Allow the iOS toolchain to be built on Linux) - rust-lang#88170 (Update release note for 1.55.0.) - rust-lang#88172 (Test that type alias impl trait happens in a submodule) - rust-lang#88179 (Mailmap entry for myself) - rust-lang#88182 (We meant to use a trait instead of lifetime here) - rust-lang#88183 (test TAIT in different positions) - rust-lang#88189 (Add TAIT struct test) - rust-lang#88192 (Use of impl trait in an impl as the value for an associated type in a dyn) - rust-lang#88194 (Test use of impl Trait in an impl as the value for an associated type in an impl trait) - rust-lang#88197 (Test tait use in a fn type) - rust-lang#88201 (Test that incomplete inference for TAITs fail) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Closes #74721
I think this does the trick. #87597 is an example of it failing as it should.