Skip to content

Create Admin Dashboard for Metadata BagIt Generation Management #1520

Description

@NishaSharma14

Is your feature request related to a problem? Please describe.

Currently, there is no admin interface to monitor and manage the metadata BagIt generation process for public studies. Admins need visibility into which studies have failed or are incomplete, along with the ability to retry processing either individually or in bulk.

Describe the solution you'd like

Create an admin dashboard page that provides comprehensive management of the metadata BagIt generation process with the following features:

Dashboard Features

  1. Study List Table

    • Display all public studies where metadata_bagit_generation_status is not "completed"
    • Show the following columns:
      • Study ID
      • Study Name
      • Created At
      • Status (metadata_bagit_generation_status)
      • Logs (metadata_bagit_generation_logs)
  2. Individual Retry Button

    • Show a "Retry" button for each study where metadata_bagit_generation_status is "failed"
    • On click, the button should:
      • Execute the command: php artisan nmrxiv:queue-metadata-extraction --ids={study_id}
      • Upload the zipped data to Ceph storage
  3. Bulk Retry All

    • Provide a "Retry All" button to retry all failed studies at once
    • Executes the same command for all studies with "failed" status
    • Uploads all generated zip data to Ceph
  4. Email Notification

    • After all retry operations complete (individual or bulk), send an email to the admin
    • Email should contain:
      • Success/failure status for each retry
      • Summary of successful and failed retries
      • Detailed logs for any failures

Technical Implementation

Relevant Code References:

The following files contain the existing metadata BagIt generation logic:

Database Schema:

$table->string('metadata_bagit_generation_status')->nullable();
$table->json('metadata_bagit_generation_logs')->nullable();

Existing Command Signature:

php artisan nmrxiv:queue-metadata-extraction --ids={comma_separated_ids}

Implementation Tasks:

  1. Create admin controller for the dashboard page
  2. Create view with table listing and retry buttons
  3. Implement individual retry functionality
    • Call artisan command with specific study ID
    • Handle Ceph upload for the study
  4. Implement bulk retry functionality
    • Iterate through all failed studies
    • Call artisan command with all failed study IDs
    • Handle Ceph uploads in batch
  5. Create notification service/job for email alerts
    • Track retry results (success/failure)
    • Compile logs and summary
    • Send email to admin with detailed report
  6. Add appropriate authorization/middleware for admin access

Additional context

The existing command already supports:

  • --ids: Comma-separated study IDs to process
  • --retry-failed: Retry failed jobs

The dashboard should leverage these existing options and enhance them with a user-friendly interface and notification system.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featuresomething which is not there

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions