• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

elastic / cloudbeat / 28935274541
76%

Build:
DEFAULT BRANCH: main
Ran 08 Jul 2026 10:39AM UTC
Jobs 1
Files 245
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Jul 2026 09:56AM UTC coverage: 76.128% (+0.02%) from 76.106%
28935274541

push

github

web-flow
fix: detect stale bump branches and fail clearly before pushing (#7227)

## Summary

Today's `9.5.0` minor FF ([build
#35](https://buildkite.com/elastic/cloudbeat-version-bump/builds/35))
failed with:
```
remote: error: GH006: Protected branch update failed for refs/heads/bump-to-9.5.0.
remote: - Changes must be made through a pull request.
remote: - 4 of 4 required status checks are expected.
```

Root cause: `bump-to-9.5.0` already existed on origin from an old,
closed-but-never-merged PR (#5607, from April). `pr_exists()` only
guards against *open* PRs on that branch name — since #5607 is closed,
the script proceeds to push anyway, and GitHub treats a once-used branch
as protected, blocking the push.

We unblocked today's run by manually deleting `bump-to-9.5.0`, and
proactively deleted `bump-to-9.6.0` too (same stale state, from
#5608/#5609) since our new `bump_main_to_next_minor` step would have hit
it later in the same run.

This PR adds a permanent safeguard — **detect and fail clearly, don't
auto-delete**:
- New `fail_if_stale_remote_branch()` helper in `common.sh` — if the
target `bump-to-*` branch still exists on origin, checks whether it
belongs to a **merged** PR (harmless — that just means this exact bump
already shipped, and `no_new_commits()` further down correctly turns it
into a clean no-op) vs. a **closed-but-unmerged** PR or no PR at all
(the actual stale-protected-branch problem). Only the latter exits with
an actionable error pointing at the exact `gh api` delete command — no
automatic mutation of the repo.
- Called right after the existing `pr_exists` check (and before
checkout) in `bump-patch.sh`, `bump-minor.sh`, and
`post-minor-merge.sh`'s `bump_main_to_next_minor` — the three places
that create a disposable `bump-to-*` branch

## Test plan

- [x] Dry-run against a real **merged** stale-looking branch
(`bump-to-9.4.4`, PR #7112 merged) — correctly treated as harmless,
proceeds to the existing idempotency check, exits 0 with "n... (continued)

10208 of 13409 relevant lines covered (76.13%)

15.9 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28935274541.1 08 Jul 2026 10:39AM UTC 245
76.13
GitHub Action Run
Source Files on build 28935274541
  • Tree
  • List 245
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • be397605 on github
  • Prev Build on 9.5 (#28918756816)
  • Next Build on main (#28949816698)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc