Skip to content

feat: support version pinning for registry bundles (#1)#22

Open
mgoldsborough wants to merge 1 commit intomainfrom
fix/issue-1-bundle-version-pinning
Open

feat: support version pinning for registry bundles (#1)#22
mgoldsborough wants to merge 1 commit intomainfrom
fix/issue-1-bundle-version-pinning

Conversation

@mgoldsborough
Copy link
Copy Markdown
Contributor

Summary

  • The runtime called `mpak.prepareServer({ name })` without a version, so every startup and reconfigure resolved the latest published bundle. That broke reproducibility (redeploy silently picked up new versions) and rollback (a broken release hit every tenant on next restart).
  • Added an optional `version` field to the registry-bundle variant of `BundleRef` and wired it through the three `prepareServer` call sites:
    • `src/bundles/startup.ts` — `buildRegistrySource` passes `ref.version`
    • `src/bundles/lifecycle.ts` — `installNamed` accepts a version arg and persists it in the `nimblebrain.json` entry so pins survive restart
    • `src/tools/system-tools.ts` — `manage_app` gains an optional `version` input; workspace install threads it into the `BundleRef` and writes it into `workspace.json`
  • Exposed in `src/config/nimblebrain-config.schema.json`, the CLI `Config` type, and the README bundle config table + example.
  • The mpak SDK already supports `PrepareServerSpec.version` — no SDK changes.

Out of scope / follow-ups

  • The canonical schema at `schemas.nimblebrain.ai` must be updated separately to match the cached copy.
  • `configureBundle` (restart after credential change) still resolves via `{ name }` only — restoring the pin on that path requires plumbing `nimblebrain.json` config into the tool handler.
  • The Helm chart ConfigMap template (referenced in the issue) lives in a separate deployment repo; that change is tracked outside this PR.

Test plan

  • New workspace-store test round-trips a `{ name, version }` bundle entry through disk and verifies unpinned entries remain unpinned
  • `bun test test/unit/` — 1726 pass, 0 fail
  • `bun run check` / `bun run lint` — clean

Closes #1

The runtime called mpak.prepareServer({ name }) without a version, so
every startup and reconfigure resolved the latest published bundle.
That broke two things deployments care about:

  - reproducibility: redeploying silently picked up new bundle versions
  - rollback: a broken release shipped to every tenant on next restart

Add an optional `version` field to the registry-bundle variant of
BundleRef and thread it through the three prepareServer call sites:

  - src/bundles/startup.ts — buildRegistrySource now passes ref.version
  - src/bundles/lifecycle.ts — installNamed accepts a version arg, uses
    it to prepareServer, and persists it in the nimblebrain.json entry
    so pins survive restart
  - src/tools/system-tools.ts — the manage_app tool gains an optional
    `version` input; installBundleInWorkspaceViaCtx threads it into the
    BundleRef and writes it into workspace.json

Also expose `version` in:
  - src/config/nimblebrain-config.schema.json (cached copy)
  - src/cli/commands.ts Config type
  - README bundle config table and example

The mpak SDK already supports PrepareServerSpec.version — no SDK changes.
The canonical schema at schemas.nimblebrain.ai must be updated
separately to match the cached copy.

configureBundle (restart after credential change) still resolves via
{ name } only — restoring the pin on that path requires plumbing
nimblebrain.json config into the tool handler, out of scope here.
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.

Support version pinning for bundles in nimblebrain.json

1 participant