-
Notifications
You must be signed in to change notification settings - Fork 93
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
Replace "run now" CustomAction with standard action PerformSingleExecution #7165
base: staging
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
...src/main/scala/pl/touk/nussknacker/engine/api/deployment/ProcessStateDefinitionManager.scala
Show resolved
Hide resolved
extensions-api/src/main/scala/pl/touk/nussknacker/engine/api/deployment/ProcessAction.scala
Outdated
Show resolved
Hide resolved
879fd84
to
d3c0e7d
Compare
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.
Minor comments added
const action = (p, c) => HttpService.performSingleExecution(p, c).finally(() => dispatch(loadProcessState(processName))); | ||
const message = t("panels.actions.perform-single-execution.dialog", "Perform single execution", { name: processName }); | ||
|
||
const tooltip = ProcessStateUtils.getActionCustomTooltip(scenarioState, PredefinedActionName.PerformSingleExecution) ?? "run now"; |
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 use i18n mechanism
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 I've done it now. Backend returns type of tooltip ("NOT_ALLOWED_IN_CURRENT_STATE" /"NOT_ALLOWED_FOR_DEPLOYED_VERSION") and frontend handles actual message rendering with i18s.
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.
It's not exactly what I head in mind. I mean i18n for "run now" text :). I would not apply i18n for backend messages this way. If we decide to do this, it should be done full on BE side and done more holistic. Let's revert this
@@ -86,3 +80,9 @@ case class DMCancelScenarioCommand(scenarioName: ProcessName, user: User) extend | |||
|
|||
case class DMStopScenarioCommand(scenarioName: ProcessName, savepointDir: Option[String], user: User) | |||
extends DMScenarioCommand[SavepointResult] | |||
|
|||
case class DMPerformSingleExecutionCommand( |
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.
- What about custom actions? Can you write in the description the plan of changes that will be made in further PRs?
- Let's write a TODO describing further plan that won't be a part of currently planned changes. Do you agree that eventually we should extract some kind of a scheduler interface and in the deployment manager keep only logic related with the deployment? Or maybe you see it differently?
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 added in this PR description the general plan for periodics, especially the change that is already in progress.
I'm not sure ATM about the future of CustomAction's. We aren't using them internally anymore - "run now" was our only usage. They are left in the codebased and APIs right now, so Nu users can still use them.
I guess we need to decide, whether to leave CustomAction's as they are, or remove them.
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 should remove custom actions. It was done only for this one thing. It complicates deployments mechanism and slow down development. Let's add a removal step to the plan
disabled={name === "run now" ? disabledValue : false} | ||
type={type} | ||
/> | ||
<CustomActionButton action={action} processName={processName} disabled={false} processStatus={status} type={type} /> |
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.
As I see, there is no option to disable a custom action based on FE types. Do we need this disabled
flag?
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.
It is part of common ToolbarButtonProps
, used for all buttons. AFAIK this value must be provided. I guess at the moment it is the only button, that is never disabled on FE side, so constant false
provided here
After Arek's comments I added internationalization of tooltip messages, I think it needs FE review too.
Describe your changes
The main purpose of this PR, is to refactor "run now" action for periodic DeploymentManagers:
Planned changes related to the PeriodicDeploymentManager:
Most important changes:
actions
panel, no longer uses generic CustomAction mechanism and buttondef applicableActions
) (right now only applied to "run now" for periodic processes)Checklist before merge
Summary by CodeRabbit
Summary by CodeRabbit
New Features
PerformSingleExecution
action, enhancing scenario execution capabilities.DMPerformSingleExecutionCommand
, in theDeploymentManager
.ProcessStateDefinitionManager
.ProcessState
class with new fields for applicable actions and action tooltips.PerformSingleExecutionButton
in the toolbar for immediate execution.PerformSingleExecutionRequest
andPerformSingleExecutionResponse
for API interactions.PerformSingleExecution
action.ActivitiesPanelRow
component to recognize additional running states.Bug Fixes
Documentation
Chores