Project

General

Profile

Actions

Bug #19866

closed

Rudderlang must support dynamic built classes

Added by Félix DALLIDET over 2 years ago. Updated almost 2 years ago.

Status:
Rejected
Priority:
N/A
Assignee:
-
Category:
rudderc
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:

Description

When editing a technique, it is a common usecase to use a variable call in a "condition" field.
It does not seem to be possible to recreate such beahviour in rudderlang at the moment.

For instance, here I want to define a prefix from a string variable, which will be used in my condition field later.
This is possible from the technique editor, by defining a "variable from string", and them calling it in the condition field of the block parameter.

let bench = "CIS_RHEL7" 
condition("${bench}_1_1_1_1").from_variable_existence("node.properties[${bench}][1.1.1.1]")
if "${bench}_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 when compiling this in rudderlang, I have the following error:

An error occurred, could not create content from 'technique.rd':
technique.rd:37:7 near 'if "${bench}_1_1_1_1_false" =>'
!--> The following keyword was expected: 'enum expression'.

An error occurred, could not create content: Command was "/opt/rudder/bin/rudderc" "technique" "read" "-i" "technique.rd" 

In fact, the conditions inputs in rudderlang seem to only expect static class types of variable. And we are unable to build them dynamically from string manipulation.

Actions #1

Updated by Benoît PECCATTE over 2 years ago

There should be a language syntax for this like:

let local_bool = variable_exist("node.properties[${bench}][1.1.1.1]")
if local_bool => { ... }
Actions #2

Updated by François ARMAND over 2 years ago

  • Target version changed from 7.0.0~beta1 to 900
Actions #3

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 900 to 7.0.0~beta2
Actions #4

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 7.0.0~beta2 to 7.0.0~beta3
Actions #5

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 7.0.0~beta3 to 7.0.0~rc1
Actions #6

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 7.0.0~rc1 to 7.0.0~rc2
Actions #7

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 7.0.0~rc2 to 7.0.0~rc3
Actions #8

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 7.0.0~rc3 to 7.0.0
Actions #9

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 7.0.0 to 7.0.1
Actions #10

Updated by Alexis Mousset about 2 years ago

  • Target version changed from 7.0.1 to 7.1.0~beta1
Actions #11

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 7.1.0~beta1 to 7.1.0~beta2
Actions #12

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 7.1.0~beta2 to 7.1.0~rc1
Actions #13

Updated by Alexis Mousset about 2 years ago

  • Target version changed from 7.1.0~rc1 to 7.2.0~beta1
Actions #14

Updated by Alexis Mousset almost 2 years ago

  • Status changed from New to Rejected

Closing for now as the language is on hold.

Actions

Also available in: Atom PDF