Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BIOMAGE-1836] Implement metadata tracks-specific endpoints #343

Merged
merged 16 commits into from
May 3, 2022

Conversation

cosa65
Copy link
Member

@cosa65 cosa65 commented Apr 28, 2022

Description

Details

URL to issue

https://biomage.atlassian.net/browse/BIOMAGE-1836

Link to staging deployment URL (or set N/A)

https://ui-martinfosco-ui699-api343.scp-staging.biomage.net/

Links to any PRs or resources related to this PR

hms-dbmi-cellenics/ui#699

Integration test branch

master

Merge checklist

Your changes will be ready for merging after all of the steps below have been completed.

Code updates

Have best practices and ongoing refactors being observed in this PR

  • Migrated any selector / reducer used to the new format.

Manual/unit testing

  • Tested changes using InfraMock locally or no tests required for change, e.g. Kubernetes chart updates.
  • Validated that current unit tests for code work as expected and are sufficient for code coverage or no unit tests required for change, e.g. documentation update.
  • Unit tests written or no unit tests required for change, e.g. documentation update.

Integration testing

You must check the box below to run integration tests on the latest commit on your PR branch.
Integration tests have to pass before the PR can be merged. Without checking the box, your PR
will not pass the required status checks for merging.

  • Started end-to-end tests on the latest commit.

Documentation updates

  • Relevant Github READMEs updated or no GitHub README updates required.
  • Relevant Wiki pages created/updated or no Wiki updates required.

Optional

  • Staging environment is unstaged before merging.
  • Photo of a cute animal attached to this PR.

@cosa65 cosa65 changed the title Implement metadata tracks-specific endpoints [BIOMAGE-1836] Implement metadata tracks-specific endpoints Apr 28, 2022
@codecov
Copy link

codecov bot commented Apr 28, 2022

Codecov Report

Merging #343 (a585166) into master (4acc269) will increase coverage by 0.20%.
The diff coverage is 98.33%.

@@            Coverage Diff             @@
##           master     #343      +/-   ##
==========================================
+ Coverage   85.03%   85.24%   +0.20%     
==========================================
  Files         135      137       +2     
  Lines        3622     3679      +57     
  Branches      401      405       +4     
==========================================
+ Hits         3080     3136      +56     
- Misses        499      500       +1     
  Partials       43       43              
Impacted Files Coverage Δ
src/api.v2/model/MetadataTrack.js 96.42% <93.75%> (-3.58%) ⬇️
src/api.v2/controllers/metadataTrackController.js 100.00% <100.00%> (ø)
src/api.v2/controllers/sampleController.js 100.00% <100.00%> (ø)
src/api.v2/model/BasicModel.js 100.00% <100.00%> (ø)
src/api.v2/routes/metadataTrack.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4acc269...a585166. Read the comment docs.

@@ -52,7 +52,7 @@ const deleteSample = async (req, res) => {
logger.log(`Deleting sample ${sampleId} from experiment ${experimentId}`);

await sqlClient.get().transaction(async (trx) => {
await new Sample(trx).destroy(sampleId);
await new Sample(trx).delete(sampleId);
Copy link
Member

Choose a reason for hiding this comment

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

Will the metadata track entries, if any, be deleted when we call Sample.delete in line 55?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, we tlaked about this with agi yesterday actually, you can test the current behavior in apj v1, if you remove all samples and add a new one after the metadata tracks will still be there.

(The sample_in_metadata_track_map rows will be auto deleted).

Copy link
Member

Choose a reason for hiding this comment

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

I didn't know this about v1. How do sample_in_metadata_track_map get auto deleted? Is there a trigger?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's the result of th eforeign keys set up.
If you write ON DELETETE CASCADE you're saying that when the foreign key a row is referencing is deleted then its own action should be to also be deleted.

@cosa65 cosa65 merged commit 5b3d04e into master May 3, 2022
@cosa65 cosa65 deleted the 1836-metadata-tracks-endpoints branch May 3, 2022 13:04
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