Project

General

Profile

Actions

Bug #8586

closed

Wrong definition of class condition if we use a variable with [ ] in it

Added by Nicolas CHARLES over 8 years ago. Updated over 2 years ago.

Status:
Rejected
Priority:
N/A
Assignee:
-
Category:
Web - Technique editor
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Priority:
0
Name check:
Fix check:
Regression:

Description

If we set a command execution with command

echo ${corp.admin_infra[username]} > /tmp/admin_infra 

theresult classes displayed are:

command_execution_echo_${corp.admin_infra[username_}____tmp_admin_infra_kept
command_execution_echo_${corp.admin_infra[username_}____tmp_admin_infra_repaired
command_execution_echo_${corp.admin_infra[username_}____tmp_admin_infra_error


Files


Related issues 3 (0 open3 closed)

Related to Rudder - Bug #10304: Broken variable expression when using node properties in the technique editorReleasedBenoît PECCATTEActions
Related to Rudder - Bug #12087: command_execution_result does not report anythingReleasedBenoît PECCATTEActions
Has duplicate Rudder - Bug #11600: Result class containing {} are not properly canonizedReleasedBenoît PECCATTEActions
Actions #2

Updated by Benoît PECCATTE over 8 years ago

  • Assignee changed from Benoît PECCATTE to Vincent MEMBRÉ

The code to do it is in builder/js/ncf.js in function getClassKind

param = param.replace(/\\'/g, "'").replace(/\\"/g, '"').replace(/[^\${}\w](?![^{}]+})|\$(?!{)/g,"_");

The regex is a negative one that trie to replace any invalid character that is not part of a variable.

I suggest to replace this with a positive regex that replaces everything valid (which can be longer that a char) by itself and everything else by a '_'.
The replace becomes (perl syntax) :

(  variable | valid_char or nothing ) then invalid_char -> 'valid_part' then '_'
s/(\$\{[\w\[\]\${}]+\}|\w*)[^\w]/$1_/g
Actions #3

Updated by Alexis Mousset over 8 years ago

  • Category set to Technique editor - API
Actions #4

Updated by Benoît PECCATTE over 7 years ago

  • Severity set to Major - prevents use of part of Rudder | no simple workaround
  • User visibility set to Operational - other Techniques | Technique editor | Rudder settings
  • Priority set to 31
Actions #5

Updated by Jonathan CLARKE over 7 years ago

  • Assignee deleted (Vincent MEMBRÉ)
Actions #6

Updated by Nicolas CHARLES over 7 years ago

  • Related to Bug #10304: Broken variable expression when using node properties in the technique editor added
Actions #7

Updated by Vincent MEMBRÉ about 7 years ago

  • Target version changed from 0.x to 3.1.25
  • Priority changed from 31 to 43
Actions #8

Updated by Vincent MEMBRÉ about 7 years ago

  • Target version changed from 3.1.25 to 387
Actions #9

Updated by Vincent MEMBRÉ about 7 years ago

  • Target version changed from 387 to 4.1.10
Actions #10

Updated by Nicolas CHARLES almost 7 years ago

  • Related to Bug #12087: command_execution_result does not report anything added
Actions #11

Updated by Benoît PECCATTE almost 7 years ago

  • Status changed from New to Rejected

Fixed by  #11600

Actions #12

Updated by Benoît PECCATTE almost 7 years ago

  • Has duplicate Bug #11600: Result class containing {} are not properly canonized added
Actions #13

Updated by Alexis Mousset over 2 years ago

  • Project changed from 41 to Rudder
  • Category changed from Technique editor - API to Web - Technique editor
  • Priority changed from 43 to 0
Actions

Also available in: Atom PDF