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

BI-2376 - Create Delete Endpoint for Deltabreed Experiment Controller #437

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

mlm483
Copy link
Contributor

@mlm483 mlm483 commented Nov 22, 2024

Description

Story: BI-2376

This feature adds a delete endpoint for experiments to bi-api. The endpoint is capable of requesting a hard or soft delete of the backing brapi service, but if an experiment has observations and a hard delete is requested, nothing will be deleted and a 409 Conflict response will be returned.

Additional features:

  • Cache invalidation for all affected entities: trial, study, observation and observation unit (using an inefficient but effective full-key repopulation method).
  • Uses the BrAPIListDAO::deleteBrAPIList method to delete all lists along with the experiment.
  • Renamed several Lists methods for clarity.

Dependencies

Now that Breeding-Insight/brapi-Java-TestServer#41 has been merged, the delete endpoints are present in the develop tagged brapi-server docker image. You may need to manually run docker pull breedinginsight/brapi-java-server:develop to update your local image, and you'll certainly need to delete and recreate your local brapi-serve container to use the updated image.

Testing

Use an API client to test the following 4 Cases.

The endpoint will be the following (substitute your programId, experimentId and hardDelete values.
http://localhost:8081/v1/programs/{{programId}}/experiments/{{experimentId}}?hard={{hardDelete}}

  1. Hard delete an experiment with observations — response: 409 Conflict.
  2. Soft delete an experiment with observations — response: 204 No Content.
  3. Hard delete an experiment without observations — response: 204 No Content.
  4. Soft delete an experiment without observations — response: 204 No Content.

Checklist:

  • I have performed a self-review of my own code
  • I have tested my code and ensured it meets the acceptance criteria of the story
  • I have tested that my code works with both the brapi-java-server and BreedBase
  • I have create/modified unit tests to cover this change
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have run TAF: <please include a link to TAF run>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants