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

Enable soft deletion of items #831

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

ml-evs
Copy link
Member

@ml-evs ml-evs commented Aug 4, 2024

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.

Copy link

cypress bot commented Aug 4, 2024

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.

@ml-evs ml-evs changed the title Rework the /delete-sample route and enable soft deletion of items Enable soft deletion of items Aug 4, 2024
@ml-evs ml-evs force-pushed the ml-evs/delete-sample-rework branch 4 times, most recently from 3c7d215 to aac2082 Compare August 5, 2024 21:02
Copy link

codecov bot commented Aug 5, 2024

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 ⚠️
pydatalab/pydatalab/permissions.py 72.72% 3 Missing ⚠️
pydatalab/pydatalab/routes/v0_1/graphs.py 81.81% 2 Missing ⚠️
pydatalab/pydatalab/routes/v0_1/items.py 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            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 Coverage Δ
pydatalab/pydatalab/models/items.py 96.77% <100.00%> (ø)
pydatalab/pydatalab/models/traits.py 97.87% <100.00%> (+0.37%) ⬆️
pydatalab/pydatalab/routes/v0_1/graphs.py 94.59% <81.81%> (-2.24%) ⬇️
pydatalab/pydatalab/routes/v0_1/items.py 82.80% <90.00%> (+0.15%) ⬆️
pydatalab/pydatalab/permissions.py 84.31% <72.72%> (-0.14%) ⬇️
pydatalab/pydatalab/mongo.py 76.62% <60.00%> (-3.66%) ⬇️

@ml-evs ml-evs force-pushed the ml-evs/delete-sample-rework branch from aac2082 to 25da407 Compare August 31, 2024 11:37
@ml-evs ml-evs force-pushed the ml-evs/delete-sample-rework branch from 25da407 to bcd033f Compare October 3, 2024 12:14
@ml-evs ml-evs added this to the v0.5.x milestone Oct 8, 2024
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.

1 participant