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

Merged
merged 19 commits into from
Jan 15, 2025

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>

@mlm483 mlm483 requested review from a team, davedrp and HMS17 and removed request for a team January 13, 2025 18:16
Copy link
Contributor

@HMS17 HMS17 left a comment

Choose a reason for hiding this comment

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

Looks good and nicely commented! My only concerns are a couple of todos that are unclear if they were meant to be addressed in this card or another.

@mlm483 mlm483 requested a review from HMS17 January 14, 2025 18:10
@mlm483 mlm483 merged commit 9c0fdb5 into develop Jan 15, 2025
1 check passed
@mlm483 mlm483 deleted the feature/BI-2376 branch January 15, 2025 16:05
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.

4 participants