Add non negative validation to update time estimate rest api endpoint
requested to merge gitlab-community/gitlab:md-rest-api-time-tracking-endpoint-validation into master
What does this MR do and why?
For #390579 (closed)
Fix time estimate REST API to validate estimate is not negative
Screenshots or screen recordings
Invalid | Negative | Zero | Valid | |
---|---|---|---|---|
MR | ||||
Issue |
How to set up and validate locally
- Run your gdk server locally and login
- Download/open your favorite api testing service to verify the new
time_estimate
update validations work properly. I used Postman in these examples. - On your gdk server, click your profile picture > Preferences > Access Tokens and create a new token with the
api
scope - Copy the token then navigate back to Postman and paste it as a bearer token under the 'Authorization' tab of a new request
- Find an issue and merge request in your gdk instance and make note of the project id and issue/MR ids. Use those to construct your endpoint as shown in the examples below.
- Test updating the time_estimate to a negative number, zero, a valid number, and invalid entry, for the issue and MR you selected:
http://127.0.0.1:3000/api/v4/projects/7/merge_requests/5/time_estimate?duration=-2
http://127.0.0.1:3000/api/v4/projects/7/merge_requests/5/time_estimate?duration=0
http://127.0.0.1:3000/api/v4/projects/7/merge_requests/5/time_estimate?duration=1h
http://127.0.0.1:3000/api/v4/projects/7/merge_requests/5/time_estimate?duration=abc
- Ensure the error message shows where appropriate. The responses should be as shown in the screenshots of the previous section.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Missy Davies