Actions
Bug #19867
closedBlock definition right after a variable definition break the compiler
Pull Request:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Priority:
14
Name check:
To do
Fix check:
To do
Regression:
Description
In a rudderlang technique, the following is correct:
CIS_rhel7_setup_filesystem state configured() { let bench = "CIS_RHEL7" if any => @index = "1.1.1.1" @component = "Ensure mounting of cramfs filesystems is disabled" { condition("${bench}_1_1_1_1").from_variable_existence("node.properties[${bench}][1.1.1.1]") if CIS_RHEL7_1_1_1_1_false => { command("lsmod | grep -q cramfs").execution_result("1", "") command("modprobe -n -v cramfs | grep -qE 'install (/bin/true|/bin/false)'").execution_result("1", "") } }
But the same without newline after the variable definition does throw a syntax error:
CIS_rhel7_setup_filesystem state configured() { let bench = "CIS_RHEL7" if any => @index = "1.1.1.1" @component = "Ensure mounting of cramfs filesystems is disabled" { condition("${bench}_1_1_1_1").from_variable_existence("node.properties[${bench}][1.1.1.1]") if CIS_RHEL7_1_1_1_1_false => { command("lsmod | grep -q cramfs").execution_result("1", "") command("modprobe -n -v cramfs | grep -qE 'install (/bin/true|/bin/false)'").execution_result("1", "") } }
And the error, which does fail on other part of the technique for no reasons:
An error occurred, could not create content from 'technique.rd': 'CIS_kernel_module': 'name' metadata is mandatory ; 'CIS_kernel_module': 'description' metadata is mandatory ; 'CIS_kernel_module': 'version' metadata is mandatory ; 'CIS_kernel_module': 'category' metadata is mandatory ; 'CIS_kernel_module': 'parameters' metadata is mandatory An error occurred, could not create content: Command was "/opt/rudder/bin/rudderc" "technique" "read" "-i" "technique.rd"
The behaviour does not seem to be fully reproductible. If I recompile right after the error, it works... Could be a cache issue?
Actions