Skip to content

Introduce early exit on success for repository unshallowing#11434

Open
daniel-mohedano wants to merge 1 commit into
masterfrom
daniel.mohedano/unshallow-early-exit
Open

Introduce early exit on success for repository unshallowing#11434
daniel-mohedano wants to merge 1 commit into
masterfrom
daniel.mohedano/unshallow-early-exit

Conversation

@daniel-mohedano
Copy link
Copy Markdown
Contributor

@daniel-mohedano daniel-mohedano commented May 21, 2026

What Does This Do

  • Early exit when a repository unshallowing attempt succeeds

Motivation

The repository unshallowing process makes attempts against HEAD, the upstream branch sha, and the remote name. Previously, even if the first attempt against HEAD succeeded, another attempt was performed against the upstream branch sha.

Additional Notes

test-environment-trigger: skip

Contributor Checklist

Jira ticket: [PROJ-IDENT]

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels 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.

@daniel-mohedano daniel-mohedano added type: enhancement Enhancements and improvements comp: ci visibility Continuous Integration Visibility labels May 21, 2026
@daniel-mohedano daniel-mohedano marked this pull request as ready for review May 22, 2026 08:07
@daniel-mohedano daniel-mohedano requested a review from a team as a code owner May 22, 2026 08:07
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: ci visibility Continuous Integration Visibility type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant