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

Getting reports list from storage #3025

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.roda.core.data.common.RodaConstants;
import org.roda.core.data.exceptions.AuthorizationDeniedException;
import org.roda.core.data.exceptions.GenericException;
import org.roda.core.data.exceptions.NotFoundException;
import org.roda.core.data.exceptions.NotificationException;
import org.roda.core.data.exceptions.RequestNotValidException;
import org.roda.core.data.v2.index.filter.Filter;
Expand Down Expand Up @@ -94,13 +95,18 @@ public void notify(ModelService model, IndexService index, Job job, JobStats job
StringBuilder builder = new StringBuilder();

for (IndexedReport report : reports) {
Report last = report.getReports().get(report.getReports().size() - 1);
builder.append(last.getPluginDetails()).append("\n\n");
List<Report> reportsList = model.retrieveJobReport(report.getJobId(), report.getId()).getReports();
if (reportsList != null && !reportsList.isEmpty()) {
Report last = reportsList.get(reportsList.size() - 1);
builder.append(last.getPluginDetails()).append("\n\n");
}
}

scopes.put("failures", new Handlebars.SafeString(builder.toString()));
} catch (IOException e) {
LOGGER.error("Error getting failed reports", e);
} catch (NotFoundException e) {
LOGGER.error("Error getting reports list", e);
}
}

Expand Down
Loading