-
Notifications
You must be signed in to change notification settings - Fork 24k
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
🧪 Let ansible-test
diff ancient branches (the expensive way)
#84402
Open
webknjaz
wants to merge
2
commits into
ansible:devel
Choose a base branch
from
webknjaz:features/ansible-test-dumb-unshallow-old-prs
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
🧪 Let ansible-test
diff ancient branches (the expensive way)
#84402
webknjaz
wants to merge
2
commits into
ansible:devel
from
webknjaz:features/ansible-test-dumb-unshallow-old-prs
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This patch addresses the long-standing issue with being unable to run CI on PRs that have their branches created over 500 commits prior. When the first `git diff` attempt fails, this patch attempts to augment the Git tree with missing commits. This is achieved by doing the following: 1. Fetch one additional commit at the root of each orphaned branch. 2. Identify said commits as tree roots or "grafted". 3. Retrieve the timestamps of both and safe the oldest one. 4. Fetch again, now instructing Git to include everything past this date. The idea is that the very first commit in the PR branch might be created on the same day as the PR is opened. However, its parent would belong to the base branch, which is immutable. So if we take that commit's time stamp, we can tell Git to fill in the commits between the PR branch chunk and the commit it branched out of (the fork point). We'll also fill in the commits on the other side of the "fork", in the base branch. With those commits retrieved and available in the local cache of the remote, it will be possible for git diff to locate the merge base and compute the file list, while the tree remains shallow. This is still a heuristic, of course, since the commit dates can be out of order in the tree. But it's not expected that we'll hit this corner case often or ever.
webknjaz
changed the title
🧪 Let ansible-test diff ancient branches (the expensive way)
🧪 Let Nov 27, 2024
ansible-test
diff ancient branches (the expensive way)
webknjaz
added
test
This PR relates to tests.
needs_triage
Needs a first human triage before being processed.
ansible-test
Release work related to ansible-test
labels
Nov 27, 2024
ansibot
added
the
stale_ci
This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested.
label
Dec 5, 2024
mattclay
reviewed
Jan 4, 2025
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.
See my comment on the related PR.
This was referenced Jan 21, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ansible-test
Release work related to ansible-test
stale_ci
This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested.
test
This PR relates to tests.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch addresses the long-standing issue with being unable to run
CI on PRs that have their branches created over 500 commits prior.
When the first
git diff
attempt fails, this patch attempts toaugment the Git tree with missing commits.
This is achieved by unshallowing the entire Git tree.
SUMMARY
SSIA
ISSUE TYPE
ADDITIONAL INFORMATION
This is a more expensive alternative to #84375. It adds 33 seconds to each job compared to the granular implementation.
Demo log output: https://dev.azure.com/ansible/ansible/_build/results?buildId=129703&view=logs&j=f39c292d-0a23-56d4-e7e5-386951c14ece&t=3af4f6c8-91cf-5ddb-8873-9e1cb9dedca9&l=73 (from #84403)