Skip to content

Conversation

ahal
Copy link
Collaborator

@ahal ahal commented Sep 11, 2025

No description provided.

@ahal ahal self-assigned this Sep 11, 2025
@ahal ahal force-pushed the run-task-git branch 3 times, most recently from e4b6b56 to bc5cc0f Compare September 17, 2025 15:58
@ahal ahal force-pushed the run-task-git branch 4 times, most recently from 7cba9a9 to d58fa3c Compare September 23, 2025 15:10
@ahal ahal force-pushed the run-task-git branch 2 times, most recently from edeb769 to 5387210 Compare October 3, 2025 15:27
@ahal ahal added the BREAKING CHANGE Backwards incompatible request that will require major version bump label Oct 3, 2025
@ahal ahal changed the title WIP: Improve git clone speeds in run-task WIP: Support shallow clones with Git Oct 3, 2025
@ahal ahal force-pushed the run-task-git branch 10 times, most recently from d609819 to 1848a5e Compare October 7, 2025 16:17
@ahal ahal changed the title WIP: Support shallow clones with Git Support shallow clones with Git Oct 7, 2025
@ahal ahal marked this pull request as ready for review October 7, 2025 16:22
@ahal ahal requested a review from a team as a code owner October 7, 2025 16:22
@ahal ahal requested a review from abhishekmadan30 October 7, 2025 16:22
@ahal ahal force-pushed the run-task-git branch 3 times, most recently from 50f6468 to 3a746a0 Compare October 7, 2025 17:54
@ahal ahal marked this pull request as draft October 7, 2025 18:51
@ahal
Copy link
Collaborator Author

ahal commented Oct 7, 2025

I found another issue, will sort it out tomorrow

@ahal ahal force-pushed the run-task-git branch 2 times, most recently from a5704e9 to c502c24 Compare October 8, 2025 16:02
@ahal ahal force-pushed the run-task-git branch 4 times, most recently from dde7615 to 3f72a12 Compare October 15, 2025 18:09
@ahal ahal requested review from a team and jcristau and removed request for abhishekmadan30 October 15, 2025 18:33
@ahal ahal marked this pull request as ready for review October 15, 2025 18:34
ahal added 8 commits October 16, 2025 10:38
…head_rev

This makes the naming consistent with what we use in .taskcluster.yml
and the rest of Taskgraph. Previously, I always had to look up where
"ref" and "commit" / "revision" were coming from to double check they
were the values I was expecting. This rename makes that much more
obvious.
If the condition in the if statement is true, then we've already fetched
ref from head_repo. There's no need to do so again.
BREAKING CHANGE: `base_ref` will no longer be fetched or checked out by
run-task

Taskgraph uses base_rev anyway for computing files changed, so there's
no need to additionally fetch base_ref. Some tasks may need to be
updated to not rely on base_ref being present in the local clone.
`git log BASE..HEAD` says, show me commits reachable from HEAD, but not
reachable from BASE. In a shallow clone where we only fetch BASE and
HEAD (which is what run-task does), this means the command will only
return `HEAD`. In otherwords, we're only returning files changed by the
tip commit of the push and ignoring everything else.

By switching to `git diff BASE HEAD`, we're instead comparing the
snapshots of both revisions. Sometimes this is what we want, e.g for
force pushes, it'll be the interdiff of files modified between the two
pushes (though some developers might expect it to contain the files
modified since the merge base).

Sometimes it's not what we want, e.g for PRs, it'll be the files changed
between the PR and the latest commit on `main`.

Either way, this behaviour is at least somewhat more accurate than git
log when we don't have full history. Likely we'll need to fetch the
proper changed files using the Github API in the future, but for now
this is better than nothing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BREAKING CHANGE Backwards incompatible request that will require major version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants