Skip to content

deps: update the Bluelink libraries and report unencrypted state on its own - #68

Merged
fr3shw3b merged 2 commits into
mainfrom
deps/bluelink-libs-latest
Nov 30, 2026
Merged

fr3shw3b merged 2 commits into
mainfrom
deps/bluelink-libs-latest

Conversation

@fr3shw3b

@fr3shw3b fr3shw3b commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Bumps deploy-cli-sdk to the latest Bluelink library releases: blueprint v0.57.0, blueprint-state v0.13.1 and deploy-engine-client v0.6.0. It also gives state that isn't encrypted its own error message.

What this does

The bump changes how one error reaches the SDK, which is why the fix is in the same PR. Encrypted memfile state can contain files that are not encrypted, because they were written while state.encryption was turned off. When the SDK reads one of those files:

  • blueprint-state 0.12: builds a new error with its own message, so the SDK shows that message as the cause.
  • blueprint-state 0.13.1: wraps crypto.ErrNotEnvelope. ExplainError steps through the wrapping and shows the innermost message as the cause, which is the bare "payload is not an envelope".

The bump on its own makes that message worse. The fix catches this case and gives it its own summary and hint.

Reading order

  1. fix(stateio): stateio/backend.go, wrapMemfileLoadError. It adds a check for crypto.ErrNotEnvelope before the general decryption error. On the old pins nothing reaches the check, so this commit changes no behaviour on its own.
  2. deps: go.mod and go.sum.
    • backend.go drops the "written before encryption" sentence from the wrong-key hint.
    • stateio/encryption_test.go updates the expected messages.

Behaviour changes

  • State that isn't encrypted:
    • Summary: "some of the state is not encrypted"
    • Hint: run bluelink-deploy-engine reencrypt-state with the deploy engine stopped. A running engine writes its in-memory copy back over the re-encryption pass.
    • Error code: still ErrCodeStateDecryptionFailed. Nothing branches on the code beyond the JSON output's type.
  • Wrong or missing key: the hint now covers only the key and previous_keys.

Public API, state or cross-repo changes

  • Public API: none in this SDK.
  • Upstream releases: the pinned releases are already out.
  • Next steps: after this releases, bump the Bluelink CLI and the Celerity CLI.

Tests

  • Test_suggests_reencrypting_state_written_before_encryption_was_enabled now expects the new summary and hint. With the new check disabled it fails, so the test proves the check matters.
  • stateDecryptionHint is updated to match the shorter wrong-key hint.
  • Checks: scripts/lint.sh and scripts/run-tests.sh --integration pass, and so does the module-mode build. Commit 1 was also checked on its own against the old pins.

Not handled

  • blueprint-state's own error text still ends with "re-encrypt the state directory or start from an empty one". That text appears in the error's output after the SDK's own hint. Starting from an empty directory would leave the deployed resources untracked, so that wording should come out of blueprint-state too. This needs a small fix in blueprint-state.
  • Objectstore and postgres: they reject encryption, so ErrNotEnvelope can only come from memfile state.

Risk tier and review

  • Tier: state persistence (error reporting only).
  • Commit 1: self-check, then a fresh and an adversarial review. They found no wrong classification. The review changed the hint:
    • removed "start from an empty state directory"
    • added "with the deploy engine stopped"
    • softened it to "some state files … usually because …", since a zero-byte file from an interrupted write also matches the check
  • Commit 2: self-check and the falsification above.

Not verified

  • The CLIs haven't been run against this build. Only the SDK's suites cover it.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved error guidance when loading encrypted state files, distinguishing files that are not encrypted from failures caused by an incorrect encryption key.
    • For files that are not encrypted, guidance now recommends running bluelink-deploy-engine reencrypt-state while the deploy engine is stopped. For key mismatches, it explains how to configure rotated keys.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The state loader now reports unencrypted-state errors separately from other decryption errors. The hints and tests reflect this distinction. Three Go dependency versions are updated.

Changes: State Decryption Error Guidance

Layer / File(s) Summary
Classify decryption errors and update guidance
go.mod, stateio/backend.go, stateio/encryption_test.go
The loader handles crypto.ErrNotEnvelope with an unencrypted-state message and reencrypt-state guidance. Other decryption errors retain key and rotated-key guidance. Tests check the updated hints. Three dependency versions are updated.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested labels: dependencies

Merge Risk: Minimal · up to 1934f · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two main changes: the Bluelink library dependency update and separate reporting for unencrypted state. The changeset matches both. The title is a single sentence of 12 words. It is…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template closely. It has a clear summary of the dependency bump and the new unencrypted-state error handling, with a reading order, behaviour changes, and tests.…
Full details: Title check

Explanation

The title names the two main changes: the Bluelink library dependency update and separate reporting for unencrypted state. The changeset matches both. The title is a single sentence of 12 words. It is slightly long and uses two clauses joined by 'and', but it is specific and accurate.

Full details: Description check

Explanation

The description follows the repository template closely. It has a clear summary of the dependency bump and the new unencrypted-state error handling, with a reading order, behaviour changes, and tests. It also names the checks that ran (lint.sh, run-tests.sh --integration, module-mode build). The template's Related issues section is not filled in, and the Type of change and Checklist sections are not explicitly ticked. The Testing section is present but written as prose rather than the reproduction steps the template asks for. These gaps are non-critical, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e8ebb3dd-8d34-4478-b0ac-5e3f03dcbe13
Commits

Reviewing files that changed from the base of the PR and between 62c9717 and 1934fbb.

Files ignored due to path filters: 1

  • go.sum is excluded by !**/*.sum
Files selected for processing: 3

  • go.mod
  • stateio/backend.go
  • stateio/encryption_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

@fr3shw3b
fr3shw3b merged commit 9d37d8e into main Nov 30, 2026
5 checks passed
@fr3shw3b
fr3shw3b deleted the deps/bluelink-libs-latest branch November 30, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant