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

[Cell-level metadata] Update the Add metadata select #488

Merged
merged 10 commits into from
Oct 5, 2023

Conversation

StefanBabukov
Copy link
Member

@StefanBabukov StefanBabukov commented Sep 28, 2023

Description

Details

URL to issue

https://github.com/orgs/hms-dbmi-cellenics/projects/4/views/1?pane=issue&itemId=37286398

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

N/A

Links to any PRs or resources related to this PR

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.
  • All new dependency licenses have been checked for compatibility

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.

@StefanBabukov StefanBabukov added the safe to run Marks the PR as safe to run checks on. IMPORTANT only add if from a trusted source. label Sep 28, 2023
@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Merging #488 (c586e59) into master (92994ec) will decrease coverage by 0.65%.
The diff coverage is 65.51%.

@@            Coverage Diff             @@
##           master     #488      +/-   ##
==========================================
- Coverage   90.50%   89.86%   -0.65%     
==========================================
  Files         160      166       +6     
  Lines        3498     3572      +74     
  Branches      390      395       +5     
==========================================
+ Hits         3166     3210      +44     
- Misses        311      340      +29     
- Partials       21       22       +1     
Files Coverage Δ
src/api.v2/controllers/experimentController.js 98.62% <ø> (ø)
src/api.v2/controllers/sampleFileController.js 96.96% <100.00%> (-0.40%) ⬇️
src/api.v2/helpers/s3/signedUrl.js 100.00% <100.00%> (ø)
src/api.v2/model/CellLevelMeta.js 100.00% <100.00%> (ø)
src/api.v2/model/tableNames.js 100.00% <ø> (ø)
src/api.v2/routes/sampleFile.js 100.00% <ø> (ø)
src/api.v2/routes/s3Upload.js 66.66% <66.66%> (ø)
src/api.v2/model/CellLevelMetaToExperiment.js 71.42% <71.42%> (ø)
src/api.v2/routes/cellLevel.js 60.00% <60.00%> (ø)
src/api.v2/controllers/s3Upload.js 77.77% <77.77%> (ø)
... and 2 more

Copy link
Member

@cosa65 cosa65 left a comment

Choose a reason for hiding this comment

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

There's some tests pending I think

src/api.v2/controllers/cellLevelController.js Outdated Show resolved Hide resolved
src/api.v2/controllers/cellLevelController.js Outdated Show resolved Hide resolved
src/api.v2/controllers/cellLevelController.js Outdated Show resolved Hide resolved
src/api.v2/controllers/cellLevelController.js Outdated Show resolved Hide resolved
src/api.v2/model/CellLevel.js Outdated Show resolved Hide resolved
src/api.v2/model/Experiment.js Outdated Show resolved Hide resolved
Signed-off-by: stefanbabukov <[email protected]>
Signed-off-by: stefanbabukov <[email protected]>
src/api.v2/controllers/cellLevelController.js Outdated Show resolved Hide resolved
src/api.v2/model/Experiment.js Outdated Show resolved Hide resolved
@ivababukova
Copy link
Member

@StefanBabukov wouldn't it be better to use the name cellLevelMeta instead of cellLevel? We are shortening the name with 4 chars, but I feel like we loose a lot of descriptiveness and adding 4 more chars is worth it?

Comment on lines 40 to 42
const snakeCasedKeysToPatch = _.mapKeys(body, (_value, key) => _.snakeCase(key));
const { cellMetadataFileId } = await new CellLevelToExperiment().find({ experiment_id: experimentId }).first();
await new CellLevel().updateById(cellMetadataFileId, snakeCasedKeysToPatch);
Copy link
Member

Choose a reason for hiding this comment

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

This call won't work, also we are allowing users to decide what to patch, and that's not something we want to do.

Copy link
Member

Choose a reason for hiding this comment

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

This isn't part of the ticket anyways, so maybe you could just leave this function empty

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm using this to update the status of the upload. What's the problem here? Why would it not work?

Copy link
Member

@cosa65 cosa65 Oct 3, 2023

Choose a reason for hiding this comment

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

I mean rather than snake casing anything that arrives, just extract the upload status and update only that.

It's more or less what the patch of sample files const patchFile = async (req, res) => { does

src/api.v2/model/Experiment.js Outdated Show resolved Hide resolved
src/api.v2/model/Experiment.js Outdated Show resolved Hide resolved
Signed-off-by: stefanbabukov <[email protected]>
Copy link
Member

@cosa65 cosa65 left a comment

Choose a reason for hiding this comment

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

lgtm, I think there was one comment to address from iva too

@StefanBabukov StefanBabukov merged commit 6b9fb67 into hms-dbmi-cellenics:master Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to run Marks the PR as safe to run checks on. IMPORTANT only add if from a trusted source.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants