fix: never mark failure/trigger/approval scripts as auto_kind=lib (#9168)

This commit is contained in:
Ruben Fiszel
2026-05-14 13:29:56 +00:00
committed by GitHub
parent 7f589a8c7d
commit f414ffc484
4 changed files with 150 additions and 0 deletions
@@ -1214,6 +1214,22 @@ async fn create_script_internal<'c>(
}
};
// Failure, Trigger, and Approval scripts are runnable entrypoints by
// definition. They must never be marked `auto_kind = 'lib'`, or they
// disappear from the flow error-handler / trigger / approval pickers
// (which filter out lib scripts). Strip a stray `lib` here so a parser
// misclassification — e.g. failing to detect `main` after a deno_ast
// bump — cannot orphan these scripts in the UI.
let auto_kind = if matches!(
ns.kind,
Some(ScriptKind::Failure) | Some(ScriptKind::Trigger) | Some(ScriptKind::Approval)
) && auto_kind.as_deref() == Some("lib")
{
None
} else {
auto_kind
};
let ci_test_refs =
windmill_common::schema::parse_ci_test_annotation(&ns.content, &lang.as_comment_lit());
let auto_kind = if ci_test_refs.is_some() {