biohubbc icon indicating copy to clipboard operation
biohubbc copied to clipboard

SIMSBIOHUB-562: Export Survey Data

Open NickPhura opened this issue 1 year ago • 5 comments

Links to Jira Tickets

https://apps.nrs.gov.bc.ca/int/jira/browse/SIMSBIOHUB-562

Description of Changes

API

New endpoint that fetches and uploads survey data to s3, and returns a pre-signed url to download it.

APP

New dialog (under survey settings dropdown button) that allows users to execute an export. Currently restricted to project coordinators and collaborators (and system/data admins).

Testing Notes

Pre-req: S3 credentials in .env

From the settings button at the top of the survey page, clicking export pops a dialogue, which lets you choose which data to export. Data is exported to a zip file in S3, and immediately downloaded to the users local machine.

To Do

API

Currently the export only supports survey metadata and observations (which both just make a very basic select query, and leave the response as json).

APP

The dialogue is fairly basic, with no loading bars, etc, for longer exports. It also just auto-downloads the file, which is maybe not what we want if its large. Might be better to just show a link, and let the user trigger it in their browser separately.

NickPhura avatar Apr 17 '24 20:04 NickPhura

Openshift URLs for the PR Deployment:

  • App Route: https://biohubbc-app-1273-af2668-dev.apps.silver.devops.gov.bc.ca/
  • Api Route: https://biohubbc-api-1273-af2668-dev.apps.silver.devops.gov.bc.ca/
  • Pods: https://console.apps.silver.devops.gov.bc.ca/k8s/ns/af2668-dev/pods?name=1273

github-actions[bot] avatar Apr 17 '24 20:04 github-actions[bot]

Codecov Report

Attention: Patch coverage is 73.03371% with 72 lines in your changes missing coverage. Please review.

Project coverage is 48.57%. Comparing base (556ba8d) to head (0577889). Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
...es/surveys/view/survey-export/SurveyExportForm.tsx 7.69% 24 Missing :warning:
...rt-services/telemetry/export-telemetry-strategy.ts 45.83% 13 Missing :warning:
.../surveys/view/survey-export/SurveyExportDialog.tsx 52.00% 12 Missing :warning:
api/src/services/export-services/export-service.ts 86.27% 7 Missing :warning:
api/src/database/db.ts 20.00% 4 Missing :warning:
app/src/features/surveys/view/SurveyHeader.tsx 25.00% 3 Missing :warning:
api/src/repositories/survey-critter-repository.ts 0.00% 2 Missing :warning:
...ervices/observation/export-observation-strategy.ts 86.66% 2 Missing :warning:
...services/survey/export-survey-metadata-strategy.ts 86.66% 2 Missing :warning:
api/src/__mocks__/db.ts 0.00% 1 Missing :warning:
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1273      +/-   ##
==========================================
+ Coverage   48.28%   48.57%   +0.28%     
==========================================
  Files         763      771       +8     
  Lines       20465    20704     +239     
  Branches     3124     3135      +11     
==========================================
+ Hits         9882    10056     +174     
- Misses      10431    10496      +65     
  Partials      152      152              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 17 '24 20:04 codecov-commenter

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
3.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Jun 06 '24 16:06 sonarqubecloud[bot]

Openshift URLs for the PR Deployment:

  • App Route: https://biohubbc-app-1273-af2668-dev.apps.silver.devops.gov.bc.ca/
  • Api Route: https://biohubbc-api-1273-af2668-dev.apps.silver.devops.gov.bc.ca/
  • Pods: https://console.apps.silver.devops.gov.bc.ca/k8s/ns/af2668-dev/pods?name=1273

github-actions[bot] avatar Aug 01 '24 20:08 github-actions[bot]

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
3.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Aug 02 '24 00:08 sonarqubecloud[bot]

Openshift URLs for the PR Deployment:

  • App Route: https://biohubbc-app-1273-af2668-dev.apps.silver.devops.gov.bc.ca/
  • Api Route: https://biohubbc-api-1273-af2668-dev.apps.silver.devops.gov.bc.ca/
  • Pods: https://console.apps.silver.devops.gov.bc.ca/k8s/ns/af2668-dev/pods?name=1273

github-actions[bot] avatar Sep 11 '24 19:09 github-actions[bot]

Added some unit tests

NickPhura avatar Sep 16 '24 19:09 NickPhura