-
Notifications
You must be signed in to change notification settings - Fork 0
Consolidate 'finalize' result summaries into a single file #177
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
Consolidate 'finalize' result summaries into a single file #177
Conversation
Pull Request Test Coverage Report for Build 15786856642Details
💛 - Coveralls |
dc67866
to
3781203
Compare
Why these changes are being introduced: * Simplify generated report via 'finalize' by keeping all DSS results for a batch in a single file How this addresses that need: * Update 'finalize' Jinja reporting templates to read all results from Workflow.events.processed_items * Create FinalizeReport.create_summary method to create content of email body * Fix Docker build and publish commands in Makefile Side effects of this change: * The emailed report sent via the 'finalize' command will comprise of a single CSV file attachment, containing the information from all parsed DSS result messages. Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/IN-1320
9b5ac47
to
9e6705c
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.
Approved! Consolidating seems like a no-brainer here.
One comment, totally optional, might be to reorder the columns in the report. Looking at the CSV I see the following column order:
item_identifier,result_message_body,ingested,dspace_handle,error
I think moving the more debugging-esque column result_message_body
to the end could be helpful. I might propose an order like:
item_identifier,ingested,dspace_handle,error,result_message_body
But looks good otherewise.
def to_plain_text(self) -> str: | ||
return self.jinja_template_plain_text.render( | ||
workflow_name=self.workflow_name, | ||
batch_id=self.batch_id, | ||
report_date=self.report_date, | ||
processed_items=self.events.processed_items, | ||
ingested_items=self.get_ingested_items(), | ||
errors=self.events.errors, | ||
summary=self.create_summary(), | ||
) | ||
|
||
def to_html(self) -> str: | ||
return self.jinja_template_html.render( | ||
workflow_name=self.workflow_name, | ||
batch_id=self.batch_id, | ||
report_date=self.report_date, | ||
processed_items=self.events.processed_items, | ||
ingested_items=self.get_ingested_items(), | ||
errors=self.events.errors, | ||
summary=self.create_summary(), | ||
) |
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.
Big +1 to consolidating these.
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.
Perfection! But I agree with Graham's suggested column order, that would be more readable to the stakeholders
Purpose and background context
Simplify generated report via 'finalize' by keeping all DSS results for a batch in a single file
Note: DO NOT MERGE UNTIL PR #176 is approved and merged! These changes build on the work in PR #176.
How can a reviewer manually see the effects of these changes?
A test run using a small sample of OpenCourseWare files was performed. The screenshot and file attachment shared below are from the email sent on June 16, 2025 at 10:24AM EST with subject heading:
DSpace Submission Results - opencourseware, batch='opencourseware-2025-04-22-stepfunctiontest'
.finalize
commandIncludes new or updated dependencies?
NO
Changes expectations for external applications?
NO
What are the relevant tickets?
Developer
Code Reviewer(s)