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

force "HEAD" for non-CI and git_upstream_merge_base for CI environment #131358

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Oct 7, 2024

When rust-lang/rust is configured as remote, some of the git logic (for tracking changed files) that uses get_closest_merge_commit starts to produce annoying results as the upstream branch becomes outdated quickly (since it isn't updated with git pull). We can rely on HEAD for non-CI environments as we specifically treat bors commits as merge commits, which also exist on upstream. As for CI environments, we should use git_upstream_merge_base to correctly track modified files as bors commits may be in HEAD but not yet on the upstream remote.

This is also an alternative fix for #129528 since #131331 reverts the previous fix attempts.

@rustbot
Copy link
Collaborator

rustbot commented Oct 7, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 7, 2024
@onur-ozkan onur-ozkan changed the title exclude upstream check from build_helper::git::get_closest_merge_commit force "HEAD" for non-CI env in in build_helper::git::get_closest_merge_commit Oct 10, 2024
@rust-log-analyzer

This comment has been minimized.

@onur-ozkan
Copy link
Member Author

onur-ozkan commented Oct 10, 2024

thread 'main' panicked at /checkout/src/tools/build_helper/src/git.rs:134:54:
called Result::unwrap() on an Err value: "Cannot find any suitable upstream master branch"

Hmm... More work is needed on this.

@rustbot author

@onur-ozkan onur-ozkan closed this Oct 10, 2024
@rustbot rustbot 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 Oct 10, 2024
@onur-ozkan onur-ozkan reopened this Oct 10, 2024
@rust-log-analyzer

This comment has been minimized.

Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 11, 2024
…bzol

move dummy commit logic into x86_64-gnu-llvm-18

Doing the dummy commit logic in a runner that uses CI-LLVM breaks in merge CI. This should be properly fixed by rust-lang#131358 (see the [actual problem](rust-lang#131448 (comment))). Since we can also fix it by moving the dummy commit into the runner where we use in-tree LLVM, so why not do that as well?
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 11, 2024
…bzol

move dummy commit logic into x86_64-gnu-llvm-18

Doing the dummy commit logic in a runner that uses CI-LLVM breaks in merge CI. This should be properly fixed by rust-lang#131358 (see the [actual problem](rust-lang#131448 (comment))). Since we can also fix it by moving the dummy commit into the runner where we use in-tree LLVM, so why not do that as well?
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2024
move dummy commit logic into x86_64-gnu-llvm-18

Doing the dummy commit logic in a runner that uses CI-LLVM breaks in merge CI. This should be properly fixed by rust-lang#131358 (see the [actual problem](rust-lang#131448 (comment))). Since we can also fix it by moving the dummy commit into the runner where we use in-tree LLVM, so why not do that as well?
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Oct 11, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2024
move dummy commit logic into x86_64-gnu-llvm-18

Doing the dummy commit logic in a runner that uses CI-LLVM breaks in merge CI. This should be properly fixed by rust-lang#131358 (see the [actual problem](rust-lang#131448 (comment))). Since we can also fix it by moving the dummy commit into the runner where we use in-tree LLVM, so why not do that as well?
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 11, 2024
move dummy commit logic into x86_64-gnu-llvm-18

Doing the dummy commit logic in a runner that uses CI-LLVM breaks in merge CI. This should be properly fixed by rust-lang#131358 (see the [actual problem](rust-lang#131448 (comment))). Since we can also fix it by moving the dummy commit into the runner where we use in-tree LLVM, so why not do that as well?
@onur-ozkan onur-ozkan changed the title force "HEAD" for non-CI env in in build_helper::git::get_closest_merge_commit force "HEAD" for non-CI and git_upstream_merge_base for CI environment Oct 12, 2024
When rust-lang/rust is configured as remote, some of the git
logic (for tracking changed files) that uses get_closest_merge_commit
starts to produce annoying results as the upstream branch becomes outdated
quickly (since it isn't updated with git pull). We can rely on HEAD for
non-CI environments as we specifically treat bors commits as merge commits,
which also exist on upstream. As for CI environments, we should use
`git_upstream_merge_base` to correctly track modified files as bors commits
may be in `HEAD` but not yet on the upstream remote.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan
Copy link
Member Author

Added new CI step that prepares remote upstream and adjusted the PR description.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 12, 2024
Signed-off-by: onur-ozkan <work@onurozkan.dev>
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-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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants