Skip to content

Conversation

@regisoc
Copy link
Contributor

@regisoc regisoc commented Jun 4, 2025

Brief summary of changes

This PR:

  • updates the PUT/PATCH instrument endpoints to actually validate the data payload received. The current process is calling the Instrument validate() method, but this method is NOT validating any data. It is only checking the instrument data_entry = complete status, which is counter-intuitive.
  • bugfixes the PATCH/PUT instrument flag endpoint. The flag data_entry = 'complete' was checked before the db can be reached to perform the update, which is blocking the update. The current PR should not change the instrument front-end behaviour.

Test instructions

  1. bugfix: instrument flag PUT/PATCH blocked on the API not on the front-end.
  • Target a candid/visit/instrument with a data_entry = 'complete' flag/state.
  • Try updating the Data_entry from the front-end (directly in instrument, accessible by candidate_list > timepoint > instrument) with the right permissions. This should be doable with and without this fix.
  • Try the API instrument flag PATCH/PUT endpoint in Swagger API module (i.e. /candidates/{candid}/{visit}/instruments/{instrument}/flags).
  • Both endpoint should now accept updates i.e. no 403 error with Can not update instruments that are flagged as complete. message returned.
  1. instrument PATCH/PUT endpoint.
  • Target a candid/visit/instrument with a data_entry = 'in progress' flag, or update one with the previous 1. endpoint.
  • Try the API instrument PATCH/PUT endpoint in Swagger API module (i.e. /candidates/{candid}/{visit}/instruments/{instrument}).
  • Both endpoint should now update completely or partly the instrument data.
  • Also try with the swagger UI.

Link(s) to related issue(s)

@regisoc regisoc added Category: Bug PR or issue that aims to report or fix a bug Area: API PR or issue related to the API Priority: High PR or issue should be prioritised over others for review and testing Language: PHP PR or issue that update PHP code 26.0.0-bugs Issues that were raised during the release testing for 26.0.0 Project: HBCD Issue or PR related to the HBCD project Area: Instruments PR or issue related instruments Module: api PR or issue related to api module labels Jun 4, 2025
@regisoc regisoc marked this pull request as ready for review July 24, 2025 20:35
@regisoc
Copy link
Contributor Author

regisoc commented Jul 24, 2025

@kongtiaowang can you make a quick review on this?
I added the PUT/PATCH difference logic + updated the test accordingly.

@kongtiaowang
Copy link
Contributor

@regisoc LGTM

@regisoc
Copy link
Contributor Author

regisoc commented Aug 11, 2025

@driusan assigning you for final review

@regisoc regisoc assigned driusan and unassigned regisoc Aug 11, 2025
@github-actions github-actions bot added the RaisinBread PR or issue introducing/requiring improvements to the Raidinbread dataset label Dec 16, 2025
@regisoc regisoc requested a review from driusan December 17, 2025 00:19
@regisoc
Copy link
Contributor Author

regisoc commented Dec 17, 2025

@driusan re-asking for final review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

26.0.0-bugs Issues that were raised during the release testing for 26.0.0 Area: API PR or issue related to the API Area: Instruments PR or issue related instruments Category: Bug PR or issue that aims to report or fix a bug Language: PHP PR or issue that update PHP code Module: api PR or issue related to api module Priority: High PR or issue should be prioritised over others for review and testing Project: HBCD Issue or PR related to the HBCD project RaisinBread PR or issue introducing/requiring improvements to the Raidinbread dataset

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants