Skip to content

feat(admin): curator job run report and run log download#801

Open
TahaKhan998 wants to merge 1 commit into
CERNDocumentServer:masterfrom
TahaKhan998:feat/harvester-reports-curator
Open

feat(admin): curator job run report and run log download#801
TahaKhan998 wants to merge 1 commit into
CERNDocumentServer:masterfrom
TahaKhan998:feat/harvester-reports-curator

Conversation

@TahaKhan998

Copy link
Copy Markdown

Closes #789

  • when an inspire harvester job finishes we email people. that email again has a “harvester actions” section with two links: one to grab a text log for that run (“download error log”) and one to open harvester reports filtered to that run (“view list of changes”)

  • removed the old “view full details” button from that email — it pointed at the system jobs admin page and a lot of people on the mailing list don’t have access, so it was confusing

  • new page: /administration/harvester-reports/<run_id>/report (curators only). shows the same kind of run summary + log lines as the admin job ui, with colours by level so it’s easier to read than raw text

  • the existing download endpoint still returns a .log file; both that file and the html page use the real invenio jobs log search for the run, not a random audit log export

image image

@TahaKhan998 TahaKhan998 force-pushed the feat/harvester-reports-curator branch from 9de61f4 to 280f3d1 Compare May 14, 2026 21:12
@TahaKhan998 TahaKhan998 force-pushed the feat/harvester-reports-curator branch 2 times, most recently from fa180d4 to 7d750c2 Compare June 9, 2026 11:23
Comment thread assets/less/cds-rdm/administration/harvester-reports.less Outdated
Comment thread site/cds_rdm/harvester_download/resources/resource.py Outdated
Comment thread site/cds_rdm/harvester_download/resources/resource.py Outdated
Comment thread site/cds_rdm/harvester_download/resources/resource.py Outdated
Comment thread site/cds_rdm/harvester_download/resources/resource.py
Comment thread site/cds_rdm/harvester_download/resources/resource.py Outdated
Comment thread site/cds_rdm/harvester_download/resources/resource.py Outdated
Comment thread site/cds_rdm/harvester_download/resources/resource.py Outdated
Comment thread site/cds_rdm/views.py Outdated
@TahaKhan998 TahaKhan998 force-pushed the feat/harvester-reports-curator branch from 7d750c2 to e21c17e Compare June 17, 2026 10:01
Comment thread site/cds_rdm/views.py
@curators_permission.require(http_exception=403)
def harvester_run_report(run_id):
ctx, err = ext.harvester_download_resource.report_template_context(str(run_id))
if err:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

to handle errors in more "flask" way please check .register_errror_handler of blueprint (there should be already examples in the code). Can it be applied here?

return format_datetime(dt, "yyyy-MM-dd HH:mm")


class HarvesterDownloadResource(Resource):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This class needs a little bit untangling as well - you are using the Resource class base, which suggests you will be operating on the resource level (REST API) which you are doing when calling GET download.
However, you are using the same class to build context for UI view (not REST endpoint), which you then assign to a UI blueprint. These approaches have to be disentangled - we separate REST and UI views. Please analyse how invenio-pages module views are written (mainly REST API views, used to be mix of UI and REST) and how invenio-administration is done (mostly UI views). You can also check invenio-app-ils or cds-ils for more low level examples of UI and REST views implementation.
After applying a similar approach to those modules, the code will improve in terms of readability.

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.

feedback: harvester e-mail

2 participants