Skip to content

feat/df-922: Metrics download#1420

Open
jbarnsley10 wants to merge 10 commits intomainfrom
feat/df-992-metrics-download
Open

feat/df-922: Metrics download#1420
jbarnsley10 wants to merge 10 commits intomainfrom
feat/df-992-metrics-download

Conversation

@jbarnsley10
Copy link
Copy Markdown
Contributor

@jbarnsley10 jbarnsley10 commented May 5, 2026

Allow download of metrics data
According to ticket DF-992, it should only download submissions counts for LIVE (non-preview) submissions

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

🧪 Acceptance Test Results

❌ Some acceptance tests failed

View Details

@jbarnsley10 jbarnsley10 marked this pull request as ready for review May 6, 2026 10:12
@mokhld mokhld requested a review from Copilot May 6, 2026 13:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an admin capability to download “live submissions” metrics as a CSV, and emits a new audit event when a platform metrics download is requested (per DF-992’s live-only requirement).

Changes:

  • Introduces /admin/form-metrics-download to generate and return a live-only metrics CSV.
  • Adds a new audit event type/message (PLATFORM_METRICS_DOWNLOAD_REQUESTED) and publishing pipeline support.
  • Extends metrics UI/tests/snapshots to surface the download action and validate behaviour.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
model/src/form/form-audit/types.ts Adds PlatformMetricsDownloadRequestedMessage and includes it in the audit union.
model/src/form/form-audit/enums.ts Adds new audit event enum value PLATFORM_METRICS_DOWNLOAD_REQUESTED.
designer/server/src/views/admin/form-metrics-form-activity.njk Adds a “Download” link to the admin metrics page.
designer/server/src/routes/admin/form-metrics.js Adds the CSV download route, streaming response, and audit publish.
designer/server/src/routes/admin/form-metrics.test.js Adds route tests for component usage tab and CSV download behaviour.
designer/server/src/routes/admin/snapshots/form-metrics.test.js.snap Updates snapshots to include the new UI output.
designer/server/src/models/admin/metrics.js Adds getLiveMetricsAsCsv() to build the live-only CSV output.
designer/server/src/models/admin/metrics.test.js Adds unit coverage for getLiveMetricsAsCsv().
designer/server/src/messaging/publish.js Adds publishPlatformMetricsDownloadRequestedEvent().
designer/server/src/messaging/publish.test.js Adds tests asserting the new audit event publish payload and validation.
designer/server/src/messaging/mappers/events.js Adds a mapper for the new audit event and updates mapper typings/docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread designer/server/src/messaging/mappers/events.js
Comment thread designer/server/src/messaging/mappers/events.js
Comment thread designer/server/src/routes/admin/form-metrics.js
Comment thread designer/server/src/routes/admin/form-metrics.js Outdated
Comment thread designer/server/src/routes/admin/form-metrics.js Outdated
Comment thread designer/server/src/models/admin/metrics.js
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

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.

2 participants