Opened from failing KB functional tests in test/functional/kb/definitions/. When a setup do step fails (404 on serverless, or empty result with no Fleet agents), set: {id} captures null/empty and the next command runs with an empty value. This surfaces as an opaque CLI input_error, or as an ES VALUE_NULL parse error when the empty value reaches a bulk kuery (parsing_exception: unknown token [VALUE_NULL] after [query]), instead of naming the real failure.
In codegen/functional/, after each set capture later used as a required path/body value, emit a guard:
[ -n "$VAR" ] || { echo "FAIL: setup produced empty $VAR"; exit 1; }
This turns silent bad input into an actionable message. It does not by itself make these tests pass (root cause is the failed setup step), but it stops masking it. Add a codegen unit test asserting the guard is emitted for captured-and-reused variables.
Failing test definitions (empty captured value → VALUE_NULL, stack + serverless):
elastic_agent_actions_post_fleet_agents_bulk_remove_collectors.yml
elastic_agent_actions_post_fleet_agents_bulk_request_diagnostics.yml
elastic_agent_actions_post_fleet_agents_bulk_rollback.yml
elastic_agent_actions_post_fleet_agents_bulk_unenroll.yml
elastic_agent_actions_post_fleet_agents_bulk_upgrade.yml
elastic_agents_post_fleet_agents_bulk_privilege_level_change.yml
Opened from failing KB functional tests in
test/functional/kb/definitions/. When a setupdostep fails (404 on serverless, or empty result with no Fleet agents),set: {id}capturesnull/empty and the next command runs with an empty value. This surfaces as an opaque CLIinput_error, or as an ESVALUE_NULLparse error when the empty value reaches a bulk kuery (parsing_exception: unknown token [VALUE_NULL] after [query]), instead of naming the real failure.In
codegen/functional/, after eachsetcapture later used as a required path/body value, emit a guard:This turns silent bad input into an actionable message. It does not by itself make these tests pass (root cause is the failed setup step), but it stops masking it. Add a codegen unit test asserting the guard is emitted for captured-and-reused variables.
Failing test definitions (empty captured value →
VALUE_NULL, stack + serverless):elastic_agent_actions_post_fleet_agents_bulk_remove_collectors.ymlelastic_agent_actions_post_fleet_agents_bulk_request_diagnostics.ymlelastic_agent_actions_post_fleet_agents_bulk_rollback.ymlelastic_agent_actions_post_fleet_agents_bulk_unenroll.ymlelastic_agent_actions_post_fleet_agents_bulk_upgrade.ymlelastic_agents_post_fleet_agents_bulk_privilege_level_change.yml