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 #24280: When we clone a technique with resource, the clone does not really have the resource #5453
Conversation
authzToken: AuthzToken | ||
): LiftResponse = { | ||
(for { | ||
techniqueId <- restExtractorService.extractString("techniqueId")(req)(Full(_)).toIO.notOptional("category parameter is missing") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
techniqueId <- restExtractorService.extractString("techniqueId")(req)(Full(_)).toIO.notOptional("category parameter is missing") | |
techniqueId <- restExtractorService.extractString("techniqueId")(req)(Full(_)).toIO.notOptional("technique id parameter is missing") |
|
||
IOResult.attempt(s"An error occurred while copying resources of technique ${techniqueId}/${techniqueVersion} to a new draft technique ${draftId}") { | ||
val resourceDir = gitReposProvider.rootDirectory / s"techniques/${category}/${techniqueId}/${techniqueVersion}/resources" | ||
val workspace = gitReposProvider.rootDirectory / s"workspace/${draftId}/${techniqueVersion}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please avoid strings for global vars. Ideally they should be services for easier testing, or at lest something provided centrally in an object.
webapp/sources/rudder/rudder-web/src/main/elm/sources/Editor/DataTypes.elm
Show resolved
Hide resolved
Can you explain the general idea here ? There's several things I don't get:
|
Commit modified |
345484e
to
ae74ad9
Compare
Commit modified |
ae74ad9
to
d909c07
Compare
When I clone a technique with an existing resource, the resource is cloned. But as soons as I try to modify the technique name, I get a lot of error notif in UI, and the following stack trace in logs:
|
… not really have the resource
Commit modified |
d909c07
to
9bda4c7
Compare
I fixed the elm section, we were cloning resource at every edition, when we updated clone: https://github.com/Normation/rudder/pull/5453/files#diff-a4856d1cc4cf1a4d42d660a6e4c3f98072e5f685683419c57d1cd6f2612a0843R617 , it should only be done at clone ( https://github.com/Normation/rudder/pull/5453/files#diff-093c6a0e361570c9b6c31d97a4be6ef77d965334ffac9024abf42cf9badf9671R312 ) I set the api to private too https://github.com/Normation/rudder/pull/5453/files#diff-a4856d1cc4cf1a4d42d660a6e4c3f98072e5f685683419c57d1cd6f2612a0843R617 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, works as expected, code is neat!
OK, merging this PR |
https://issues.rudder.io/issues/24280