Skip to content

bk: run faster builds#7029

Merged
v1v merged 1 commit into
elastic:mainfrom
v1v:feature/support-faster-builds-load
May 14, 2026
Merged

bk: run faster builds#7029
v1v merged 1 commit into
elastic:mainfrom
v1v:feature/support-faster-builds-load

Conversation

@v1v
Copy link
Copy Markdown
Member

@v1v v1v commented May 14, 2026

What is the problem this PR solves?

Checkout faster when running the loading bk pipeline defined in the catalog-info

How does this PR solve the problem?

Using the spare checkout for the .buildkite folder and the .go-version file

How to test this PR locally

CI

Design Checklist

  • I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.
  • I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.
  • I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Related issues

@v1v v1v requested a review from a team May 14, 2026 12:43
@v1v v1v added the backport-skip Skip notification from the automated backport with mergify label May 14, 2026
@v1v v1v requested a review from a team as a code owner May 14, 2026 12:43
@v1v v1v requested review from blakerouse and swiatekm May 14, 2026 12:43
@v1v v1v merged commit ded8d0a into elastic:main May 14, 2026
14 checks passed
@ebeahan
Copy link
Copy Markdown
Member

ebeahan commented May 14, 2026

@v1v
Copy link
Copy Markdown
Member Author

v1v commented May 14, 2026

We can revert this change, I tested on main manually and it worked fine:

In theory those changes are only for the initial pipeline. Don't need to be backported at all, the catalog info file is honoured only for the main branch.

Maybe I missed something else to test this out. So worthy to revert it in my opinion

@ebeahan
Copy link
Copy Markdown
Member

ebeahan commented May 14, 2026

@ycombinator has a fix here: #7037

ycombinator added a commit that referenced this pull request May 14, 2026
* fix(ci): unshallow repo before merge in post-checkout hook

The sparse-checkout Buildkite plugin (added in #7029) creates a shallow
clone with only a few hundred objects — enough for the pipeline files but
without the full commit-ancestry chain. When the post-checkout hook then
fetches the target branch and calls `git merge "${BUILDKITE_COMMIT}"`, git
cannot walk back to a common ancestor and fails with "refusing to merge
unrelated histories".

Unshallow the repository before the merge so that git can resolve the
merge base correctly. The `--depth=2147483647` fallback handles agents
where the clone was not recorded as shallow by git.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* drop unnecessary depth fallback in post-checkout unshallow

If --unshallow fails the clone is not shallow, meaning full history is
already present and the fallback fetch would be a no-op anyway.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
ycombinator added a commit that referenced this pull request May 15, 2026
…7039)

The fleet-server-tests and perf-tests pipelines are triggered by external
systems (quality gate, performance testing) that supply a short commit SHA
as BUILDKITE_COMMIT. The sparse-checkout plugin tries to fetch that SHA via
`git fetch origin <sha>`, but GitHub's git protocol only accepts full 40-char
SHAs, causing the fetch to fail with "couldn't find remote ref".

Neither pipeline uses fleet-server source code (fleet-server-tests runs
quality gate tests against cloud deployments; perf-tests triggers performance
benchmarks), so sparse checkout provides no benefit. Remove it from both.

Follow-up to #7029.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
ebeahan added a commit that referenced this pull request May 20, 2026
* Revert "bk: run faster builds (#7029)"

This reverts commit ded8d0a.

* Revert "fix(ci): unshallow repo before merge in post-checkout hook (#7037)"

This reverts commit 76e5002.

---------

Co-authored-by: ebeahan <eric.beahan@elastic.co>
Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-skip Skip notification from the automated backport with mergify skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants