stable

Clone or download

Read-only

feat: Make checks before editing inline comment

How to test: - Enable the feature flag: `tuleap config-set feature_flag_allow_pull_requests_comments_edition 1` - Use the API explorer to make a PATCH request to /pull_request_inline_comments/{id} route. - When you give an invalid or non existing id, you should get error 404 Not found - When you give the id of an old Text format inline comment, you should get error 403 Forbidden - When you give the id of a comment from another user, you should get error 403 Forbidden - When you give a valid id, but current user is not allowed to read the destination git repository or the project of the pull request on which the comment is made, you should get error 404 Not found - Otherwise, you should get status code 200 with no return payload. - When the feature flag is disabled, the REST route always returns error code 501 Notes: - In order to split the work, only checks are done for now. The actual update will come in a later contribution. Same for the return payload. part of story #32316 Update comments Change-Id: Ie413b671f51b01ea2c7293213ea2f3991fd3d9dd

Modified Files

Name
A plugins/pullrequest/include/PullRequest/InlineComment/InlineCommentNotFoundFault.php +36 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/ResourcesInjector.class.php +3 −1 Go to diff View file
A plugins/pullrequest/include/PullRequest/REST/v1/Comment/InlineCommentPATCHRepresentation.php +39 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/REST/v1/Comment/PATCHInlineCommentHandler.php +81 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/FaultMapper.php +2 −1 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PullRequestCommentsResource.php +1 −1 Go to diff View file
A plugins/pullrequest/include/PullRequest/REST/v1/PullRequestInlineCommentsResource.php +93 −0 Go to diff View file
M plugins/pullrequest/site-content/fr_FR/LC_MESSAGES/tuleap-pullrequest.po +8 −4 Go to diff View file
M plugins/pullrequest/site-content/pt_BR/LC_MESSAGES/tuleap-pullrequest.po +4 −0 Go to diff View file
M plugins/pullrequest/tests/unit/REST/FaultMapperTest.php +2 −0 Go to diff View file
A plugins/pullrequest/tests/unit/REST/v1/Comment/PATCHInlineCommentHandlerTest.php +150 −0 Go to diff View file