-
Notifications
You must be signed in to change notification settings - Fork 899
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
RCLOUD-1221: ExecReport adjustments #9130
Conversation
🎉 Snyk hasn't found any issues so far.✅ code/snyk check is completed. No issues were found. (View Details) |
final def wfsize = exec?.workflow?.steps?.size() ?: 0 | ||
|
||
if(wfsize>0){ | ||
sb<<exec.workflow.steps[0].summarize() |
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.
This works when using the Gorm implementation, but returns a different result using the RdJob implementation.
a167e70
to
55cf0ee
Compare
@@ -40,6 +40,6 @@ class RdWorkflowStep implements WorkflowStepData, PluginProviderConfiguration, V | |||
@Override | |||
@JsonIgnore | |||
String summarize() { | |||
return "implement summarization" | |||
return "Plugin["+ pluginType + ', nodeStep: '+nodeStep+']' |
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.
This should match the Gorm implementation. You'll find the Gorm implementations in:
CommandExec.summarize()
PluginStep.summarize()
JobExec.summarize()
You should probably create a utility class to do this summarization rather than putting the code in this class.
09143af
to
9325514
Compare
class WorkflowStepUtil { | ||
|
||
static String summarize(WorkflowStepData step) { | ||
if(step.pluginType == WorkflowStepConstants.TYPE_COMMAND & step instanceof BaseCommandExec) { |
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.
The RdWorkflowStep doesn't implement BaseCommandExec, so you can't use that as part of the check.
return "job: ${step.getJobIdentifier()}${step.argString?' -- '+step.argString:''}" | ||
} | ||
|
||
static String summarizeCommandStep(BaseCommandExec step){ |
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.
Since the RdWorkflowStep implementation doesn't implement BaseCommandExec you'll either need to convert the RdWorkflowStep to a BaseCommandExec or not use that type here.
|
||
def "test summarize method command"() { | ||
given: | ||
def step = Mock(BaseCommandExec){ |
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.
Need a test for RdWorkflowStep too.
9325514
to
df68518
Compare
88421aa
to
fad7422
Compare
Is this a bugfix, or an enhancement? Please describe.
Describe the solution you've implemented
Describe alternatives you've considered
Additional context