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

Merged
merged 2 commits into from
Oct 13, 2024

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.

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 <[email protected]>
@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
@Mark-Simulacrum
Copy link
Member

r=me if you think this is ready

@onur-ozkan
Copy link
Member Author

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Oct 12, 2024

📌 Commit 4454fa9 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 12, 2024
tgross35 added a commit to tgross35/rust that referenced this pull request Oct 12, 2024
force "HEAD" for non-CI and `git_upstream_merge_base` for CI environment

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 rust-lang#129528 since rust-lang#131331 reverts the previous fix attempts.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#131120 (Stabilize `const_option`)
 - rust-lang#131207 (ci: aarch64-gnu-debug job)
 - rust-lang#131334 (Enable sanitizers for loongarch64-unknown-*)
 - rust-lang#131358 (force "HEAD" for non-CI and `git_upstream_merge_base` for CI environment)
 - rust-lang#131418 (Use throw intrinsic from stdarch in wasm libunwind)
 - rust-lang#131579 (Remap path prefix in the panic message of `tests/ui/meta/revision-bad.rs`)
 - rust-lang#131591 (add latest crash tests)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#131120 (Stabilize `const_option`)
 - rust-lang#131334 (Enable sanitizers for loongarch64-unknown-*)
 - rust-lang#131358 (force "HEAD" for non-CI and `git_upstream_merge_base` for CI environment)
 - rust-lang#131418 (Use throw intrinsic from stdarch in wasm libunwind)
 - rust-lang#131579 (Remap path prefix in the panic message of `tests/ui/meta/revision-bad.rs`)
 - rust-lang#131591 (add latest crash tests)
 - rust-lang#131626 (remove a couple of redundant String to String conversion)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ef96679 into rust-lang:master Oct 13, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Oct 13, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2024
Rollup merge of rust-lang#131358 - onur-ozkan:129528, r=Mark-Simulacrum

force "HEAD" for non-CI and `git_upstream_merge_base` for CI environment

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 rust-lang#129528 since rust-lang#131331 reverts the previous fix attempts.
@onur-ozkan onur-ozkan deleted the 129528 branch October 13, 2024 07:11
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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants