Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #20437: Error when writing techniques via the technique editor #4059

Conversation

fanf
Copy link
Member

@fanf fanf commented Dec 16, 2021

https://issues.rudder.io/issues/20437

There was (at least) three problem in previous code:

  • we duplicated the use of outputpath, and it was hard to see because we duplicated much code in path creation => factor out common path in an object specific to a compiler instance, and use it to remove some boilerplate
  • we we using bad extension for compilation => corrected
  • we were always using the cfengine extension, whatever current target was => corrected

@fanf fanf added Trigger test WIP Use that label for a Work In Progress PR that must not be merged yet qa: Can't merge labels Dec 16, 2021
@fanf
Copy link
Member Author

fanf commented Dec 16, 2021

PR updated with a new commit

@@ -158,8 +183,12 @@ class RudderCRunner (

def writeOne[T <: RuddercTarget](target: T, ruddercTargets: Set[RuddercTarget], technique: EditorTechnique, methods: Map[BundleName, GenericMethod], fallback: AgentSpecificTechniqueWriter, outputPath: String, configFilePath: String) = {
if(ruddercTargets.contains(target)) {
TechniqueWriterLoggerPure.debug(s"Using rudderc for target '${target.name}' for technique '${technique.path}'") *>
compileForTarget[RuddercTarget.CFEngine.type](s"""${outputPath}/${technique.path}/technique.json""", configFilePath)
TechniqueWriterLoggerPure.debug(s"Using rudderc for target '${target.name}' for technique '${technique.path}'") *> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need test integration from end to end to catch these things

@fanf fanf removed the WIP Use that label for a Work In Progress PR that must not be merged yet label Dec 16, 2021
@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder/pull/4059
-- Your faithful QA
Kant merge: "In law a man is guilty when he violates the rights of others. In ethics he is guilty if he only thinks of doing so."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/48388/console)

@fanf
Copy link
Member Author

fanf commented Dec 21, 2021

OK, squash merging this PR

fanf and others added 4 commits December 21, 2021 18:32
…/rudder/ncf/TechniqueWriter.scala

Co-authored-by: Alexis Mousset <contact@amousset.me>
…/rudder/ncf/TechniqueWriter.scala

Co-authored-by: Alexis Mousset <contact@amousset.me>
…/rudder/ncf/TechniqueWriter.scala

Co-authored-by: Alexis Mousset <contact@amousset.me>
@fanf fanf force-pushed the bug_20437/error_when_writing_techniques_via_the_technique_editor branch from 749e58a to 4c3eaec Compare December 21, 2021 17:32
@fanf fanf merged commit 4c3eaec into Normation:branches/rudder/7.0 Dec 21, 2021
@fanf fanf deleted the bug_20437/error_when_writing_techniques_via_the_technique_editor branch March 15, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants