Skip to content

Commit 43b9c94

Browse files
committed
docs: record rstack dev recovery, error envelope and run keys in the changelogs
The platform changelog names what rstack dev gained before its first release: stop --recover, the registry.rstack.error.v1 envelope with its three classes and exit codes, and a per-run key for projects with encrypted fields. The BReg entry for the long-envelope fix is rewrapped and names the history journal capture of reviewed migrations, which reads through the same decoder. The field-encryption flip test now seals values whose envelopes PostgreSQL wraps, so that path is covered. The PostGIS provisioning test also checks that the bbox role batch keeps the SQLSTATE of a refused statement. Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
1 parent db33379 commit 43b9c94

4 files changed

Lines changed: 39 additions & 8 deletions

File tree

‎crates/registry-breg/tests/postgres_migration.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4481,8 +4481,11 @@ async fn real_postgres_field_encryption_flip_seals_resumes_and_drops_the_plainte
44814481
let active = apply(&database, &initial, ApplyPrecondition::InitialActivation)
44824482
.await
44834483
.expect("flip scenario initial package activates");
4484+
// Each value seals to an envelope longer than 57 bytes, whose base64
4485+
// PostgreSQL breaks across lines, so the journal capture of every sealed
4486+
// chunk decodes a wrapped projection.
44844487
let secrets = (0..5)
4485-
.map(|index| format!("flip-secret-{index}"))
4488+
.map(|index| format!("flip-secret-{index}-{}", "long-envelope-".repeat(6)))
44864489
.collect::<Vec<_>>();
44874490
seed_flip_rows(&database, &prior, &secrets, true).await;
44884491

‎crates/registry-breg/tests/postgres_spatial_migration.rs‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ use registry_breg::package::{
2929
};
3030
use registry_breg::postgres::{
3131
begin_record_transaction, install_compiled_schema, managed_schema_fingerprint,
32-
provision_postgis_prerequisites, verify_catalog_identity_for_catalog, verify_postgis,
33-
ClaimContext, ExpectedManagedCatalog, ExpectedRegistryIdentity, PostgresFailure,
34-
PostgresKernelError, RegistryLockKey, SqlIdentifier,
32+
provision_postgis_prerequisites, provision_spatial_bbox_role,
33+
verify_catalog_identity_for_catalog, verify_postgis, ClaimContext, ExpectedManagedCatalog,
34+
ExpectedRegistryIdentity, PostgresFailure, PostgresKernelError, RegistryLockKey, SqlIdentifier,
3535
};
3636
use registry_breg::startup::{prepare_startup, StartupError};
3737
use registry_breg::CompiledRegistry;
@@ -2693,15 +2693,28 @@ async fn postgis_provisioning_keeps_the_sqlstate_of_a_refused_statement() {
26932693
)
26942694
.await
26952695
.expect_err("a role without schema creation rights cannot provision PostGIS");
2696+
assert_insufficient_privilege(&error);
2697+
// Nor may it create roles, so the bbox role batch is refused too.
2698+
let error = provision_spatial_bbox_role(
2699+
&unprivileged,
2700+
&database.migration_role,
2701+
&database.runtime_role,
2702+
)
2703+
.await
2704+
.expect_err("a role without role creation rights cannot provision the bbox role");
26962705
task.abort();
2697-
match &error {
2706+
assert_insufficient_privilege(&error);
2707+
database.cleanup().await;
2708+
}
2709+
2710+
fn assert_insufficient_privilege(error: &PostgresKernelError) {
2711+
match error {
26982712
PostgresKernelError::Statement(failure) => {
26992713
assert_eq!(failure.sqlstate.as_deref(), Some("42501"));
27002714
}
27012715
other => panic!("expected a statement failure, got {other:?}"),
27022716
}
27032717
assert!(error.to_string().contains("42501"), "{error}");
2704-
database.cleanup().await;
27052718
}
27062719

27072720
async fn cleanup_postgis_prerequisites(database: &TestDatabase, bbox_role: &SqlIdentifier) {

‎products/breg/CHANGELOG.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@
2525
field encryption failed a record, list, snapshot or revision read with
2626
`503 source.unavailable` once a stored value was long enough for its
2727
encrypted envelope to exceed 57 bytes, and the value could not be read
28-
until this fix. Writes and shorter values were unaffected. The fault was in the read path since v0.33.0, through v0.46.0; no
29-
stored data changes and nothing needs migrating.
28+
until this fix. A reviewed migration whose history journal capture read
29+
such a value, such as a field-encryption flip that sealed one, failed its
30+
apply, because the capture uses the same decoder. Writes and shorter values
31+
were unaffected. The fault was in the read path since v0.33.0, through
32+
v0.46.0; no stored data changes and nothing needs migrating.
3033

3134
## 0.46.0 - 2026-11-08
3235

‎products/platform/CHANGELOG.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
projects together against a PostgreSQL server you supply. See
77
[PROJECT-DEV.md](PROJECT-DEV.md). It is an alpha developer tool and may
88
change.
9+
- `rstack dev stop RUN_ID --recover` releases a run whose supervisor is gone.
10+
It stops each recorded process group whose leader still has the start time
11+
recorded for it, drops the run's databases and roles, and removes the run
12+
directory. Running it again after a partial failure is safe.
13+
- With `--json`, every `rstack dev` refusal or failure prints one
14+
`registry.rstack.error.v1` object, published as
15+
`schemas/rstack-dev-error.v1.schema.json`. Its `error.class` is `domain`
16+
(exit 1), `usage` (exit 2) or `operational` (exit 3); a run that still holds
17+
resources adds its `run_id` and a `recovery` object.
18+
- A BReg project with encrypted fields runs under `rstack dev` without extra
19+
setup. Each run draws its own development data key into its run directory,
20+
readable only by your user, and the key is removed with the run.
921

1022
## 0.46.0 - 2026-11-08
1123

0 commit comments

Comments
 (0)