datalab-org / datalab

datalab is a place to store experimental data and the connections between them.
https://docs.datalab-org.io
MIT License
46 stars 17 forks source link

Enable soft deletion of items #831

Open ml-evs opened 2 months ago

ml-evs commented 2 months ago

By default, delete will now simply set a flag _deleted on the database entry, so that it can be restored in future. This is important for e.g., labelled samples and maintaining old relationships to samples.

cypress[bot] commented 2 months ago

datalab    Run #2472

Run Properties:  status check failed Failed #2472  •  git commit d78e706498 ℹ️: Merge bcd033f78622b6cd65ab0d1b05f45270823ec1aa into 39be3fb056179b66d37cf2de259a...
Project datalab
Branch Review ml-evs/delete-sample-rework
Run status status check failed Failed #2472
Run duration 07m 17s
Commit git commit d78e706498 ℹ️: Merge bcd033f78622b6cd65ab0d1b05f45270823ec1aa into 39be3fb056179b66d37cf2de259a...
Committer Matthew Evans
View all properties for this run ↗︎

Test results
Tests that failed  Failures 63
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 69
View all changes introduced in this branch ↗︎


Tests for review

Failed  batchSampleFeature.cy.js • 7 failed tests • End-to-end tests (chrome) View Output
Test Artifacts
Batch sample creation > modifies some data in the first sample Test Replay Screenshots
Batch sample creation > modifies some data in the second sample Test Replay Screenshots
Batch sample creation > checks the copied samples Test Replay Screenshots
Batch sample creation > checks the created samples Test Replay Screenshots
Batch sample creation > uses the template id, name, date, copyFrom, and components Test Replay Screenshots
Batch sample creation > plays with the number of rows Test Replay Screenshots
Batch cell creation > creates a batch of cells using the template id, name, date, copyFrom, and components Test Replay Screenshots
Failed  editPage.cy.js • 6 failed tests • End-to-end tests (chrome) View Output
Test Artifacts
Edit Page > Checks editing the sample edit page Test Replay Screenshots
Edit Page > adds a chemical formula to component1 Test Replay Screenshots
Edit Page > adds some synthesis information Test Replay Screenshots
Edit Page > deletes synthesis components and re-adds them Test Replay Screenshots
Edit Page > tries to add a non-numeric value into quantity Test Replay Screenshots
Edit Page > Add some blocks to the sample and checks unsaved warning behavior Test Replay Screenshots
Failed  equipment.cy.js • 3 failed tests • End-to-end tests (chrome) View Output
Test Artifacts
Equipment table page > Checks if one of the equipment items is in the database Test Replay Screenshots
Equipment table page > Deletes an item Test Replay Screenshots
Equipment edit page > modifies some data in a sample Test Replay Screenshots
Failed  sampleTablePage.cy.js • 5 failed tests • End-to-end tests (chrome) View Output
Test Artifacts
Advanced sample creation features > deletes the first sample and makes sure the copy is still there Test Replay Screenshots
Advanced sample creation features > modifies some data in the second sample Test Replay Screenshots
Advanced sample creation features > checks the edit page of the copied sample Test Replay Screenshots
Advanced sample creation features > copies the copied sample, this time with additional components Test Replay Screenshots
Advanced sample creation features > checks the edit page of the copied sample with components Test Replay Screenshots
Failed  batchSampleFeature.cy.js • 7 failed tests • End-to-end tests (firefox) View Output
Test Artifacts
Batch sample creation > modifies some data in the first sample Screenshots
Batch sample creation > modifies some data in the second sample Screenshots
Batch sample creation > checks the copied samples Screenshots
Batch sample creation > checks the created samples Screenshots
Batch sample creation > uses the template id, name, date, copyFrom, and components Screenshots
Batch sample creation > plays with the number of rows Screenshots
Batch cell creation > creates a batch of cells using the template id, name, date, copyFrom, and components Screenshots

The first 5 failed specs are shown, see all 12 specs in Cypress Cloud.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 81.66667% with 11 lines in your changes missing coverage. Please review.

Project coverage is 68.35%. Comparing base (39be3fb) to head (bcd033f).

Files with missing lines Patch % Lines
pydatalab/pydatalab/mongo.py 60.00% 4 Missing :warning:
pydatalab/pydatalab/permissions.py 72.72% 3 Missing :warning:
pydatalab/pydatalab/routes/v0_1/graphs.py 81.81% 2 Missing :warning:
pydatalab/pydatalab/routes/v0_1/items.py 90.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #831 +/- ## ========================================== + Coverage 68.22% 68.35% +0.12% ========================================== Files 62 62 Lines 3909 3953 +44 ========================================== + Hits 2667 2702 +35 - Misses 1242 1251 +9 ``` | [Files with missing lines](https://app.codecov.io/gh/datalab-org/datalab/pull/831?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalab-org) | Coverage Δ | | |---|---|---| | [pydatalab/pydatalab/models/items.py](https://app.codecov.io/gh/datalab-org/datalab/pull/831?src=pr&el=tree&filepath=pydatalab%2Fpydatalab%2Fmodels%2Fitems.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalab-org#diff-cHlkYXRhbGFiL3B5ZGF0YWxhYi9tb2RlbHMvaXRlbXMucHk=) | `96.77% <100.00%> (ø)` | | | [pydatalab/pydatalab/models/traits.py](https://app.codecov.io/gh/datalab-org/datalab/pull/831?src=pr&el=tree&filepath=pydatalab%2Fpydatalab%2Fmodels%2Ftraits.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalab-org#diff-cHlkYXRhbGFiL3B5ZGF0YWxhYi9tb2RlbHMvdHJhaXRzLnB5) | `97.87% <100.00%> (+0.37%)` | :arrow_up: | | [pydatalab/pydatalab/routes/v0\_1/graphs.py](https://app.codecov.io/gh/datalab-org/datalab/pull/831?src=pr&el=tree&filepath=pydatalab%2Fpydatalab%2Froutes%2Fv0_1%2Fgraphs.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalab-org#diff-cHlkYXRhbGFiL3B5ZGF0YWxhYi9yb3V0ZXMvdjBfMS9ncmFwaHMucHk=) | `94.59% <81.81%> (-2.24%)` | :arrow_down: | | [pydatalab/pydatalab/routes/v0\_1/items.py](https://app.codecov.io/gh/datalab-org/datalab/pull/831?src=pr&el=tree&filepath=pydatalab%2Fpydatalab%2Froutes%2Fv0_1%2Fitems.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalab-org#diff-cHlkYXRhbGFiL3B5ZGF0YWxhYi9yb3V0ZXMvdjBfMS9pdGVtcy5weQ==) | `82.80% <90.00%> (+0.15%)` | :arrow_up: | | [pydatalab/pydatalab/permissions.py](https://app.codecov.io/gh/datalab-org/datalab/pull/831?src=pr&el=tree&filepath=pydatalab%2Fpydatalab%2Fpermissions.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalab-org#diff-cHlkYXRhbGFiL3B5ZGF0YWxhYi9wZXJtaXNzaW9ucy5weQ==) | `84.31% <72.72%> (-0.14%)` | :arrow_down: | | [pydatalab/pydatalab/mongo.py](https://app.codecov.io/gh/datalab-org/datalab/pull/831?src=pr&el=tree&filepath=pydatalab%2Fpydatalab%2Fmongo.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalab-org#diff-cHlkYXRhbGFiL3B5ZGF0YWxhYi9tb25nby5weQ==) | `76.62% <60.00%> (-3.66%)` | :arrow_down: |