Project

General

Profile

Actions

Bug #19866

closed

Rudderlang must support dynamic built classes

Bug #19866: Rudderlang must support dynamic built classes

Added by Félix DALLIDET over 4 years ago. Updated over 3 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.

Updated by Benoît PECCATTE over 4 years ago Actions #1

There should be a language syntax for this like:

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

Updated by François ARMAND over 4 years ago Actions #2

  • Target version changed from 7.0.0~beta1 to 900

Updated by Vincent MEMBRÉ about 4 years ago Actions #3

  • Target version changed from 900 to 7.0.0~beta2

Updated by Vincent MEMBRÉ about 4 years ago Actions #4

  • Target version changed from 7.0.0~beta2 to 7.0.0~beta3

Updated by Vincent MEMBRÉ about 4 years ago Actions #5

  • Target version changed from 7.0.0~beta3 to 7.0.0~rc1

Updated by Vincent MEMBRÉ about 4 years ago Actions #6

  • Target version changed from 7.0.0~rc1 to 7.0.0~rc2

Updated by Vincent MEMBRÉ almost 4 years ago Actions #7

  • Target version changed from 7.0.0~rc2 to 7.0.0~rc3

Updated by Vincent MEMBRÉ almost 4 years ago Actions #8

  • Target version changed from 7.0.0~rc3 to 7.0.0

Updated by Vincent MEMBRÉ almost 4 years ago Actions #9

  • Target version changed from 7.0.0 to 7.0.1

Updated by Alexis Mousset almost 4 years ago Actions #10

  • Target version changed from 7.0.1 to 7.1.0~beta1

Updated by Vincent MEMBRÉ over 3 years ago Actions #11

  • Target version changed from 7.1.0~beta1 to 7.1.0~beta2

Updated by Vincent MEMBRÉ over 3 years ago Actions #12

  • Target version changed from 7.1.0~beta2 to 7.1.0~rc1

Updated by Alexis Mousset over 3 years ago Actions #13

  • Target version changed from 7.1.0~rc1 to 7.2.0~beta1

Updated by Alexis Mousset over 3 years ago Actions #14

  • Status changed from New to Rejected

Closing for now as the language is on hold.

Actions

Also available in: PDF Atom