mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-23 00:00:33 +00:00
fix: never mark failure/trigger/approval scripts as auto_kind=lib (#9168)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user