feat/df-922: Metrics download#1420
Open
jbarnsley10 wants to merge 10 commits intomainfrom
Open
Conversation
🧪 Acceptance Test Results❌ Some acceptance tests failed |
There was a problem hiding this comment.
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-downloadto 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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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