serval-admin: serval-builds: add TSV export option#3868
Open
serval-admin: serval-builds: add TSV export option#3868
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a TSV (tab-separated values) export option to the Serval Administration “Serval builds” view, extending the existing export capabilities (CSV/RSV) and centralizing separated-value export logic in the export service.
Changes:
- Added
exportTsv()flow inServalBuildsComponentand exposed it via the export menu. - Refactored CSV export implementation in
DraftJobsExportServiceto use a sharedexportSeparatedValues()helper and addedexportTsv(). - Added/updated unit tests to cover TSV export wiring and service behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.ts | Adds component-level TSV export method that delegates to DraftJobsExportService. |
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.spec.ts | Adds a unit test verifying TSV export calls into the export service. |
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.html | Adds “Export TSV” menu item and clarifies CSV/RSV helper text. |
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/draft-jobs-export.service.ts | Adds TSV export and refactors CSV/TSV via exportSeparatedValues(). |
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/draft-jobs-export.service.spec.ts | Adds a unit test asserting TSV delegates to the shared export helper with correct parameters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+240
to
+246
| protected exportTsv(): void { | ||
| const dateRange: NormalizedDateRange | undefined = this.dateRange$.value; | ||
| if (dateRange == null) throw new Error('Date range is not set'); | ||
| const spreadsheetRows: SpreadsheetRow[] = ServalBuildsComponent.createSpreadsheetRows(this.rows); | ||
| const meanDurationMs: number = this.summaryStats?.meanDurationMs ?? 0; | ||
| const maxDurationMs: number = this.summaryStats?.maxDurationMs ?? 0; | ||
| this.exportService.exportTsv(spreadsheetRows, dateRange, meanDurationMs, maxDurationMs, 'serval_builds'); |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3868 +/- ##
==========================================
+ Coverage 81.04% 81.07% +0.02%
==========================================
Files 630 630
Lines 40592 40594 +2
Branches 6588 6561 -27
==========================================
+ Hits 32898 32910 +12
- Misses 6661 6667 +6
+ Partials 1033 1017 -16 ☔ View full report in Codecov by Sentry. |
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.
This patch adds an "Export TSV" option to export Serval build records using Tab-separated values.
@Nateowami and I were discussing whether .tsv might be preferable to .csv for our downloads, and I planned to add it as an option on the Serval builds tab.
The
createSpreadsheetDatahelper could have gone a step further and calledexportCsv,exportTsv,exportRsvbut I chose to have it return data that then the caller can use to subsequently callexportCsvso that there is more flexibility with what to do with the prepared data.Screenshot:

This change is