Skip to content

v5.0.2

v5.0.2 is a pure bug fix for bear plan's output and its saved .bear/plan.yml. No environment/allowlist policy, deployment safety, source-fingerprint check, or apply behavior changed. Only what plan prints for review, what it counts as "changed", and what the skip list contains, are different. There is no new flag, one field removed (below), and no schema version bump — CurrentPlanFileVersion stays 1 because this does not change what bear apply reads or executes, only what a human reviews.

The Bug

v5.0.1 folded a changed library into skip, tagged lib, so every affected artifact appeared in exactly one section. That fixed the duplication bug, but a library is not an artifact that could have deployed and didn't — it is never a deployment candidate at all, so skip was still the wrong place for it: the lib tag only softened a category error, it didn't fix it.

Folding libraries into skip also caused two concrete, user-visible bugs, since a library — never deployed, so it never gets its own lock history — looks permanently "new" internally, forever, regardless of whether anything about it actually changed:

  • A repo with any library could never see "Nothing to plan." With nothing at all left to deploy, plan's summary would still print full changed/skipped counts and a skip section instead of the short "No changes detected. Nothing to plan." message, because the library alone kept the internal "anything affected?" check permanently true.
  • The closing sentence's own documented invariant was false. v5.0.1 stated "to deploy + skipped always equals changed". It didn't, whenever a genuinely unaffected artifact (no changes detected) shared a plan with a library: the unaffected artifact inflated skipped without ever having been part of changed.

Before (v5.0.1) — captured output

Fixture: api and web, both deployable in int, web depending on library shared. First plan, before anything is deployed:

Bear Plan
─────────

────────────────────────────────────────
Environment: int
Commit:      9b528f2

deploy (2):
  - api (services/api): new artifact
  - web (services/web): new artifact

skip (1):
  - lib shared (libs/shared): new artifact

Plan complete: 3 changed, 2 to deploy, 1 skipped

Run 'bear apply' to execute this plan.

After bear apply deploys both, running bear plan int again — nothing in the repo has changed since:

Bear Plan
─────────

────────────────────────────────────────
Environment: int
Commit:      9b528f2

skip (3):
  - api (services/api): no changes detected
  - lib shared (libs/shared): new artifact
  - web (services/web): no changes detected

Plan complete: 1 changed, 0 to deploy, 3 skipped

api and web correctly settle to "no changes detected", but shared never does, so the plan never reaches "Nothing to plan.", and the closing sentence's own claimed invariant fails here too: 0 (to deploy) + 3 (skipped) = 3, not the 1 the sentence calls "changed" — shared's permanent "new artifact" status is the only thing keeping this plan from being empty, and it is neither deployable nor, on inspection, actually informative.

The Fix

A library never appears in deploy or skip, changed or not, and is no longer counted in changed, to_deploy, or total_skipped — none of the three sections or counts read anything about a library any more. A library's own change is visible only indirectly, through the existing dependency '<name>' changed reason on whatever depends on it; that reason was already correct and unaffected by this fix, which changes only what is shown about the library itself.

After (this fix) — captured output, same fixture, same commits

Bear Plan
─────────

────────────────────────────────────────
Environment: int
Commit:      9b528f2

deploy (2):
  - api (services/api): new artifact
  - web (services/web): new artifact

Plan complete: 2 changed, 2 to deploy

Run 'bear apply' to execute this plan.

shared is not mentioned. skip is omitted entirely, since it would be empty without the library — an empty section was always omitted, this is just the first case where removing the library empties one. After the same bear apply, planning again with nothing changed:

Bear Plan
─────────

No changes detected. Nothing to plan.

────────────────────────────────────────
Environment: int

skip (2):
  - api (services/api): no changes detected
  - web (services/web): no changes detected

The short-circuit fires correctly now: shared's permanent internal "new artifact" status no longer counts toward "is anything affected", so a repo with libraries can reach an empty plan exactly like one without.

Changing only the library still correctly redeploys everything that depends on it — this was already correct in v5.0.1 and is unchanged by this fix, shown here for completeness:

deploy (1):
  - web (services/web): dependency 'shared' changed

Plan complete: 1 changed, 1 to deploy

Run 'bear apply' to execute this plan.

.bear/plan.yml: is_lib Removed

The is_lib field v5.0.1 added to PlanSkipped is removed: it always serialized as absent now that libraries are never in Skipped at all.

.bear/plan.yml (before, v5.0.1)
skipped:
    - name: backoffice
      path: services/backoffice
      reason: deployment not enabled for environment int
    - name: shared
      path: libs/shared
      reason: new artifact
      is_lib: true
changed: 3
to_deploy: 1
total_skipped: 2
.bear/plan.yml (after, this fix)
skipped:
    - name: backoffice
      path: services/backoffice
      reason: deployment not enabled for environment int
changed: 2
to_deploy: 1
total_skipped: 1

CurrentPlanFileVersion was not bumped: bear apply never read is_lib or changed to decide anything, so a plan file written by v5.0.1 is still readable — it will simply carry a stale is_lib: true that this version ignores, on a plan it would never have written itself.

What Did Not Change

  • Environment policy, allowlist evaluation, dependency-change propagation, and every existing skip/deploy reason string are unchanged. Whether an artifact deploys, and why, is identical before and after this fix — only whether a library gets a line of its own changed.
  • Source safety, fingerprints, locking, and Git publication are unchanged.
  • bear apply's execution model, checkpointing, and step sequencing are unchanged; apply does not read changed, skipped, or is_lib to decide anything.
  • The closing sentence format is unchanged: Plan complete: N changed[, M to deploy][, K skipped]. Only what feeds N and K changed: neither counts libraries any more, and M + K still does not always equal N — it equals N only when every non-library skip in K was itself part of N (an actual change blocked by policy or a pin), not when K also holds a genuinely unaffected artifact's "no changes detected". v5.0.1's claim that they always sum was already wrong before this fix in exactly that case; this fix does not introduce or fix that separately.

Upgrading

There is nothing to change in configuration, CI invocation, or artifact definitions. If you have a script or dashboard that greps plan's log for - lib or checks .bear/plan.yml's is_lib field, remove that check: a library is no longer named directly anywhere in either. If you rely on plan's "No changes detected. Nothing to plan." message as a CI short-circuit (for example, to skip a downstream job), and your project has any library, that message can now actually appear where before it never could. See bear plan and Plan/Apply Workflow for the current output in full.

Pin the release instead of automatically moving to latest:

git clone --branch v5.0.2 --depth 1 https://github.com/irevolve/bear.git bear-v5
go -C bear-v5 install -ldflags="-X github.com/irevolve/bear/commands.Version=5.0.2" .

Use Go 1.25+ and put the Go install directory on PATH. Platform binaries are listed on the v5.0.2 release. Container versions are ghcr.io/irevolve/bear:5.0.2, :5.0.2-alpine, and :5.0.2-debian. Anyone still on v5.0.0 or v5.0.1 should upgrade directly; there is no separate patch for either.