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

Distributed scan report #63

Merged
merged 5 commits into from
Aug 13, 2024
Merged

Distributed scan report #63

merged 5 commits into from
Aug 13, 2024

Conversation

souvik-karfa
Copy link
Contributor

Summary:

  • Added remoting to the GenerateScanReportAction.
  • Changed the way html report is generated. It now uses the <pre> tag to maintain the formatting of the text.

@souvik-karfa souvik-karfa changed the title distributed ast scan report Distributed scan report Aug 9, 2024
throw new FileNotFoundException("Temp file not found");
}

this.htmlReport = status[1];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add check status is having size 2 else return No output generated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the GenerateReport FileCallable, I am explicitly making an array of size 2. Is the size 2 check necessary then? I can check for null value.

@@ -12,6 +12,10 @@
import hudson.util.Secret;
import io.jenkins.plugins.traceable.ast.scan.helper.Assets;
import io.jenkins.plugins.traceable.ast.scan.helper.TrafficType;
import java.io.*;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we import specific package

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

throw new FileNotFoundException("Temp file not found");
}

this.htmlReport = status[1];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put in else.

if (reportCmdExitValue == 4) {
String[] status = this.workspace.act(new GenerateReport(scriptPath, args, run.getId()));

if (status[0].equals("FAILURE")) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if status is having size >0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before, we are explicitly declaring an array of size 2. Also the value of processExitValue is SUCCESS by default. So it will never be null. It will either be SUCCESS or FAILURE

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's always better to put the check if we are not having unit tests.

@dhruv-singhal-github dhruv-singhal-github merged commit 52859dc into main Aug 13, 2024
3 checks passed
@dhruv-singhal-github dhruv-singhal-github deleted the distributed-AstResult branch August 13, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants