Project

General

Profile

Actions

Bug #20182

closed

Incorrect generation for DSC techniques

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

Status:
Rejected
Priority:
N/A
Assignee:
-
Category:
Web - Technique editor
Target version:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
UX impact:
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:
Priority:
65
Name check:
To do
Fix check:
To do
Regression:

Description

In the latest debian10 nightly, I was not able to generate properly a dsc compatible technique using blocks.
With the technique attached, I ended up with:

# generated by rudderc
# @name push abcd.efg
# @version 1.0

function Push-Abcd-Efg {
  [CmdletBinding()]
  param (
    [Parameter(Mandatory=$True)]
    [String]$ReportId,
    [Parameter(Mandatory=$True)]
    [String]$TechniqueName,
    [Parameter(Mandatory=$True)]
    [String]$Abcd,
    [Switch]$AuditOnly
  )

  $LocalClasses = New-ClassContext
  $ResourcesDir = $PSScriptRoot + "\resources" 
  _rudder_common_report_na -ComponentName "File content" -ComponentKey "C:\\abcd.efg" -Message "Not applicable" -ReportId $ReportId -TechniqueName $TechniqueName -AuditOnly:$AuditOnly
  _rudder_common_report_na -ComponentName "File content" -ComponentKey "/tmp/abcd.efg" -Message "Not applicable" -ReportId $ReportId -TechniqueName $TechniqueName -AuditOnly:$AuditOnly
}

The very strange part is that when importing the technique.json exported from the technique editor, it seems to work as intended and I end up with:

# generated by rudderc
# @name the copy of the technique
# @version 1.0

function The-Copy-Of-The-Technique {
  [CmdletBinding()]
  param (
    [Parameter(Mandatory=$True)]
    [String]$ReportId,
    [Parameter(Mandatory=$True)]
    [String]$TechniqueName,
    [Parameter(Mandatory=$True)]
    [String]$Abcd,
    [Switch]$AuditOnly
  )

  $LocalClasses = New-ClassContext
  $ResourcesDir = $PSScriptRoot + "\resources" 
  $Class = "!linux" 
  if (Evaluate-Class $Class $LocalClasses $SystemClasses) {
    $LocalClasses = Merge-ClassContext $LocalClasses $(File-Content -Path "C:\\abcd.efg" -Lines "oui
    bonjour windows" -Enforce "true" -ComponentName "File content" -ReportId $ReportId -TechniqueName $TechniqueName -AuditOnly:$AuditOnly).get_item("classes")
  }
  else {
    _rudder_common_report_na -ComponentName "File content" -ComponentKey "C:\\abcd.efg" -Message "Not applicable" -ReportId $ReportId -TechniqueName $TechniqueName -AuditOnly:$AuditOnly
  }
  $Class = "linux" 
  if (Evaluate-Class $Class $LocalClasses $SystemClasses) {
    $LocalClasses = Merge-ClassContext $LocalClasses $(File-Content -Path "/tmp/abcd.efg" -Lines "oui
    bonjour linux" -Enforce "true" -ComponentName "File content" -ReportId $ReportId -TechniqueName $TechniqueName -AuditOnly:$AuditOnly).get_item("classes")
  }
  else {
    _rudder_common_report_na -ComponentName "File content" -ComponentKey "/tmp/abcd.efg" -Message "Not applicable" -ReportId $ReportId -TechniqueName $TechniqueName -AuditOnly:$AuditOnly
  }
}

This is a very disturbing behaviour, and happens silently.


Files

push_abcd_efg.json (2.04 KB) push_abcd_efg.json Félix DALLIDET, 2021-10-21 11:53
Actions #2

Updated by Félix DALLIDET over 2 years ago

  • User visibility changed from Getting started - demo | first install | Technique editor and level 1 Techniques to Infrequent - complex configurations | third party integrations
  • Priority changed from 94 to 65

I was not able to reproduce afterwards, looks like a potential unitilialized std lib for rl ?
Changing it to "infrequent"

Actions #3

Updated by Vincent MEMBRÉ over 2 years ago

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

Updated by Nicolas CHARLES over 2 years ago

  • Status changed from New to Rejected

cannot reproduce

Actions

Also available in: Atom PDF