Skip to content

perf(repo-brancher): skip already-synced branches via upfront ls-remote#5033

Draft
petr-muller wants to merge 1 commit intoopenshift:mainfrom
petr-muller:fast-forwarder-speedup-2
Draft

perf(repo-brancher): skip already-synced branches via upfront ls-remote#5033
petr-muller wants to merge 1 commit intoopenshift:mainfrom
petr-muller:fast-forwarder-speedup-2

Conversation

@petr-muller
Copy link
Copy Markdown
Member

@petr-muller petr-muller commented Mar 19, 2026

Summary

  • Run a single git ls-remote per repo upfront to get all remote ref SHAs
  • Compare current branch SHA against each future branch SHA: if they match, the branch is already synced and all git operations (init, fetch, push) are skipped entirely
  • Only enter the expensive clone + push path for branches that actually need work

Stacked on #5014 (merged).

Benchmark (20 repos, 2026-03-19)

Comparison against #5014 (--deepen + --unshallow):

Scenario Without ls-remote opt With ls-remote opt Improvement
Sync (with work) 450s 448s ~same
No-op (reconciled) 42s 7s 83% faster (6x)

The big win is in the no-op case: synced repos skip git init + git fetch + git push entirely, just doing one ls-remote per repo.

🤖 Generated with Claude Code

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 19, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 19, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3accd7bf-2a92-475a-86ed-2382b31d3e15

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 19, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: petr-muller
Once this PR has been reviewed and has the lgtm label, please assign prucek for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@petr-muller petr-muller force-pushed the fast-forwarder-speedup-2 branch from 8a86f04 to 62bd257 Compare March 20, 2026 15:50
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 31, 2026

@petr-muller: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

…ches

Instead of doing git init + fetch + push for every repo and a separate
ls-remote per future branch, run a single ls-remote per repo upfront
to get all remote ref SHAs. Compare the current branch SHA against
each future branch SHA: if they match, the branch is already synced
and all git operations (init, fetch, push) are skipped entirely.

Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>
@petr-muller petr-muller force-pushed the fast-forwarder-speedup-2 branch from 62bd257 to 41a0f9e Compare April 4, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants