Allow xray_audit to download all reports as CSV

Created on 21 May 2025, 16 days ago

Problem/Motivation

Currently, the xray_audit module does not provide a way to export all audit reports as CSV files, which would be useful for offline analysis, sharing, or archiving purposes. Users need to manually view each task’s results in the UI, which is inefficient for larger sites or audit batches.

Steps to reproduce

  1. Enable and configure the xray_audit module.
  2. Run audit tasks and review results through the UI.
  3. Observe that there is no option to export all results as CSV.

Proposed resolution

Implement a feature to allow downloading all audit reports as CSV files. The implementation should:

  • Loop through all executed audit task plugins.
  • Collect their results and transform them into a unified CSV format.
  • Use appropriate output streaming techniques to generate a downloadable CSV file.
  • Ensure compatibility with at least Drupal 9.5.

Relevant implementation references:

Remaining tasks

  • Design a controller or UI link to trigger the download.
  • Load and execute all relevant task plugins.
  • Format task results as CSV.
  • Stream CSV response using appropriate headers.
  • Test the feature on Drupal 9.5+ and 10.x sites.

User interface changes

A new button or link should be added to the audit report interface to download all results as CSV.

API changes

None expected unless utility functions for CSV export are abstracted for reuse.

Data model changes

None.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί
  • πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί
  • πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί
  • Pipeline finished with Success
    14 days ago
    Total: 142s
    #504619
  • Pipeline finished with Success
    14 days ago
    Total: 152s
    #504631
  • Pipeline finished with Success
    14 days ago
    Total: 216s
    #504653
  • Pipeline finished with Success
    14 days ago
    Total: 129s
    #504670
  • Pipeline finished with Success
    14 days ago
    Total: 140s
    #504683
  • Pipeline finished with Success
    14 days ago
    Total: 170s
    #504691
  • Pipeline finished with Success
    14 days ago
    Total: 129s
    #504707
  • Pipeline finished with Success
    14 days ago
    Total: 180s
    #504712
  • Pipeline finished with Success
    14 days ago
    Total: 137s
    #504854
  • Pipeline finished with Success
    14 days ago
    Total: 152s
    #504878
  • Pipeline finished with Success
    13 days ago
    Total: 159s
    #505446
  • Pipeline finished with Success
    13 days ago
    Total: 141s
    #505465
  • Pipeline finished with Success
    13 days ago
    Total: 145s
    #505474
  • Pipeline finished with Success
    13 days ago
    Total: 147s
    #505478
  • Pipeline finished with Success
    13 days ago
    Total: 174s
    #505509
  • Pipeline finished with Success
    13 days ago
    Total: 247s
    #505511
  • Pipeline finished with Success
    13 days ago
    Total: 225s
    #505522
  • Pipeline finished with Success
    13 days ago
    Total: 157s
    #505535
  • πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί

    ZipArchiver does not works properly on Drupal 9.5, needs patch from issue https://www.drupal.org/project/drupal/issues/2850794 πŸ› Unable to open Zip archive using ArchiverZip Fixed

  • Pipeline finished with Success
    13 days ago
    Total: 134s
    #505577
  • Pipeline finished with Success
    13 days ago
    Total: 152s
    #505578
  • Pipeline finished with Canceled
    13 days ago
    Total: 156s
    #505583
  • Pipeline finished with Success
    13 days ago
    Total: 139s
    #505585
  • Pipeline finished with Success
    13 days ago
    Total: 141s
    #505601
  • Pipeline finished with Success
    13 days ago
    Total: 146s
    #505604
  • Pipeline finished with Success
    13 days ago
    Total: 146s
    #505605
  • Pipeline finished with Canceled
    13 days ago
    Total: 93s
    #505608
  • Pipeline finished with Success
    13 days ago
    Total: 147s
    #505609
  • πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί

    Example of report CSV download:

    Added download button on almost all reports, except XrayAuditQueryTaskImageStylesPlugin as the current data structure was too difficult to adapt.

  • Pipeline finished with Success
    11 days ago
    Total: 212s
    #506410
  • Pipeline finished with Success
    11 days ago
    Total: 177s
    #506429
  • Pipeline finished with Success
    11 days ago
    Total: 138s
    #506431
  • Pipeline finished with Success
    11 days ago
    Total: 157s
    #506438
  • Pipeline finished with Success
    11 days ago
    Total: 239s
    #506472
  • Pipeline finished with Success
    11 days ago
    Total: 598s
    #506474
  • πŸ‡ͺπŸ‡ΈSpain lpeidro Madrid

    I have identified some issues related to the reports in the Drupal administration:

    Entities Displays

    Due to changes in the structure of routes and links, the content display now shows the title 'Entities Displays' along with tabs for the various entity displays.

    • Node display configurations: /en/admin/reports/xray-audit/content-display/node-display-mode
    • Paragraphs display configurations: /en/admin/reports/xray-audit/content-display/paragraph-display-mode
    • Media display configurations: /en/admin/reports/xray-audit/content-display/media-display-mode
    • Taxonomy display configurations: /en/admin/reports/xray-audit/content-display/taxonomy-display-mode
    • Block display configurations: /en/admin/reports/xray-audit/content-display/taxonomy-display-mode

    Site structure

    Menus: /en/admin/reports/xray-audit/site-structure/menu

    The filter has disappeared, and the report is not displaying correctly.

  • πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί

    @lpeidro
    We changed to tabs Entities Displays, as they were different operations, and to maintain the standard of one operation and a download button per page.

  • πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί

    Site structure

    Menus: /en/admin/reports/xray-audit/site-structure/menu

    We changed the view to show all menus on the same table to make it easy to download.

Production build 0.71.5 2024