-
Notifications
You must be signed in to change notification settings - Fork 94
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
[NU-1806] Add activity parameters #6860
base: staging
Are you sure you want to change the base?
Conversation
updated: #6968 |
be0fe74
to
e0b7858
Compare
8dd895f
to
68932ac
Compare
214c008
to
6eb498d
Compare
|
||
object FixedExpressionValue { | ||
val nullFixedValue: FixedExpressionValue = FixedExpressionValue("", "") | ||
def apply(expression: String, label: String): FixedExpressionValue = FixedExpressionValue(expression, label, None) |
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.
Is this apply method required? In code itself it is not required, because there is default value for hintText, but maybe I'm missing sth related to some integrations/Flink/Java.
// Raw deployment parameters (name -> value) that are used as additional node configuration during deployment. | ||
// Each node can be provided with dedicated set of parameters. | ||
// TODO: consider replacing NodeDeploymentData with Json | ||
type NodeDeploymentData = Map[String, String] |
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.
I think it should be a final case class, serializable to JSON. Now it is a map, serializable to Json object. So adding any new field beside the map of raw params would break compatibility
implicit val fixedValuesParameterEditorEncoder: Encoder[FixedValuesParameterEditor] = | ||
deriveEncoder[FixedValuesParameterEditor] | ||
|
||
implicit val fixedValuesParameterEditorDecoder: Decoder[FixedValuesParameterEditor] = { (c: HCursor) => |
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.
suggestion:
implicit val fixedValuesParameterEditorDecoder: Decoder[FixedValuesParameterEditor] =
Decoder.forProduct2("possibleValues", "mode")(FixedValuesParameterEditor.apply)
.or(Decoder.forProduct1("possibleValues")(FixedValuesParameterEditor(_, FixedValuesEditorMode.LIST)))
* {"DEPLOY": { "parametername": ...parameter configuration... } | ||
*/ | ||
trait WithActivityParameters { self: Source => | ||
def activityParametersDefinition: Map[String, Map[String, ParameterConfig]] |
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.
Maybe it would be a good idea to define enum (sealed trait) with all possible scenario actions in the API module and make it the key of this map. Right now if we change the name of some scenario action, the change will not be enforceable by compiler in all implementations of this trait.
import pl.touk.nussknacker.ui.uiresolving.UIProcessResolver | ||
|
||
// TODO: move to ActivityService? execute node compilation only once with ScenarioTestService? | ||
class ActivityInfoService(activityInfoProvider: ActivityInfoProvider, processResolver: UIProcessResolver) { |
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.
Comment about naming convention: I think that in this context the name "Scenario action" should be used. Deploy/cancel and others are scenario actions, not activities from what I know. It can be especially confusing now, when ScenarioActivities exist in different context.
with ProcessDirectives | ||
with LazyLogging { | ||
|
||
def securedRoute(implicit user: LoggedUser): Route = { |
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.
We discussed returning this information in the already existing endpoint /process/{name}/"status". I think that it would be a good idea, but I'm not sure if it would be easy or doable without making some POC. If not possible, then I think the new service should be a Tapir service, with "ActionInfo" in name instead of "ActivityInfo"
6eb498d
to
62b2354
Compare
Describe your changes
Checklist before merge