Introduce early exit on success for repository unshallowing#11434
Introduce early exit on success for repository unshallowing#11434daniel-mohedano wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fcfc7d1cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| LOGGER.debug( | ||
| "Repository unshallowing via HEAD took {} ms", | ||
| System.currentTimeMillis() - unshallowStart); | ||
| return true; |
There was a problem hiding this comment.
Avoid skipping the ref-populating fetch in detached checkouts
In detached shallow CI checkouts with no upstream branch, git fetch origin <HEAD sha> can succeed while leaving refs/remotes/<remote>/* empty; before this change the subsequent @{upstream} failure fell through to gitClient.unshallow(null), which runs a no-ref fetch and populates those remote-tracking refs. Returning here skips that path, so later PR diff/base detection in ShellGitClient.getBaseCommitSha/getBaseBranchCandidates can fail to find the base branch even though the repository was previously recoverable.
Useful? React with 👍 / 👎.
What Does This Do
Motivation
The repository unshallowing process makes attempts against
HEAD, the upstream branch sha, and the remote name. Previously, even if the first attempt againstHEADsucceeded, another attempt was performed against the upstream branch sha.Additional Notes
test-environment-trigger: skip
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.