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

RCLOUD-1221: ExecReport adjustments #9130

Merged
merged 4 commits into from
May 31, 2024
Merged

Conversation

ocerda
Copy link
Contributor

@ocerda ocerda commented May 20, 2024

Is this a bugfix, or an enhancement? Please describe.

Describe the solution you've implemented

Describe alternatives you've considered

Additional context

@pd-snyk-integration
Copy link

🎉 Snyk hasn't found any issues so far.

code/snyk check is completed. No issues were found. (View Details)

@ocerda ocerda changed the title ExecReportUtil RCLOUD-1221: ExecReport adjustments May 20, 2024
@ocerda ocerda marked this pull request as ready for review May 20, 2024 15:40
@sjrd218 sjrd218 self-requested a review May 21, 2024 12:51
final def wfsize = exec?.workflow?.steps?.size() ?: 0

if(wfsize>0){
sb<<exec.workflow.steps[0].summarize()
Copy link
Contributor

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.

@ocerda ocerda force-pushed the RCLOUD-1221-exec-report-adjustment branch from a167e70 to 55cf0ee Compare May 27, 2024 14:25
@@ -40,6 +40,6 @@ class RdWorkflowStep implements WorkflowStepData, PluginProviderConfiguration, V
@Override
@JsonIgnore
String summarize() {
return "implement summarization"
return "Plugin["+ pluginType + ', nodeStep: '+nodeStep+']'
Copy link
Contributor

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.

@ocerda ocerda force-pushed the RCLOUD-1221-exec-report-adjustment branch 4 times, most recently from 09143af to 9325514 Compare May 29, 2024 14:40
class WorkflowStepUtil {

static String summarize(WorkflowStepData step) {
if(step.pluginType == WorkflowStepConstants.TYPE_COMMAND & step instanceof BaseCommandExec) {
Copy link
Contributor

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){
Copy link
Contributor

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){
Copy link
Contributor

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.

@ocerda ocerda force-pushed the RCLOUD-1221-exec-report-adjustment branch from 9325514 to df68518 Compare May 29, 2024 17:32
@sjrd218 sjrd218 force-pushed the RCLOUD-1221-exec-report-adjustment branch from 88421aa to fad7422 Compare May 31, 2024 19:53
@sjrd218 sjrd218 added the release-notes/exclude (excludes issue from generated release notes) label May 31, 2024
@sjrd218 sjrd218 added this to the 5.4.0 milestone May 31, 2024
@sjrd218 sjrd218 self-requested a review May 31, 2024 20:34
@sjrd218 sjrd218 merged commit e18d683 into main May 31, 2024
5 checks passed
@sjrd218 sjrd218 deleted the RCLOUD-1221-exec-report-adjustment branch May 31, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes/exclude (excludes issue from generated release notes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants