Skip to content

serval-admin: serval-builds: add TSV export option#3868

Open
marksvc wants to merge 2 commits intomasterfrom
task/sb-tsv
Open

serval-admin: serval-builds: add TSV export option#3868
marksvc wants to merge 2 commits intomasterfrom
task/sb-tsv

Conversation

@marksvc
Copy link
Copy Markdown
Collaborator

@marksvc marksvc commented May 8, 2026

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 createSpreadsheetData helper could have gone a step further and called exportCsv, exportTsv, exportRsv but I chose to have it return data that then the caller can use to subsequently call exportCsv so that there is more flexibility with what to do with the prepared data.

Screenshot:
image

This change is Reviewable

@marksvc marksvc requested a review from Copilot May 8, 2026 16:06
@marksvc marksvc added the e2e Run e2e tests for this pull request label May 8, 2026
@marksvc marksvc marked this pull request as draft May 8, 2026 16:07
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 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 in ServalBuildsComponent and exposed it via the export menu.
  • Refactored CSV export implementation in DraftJobsExportService to use a shared exportSeparatedValues() helper and added exportTsv().
  • 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');
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Refactored.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 30.76923% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.07%. Comparing base (1feb822) to head (5b59323).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...serval-administration/draft-jobs-export.service.ts 14.28% 6 Missing ⚠️
...p/serval-administration/serval-builds.component.ts 50.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@marksvc marksvc temporarily deployed to screenshot_diff May 8, 2026 16:14 — with GitHub Actions Inactive
@marksvc marksvc marked this pull request as ready for review May 8, 2026 16:20
@marksvc marksvc temporarily deployed to screenshot_diff May 8, 2026 16:25 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run e2e tests for this pull request testing not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants