Skip to main content

Branch health guardrail surfaced as a PR check for all stacks

Today it is too easy for teams to keep building on top of a broken tracked branch without realizing it.
Concrete issues

  • A proposed run on a PR can pass, the PR gets merged, but the tracked run on the default branch fails only at apply time. So from the developer perspective the change looked safe.

  • The main signal that something is wrong lives in Spacelift UI and Slack notifications. Developers often ignore Slack because it is already noisy and outside their normal dev workflow.

  • Locking stacks is not a good fit here. It can block teams when the person who caused the issue is offline, and it adds more friction and social overhead instead of clarity.

As a result

  • Developers keep opening and merging PRs on top of an unhealthy tracked branch.

  • Platform teams spend time chasing people and explaining why their “green” PR actually introduced a problem.

  • This increases cognitive load.

I want to see a clear signal in my PR when the tracked branch for that stack is unhealthy
so that I know it is not safe to merge and I can coordinate fixing main first.
As a platform engineer I want branch health to be enforced as a PR check, not just a Slack notification
so that I do not have to rely on people watching Slack or learning Spacelift UI to avoid breaking workflows.
Desired behavior

  1. Branch health state per stack

  • Spacelift maintains a simple health state for each stack’s tracked branch, for example healthy or unhealthy.

  • This state reflects the status of the latest tracked runs on the tracked branch, including failed applies that passed plan.

  1. PR health check on every proposed run

  • For every proposed run triggered by a PR that touches a given stack, Spacelift evaluates the stack’s branch health.

  • If the tracked branch is unhealthy, Spacelift

  • fails a dedicated “Branch health” check in the VCS

  • optionally posts a comment on the PR explaining that main is unhealthy, with a link to the failing tracked run and its logs.

  1. Scope

  • The health check applies to all future PRs affecting that stack from the moment the tracked branch becomes unhealthy.

  • It is not limited to the original PR that introduced the problem. Anyone trying to build on top of a broken main gets the same warning.

This request was merged into another request

No comments yet

Be the first to share your thoughts.