Repository navigation
v0.2.1
Two bugs that CI could not see, and the two tests that now see them.
The Helm chart could never be installed — charts 0.1.0 and 0.2.0 both
fail at the very first step of helm install. And restoring a document
snapshot corrupted the document for every connected client, appending the
restored text to the existing content instead of replacing it.
Fixed
-
Restoring a snapshot merged instead of replacing.
ReplaceWithMarkdown
clears the document fragment and applies the restored content in a single
transaction, but it broadcast and persisted the caller'supdate_bytes—
which encodes only the insertion. Peers therefore received the insert without
the delete and kept what they already had:expected: "First version of the doc." actual: "Completely different content.First version of the doc"Because the persisted update was also missing the deletion, this was a
data-integrity bug and not merely a display glitch: replaying the update log
reproduced the merged content. The room now captures what the transaction
actually produced viaobserve_update_v1— the same pattern
PatchTaskCheckedalready used — and persists and fans that out.The existing
replace_with_markdown_swaps_contenttest could not catch this:
it asserted on the room's own document, which was always correct. The new
replace_broadcast_replaces_peer_contentasserts on the frame a peer
receives, applied to a peer holding the pre-restore state.Affects every release with document history:
0.1.0and0.2.0. -
The chart could never be installed. The
pre-install/pre-upgrade
migrate Job injectedKNOT_DATABASE_URLbut notKNOT_SESSION_KEY. The binary
loads and validates its entire config before dispatching the subcommand, and
validation rejects an empty session key — so the hook exited 2 with
KNOT_SESSION_KEY is requiredand everyhelm installandhelm upgrade
failed before reaching the Deployment:Error: INSTALLATION FAILED: failed pre-install: resource Job/knot-migrate not ready. status: Failed, message: Job Failed. failed: 1/1 config: invalid: KNOT_SESSION_KEY is required (set it in every environment)migratenever reads the session key; it only has to survive validation. The
Job now receives it from the same Secret the Deployment uses, honouring
session.existingSecretName/existingSecretKey.The bug survived two releases because
ct installis disabled in chart CI, so
nothing had ever deployed the chart —helm lintcannot see a hook that fails
at runtime.
Added
-
Helm upgrade test (
.github/workflows/helm-upgrade.yaml). Installs the
previous published release — chart pulled from ghcr and the real image, not
the working tree — seeds a document through that release's own API, runs
helm upgradeto the working tree, and then asserts:/api/versionchanged — the binary actually swapped- the session cookie minted by the old version still authorises — the
session format and signing key survived - the seeded document still reads back — schema and migrations survived
Runs on chart, migration and
Dockerfilechanges, weekly againstmain, and
on demand. This is what caught the migrate Job bug. -
replace_broadcast_replaces_peer_content, a room-level test asserting on the
bytes a peer actually receives from a restore rather than on the room's own
document. Reverting the fix turns it red with the exact production symptom
(<paragraph>Replaced Content</paragraph><paragraph>Hello World</paragraph>),
while the pre-existing test stays green.
Changed
history.specno longer restores an arbitrary snapshot. It selected
snapButtons.last()— the oldest — which withKNOT_SNAPSHOT_EVERY_N=1is
the complete V1 only when every keystroke lands in one persisted batch: true
on a fast machine, false on a loaded runner, so the spec restored a prefix and
asserted on the full string. Its preview check only required"First version",
which any prefix satisfies, so the failure surfaced later and read as a restore
bug. It now pins the newest snapshot that contains all of V1 and asserts the
full string in both places.
Operators
- Upgrading from chart
0.2.0. If you worked around the broken hook with
--set migrations.enabled=false, drop that override —0.2.1runs migrations
itself again. Nothing else about your values file changes. - Installing fresh.
helm installnow works with defaults; no manual
/knot-server migratestep is needed. - The stray
0.3.4chart package has been deleted from ghcr, so
helm install oci://ghcr.io/opendefensecloud/charts/knotwithout--version
resolves to the newest real release instead of the mis-versionedv0.1.0
chart. The--versionadvice in the 0.2.0 notes below is no longer required. - The Prometheus
routelabel change noted under 0.2.0 still applies if you are
coming from0.1.0.
Container image
ghcr.io/opendefensecloud/knot:0.2.1 — multi-arch (amd64/arm64), cosign-signed, with SBOM + SLSA provenance.
Helm chart
helm install knot oci://ghcr.io/opendefensecloud/charts/knot \
--version 0.2.1 \
-n knot --create-namespace \
--set database.url='postgres://…' \
--set session.key="$(openssl rand -base64 32)" \
--set baseUrl=https://knot.example.comFull values: chart README.
What's Changed
- fix(helm): give the migrate Job the session key; add an upgrade test by @christianhuening in #6
Full Changelog: v0.2.0...v0.2.1