mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-21 08:02:38 +00:00
fix(datatables): unbreak two operator messages and two comments that described other code
The two strings this branch added for states an operator hits once — the catalog write that matched nothing, and the delete that stranded a pointer — were collapsed from their multi-line form with the indentation left in, so both rendered with a fourteen-space gap mid-sentence. `list_datatables` claimed to report a chain it cannot follow and then dropped it; it does drop it, and the comment now says why that is the right place to stay quiet. The non-superadmin check in `edit_datatable_config` was introduced as also covering references, which it does not and need not: `reference` is overwritten from the stored entry for every caller before the check runs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ti5HyeTikPMYyW8YSdiHR
This commit is contained in:
co-authored by
Claude Opus 5
parent
8421579133
commit
f0ae50becf
@@ -2158,7 +2158,9 @@ async fn list_datatables(
|
||||
let mut items = Vec::with_capacity(names.len());
|
||||
for name in names {
|
||||
// A pointer entry owns no database, so what it resolves to is the only truthful answer
|
||||
// here; a chain that cannot be followed is reported with what the caller can still see.
|
||||
// here. One that resolves to nothing — a pointer whose workspace was deleted — is dropped
|
||||
// rather than listed with a database it does not have; what happened is named where it is
|
||||
// actionable instead: by the delete that stranded it, and by any attempt to use it.
|
||||
let Ok(governing) = resolve_governing_datatable(&db, &w_id, &name).await else {
|
||||
continue;
|
||||
};
|
||||
@@ -3630,9 +3632,10 @@ async fn edit_datatable_config(
|
||||
)
|
||||
.await?;
|
||||
|
||||
// Check that non-superadmins are not abusing Instance databases, nor pointing an entry at
|
||||
// another workspace's data table. Both reach a database this workspace does not own: an
|
||||
// instance database directly, a reference through whoever governs it.
|
||||
// Check that non-superadmins are not abusing Instance databases, which reach a database this
|
||||
// workspace does not own. Pointing an entry at another workspace's data table is not checked
|
||||
// here because it cannot be requested at all: `reference` is overwritten from the stored entry
|
||||
// above, for every caller.
|
||||
if !is_superadmin {
|
||||
for (name, dt) in new_config.settings.datatables.iter() {
|
||||
let old_dt = old_datatables.get(name);
|
||||
|
||||
@@ -1338,7 +1338,11 @@ pub(crate) async fn delete_workspace(
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ");
|
||||
Ok(format!(
|
||||
"Deleted workspace {}. These data tables were governed by it and no longer resolve: {}. Their databases still exist; a superadmin can point them at another workspace's data table.",
|
||||
concat!(
|
||||
"Deleted workspace {}. These data tables were governed by it and no longer ",
|
||||
"resolve: {}. Their databases still exist; a superadmin can point them at ",
|
||||
"another workspace's data table."
|
||||
),
|
||||
&w_id, stranded
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user