Repository navigation
Conversation
…(comments, add_comment, render_comment, reactions, tags)
dklawren
requested changes
Oct 17, 2026
|
|
||
| # A bug id is a single value. A hash here would reach Bugzilla::Bug->check() | ||
| # as a set of object conditions. (A comment_id hash fails detaint_natural.) | ||
| return (undef, 'invalid_params') if ref $params->{id}; |
Collaborator
There was a problem hiding this comment.
pass a type_error with invalid_params (e.g. "id must be a single value") so the message isn't cut off
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the comment methods of
Bugzilla::WebService::Bug(comments,add_comment,render_comment,get_comment_reactions,update_comment_reactions,update_comment_tags,search_comment_tags) into a nativeBugzilla::API::V1::BugCommentMojo controller, following the earlier migrations in this series.Third of the four sub-bugs of 2081819. The rest of the legacy Bug module stays until 2081860.
Changes
Bugzilla/API/V1/BugComment.pm, with the same responses as the legacy endpoints:GET/POST /rest/bug/<id>/commentGET /rest/bug/comment/<comment_id>GET/PUT /rest/bug/comment/<comment_id>/reactionsPUT /rest/bug/comment/<comment_id>/tagsGET /rest/bug/comment/tags/<query>POST /rest/bug/comment/renderOPTIONSon each of themBugzilla/WebService/Bug.pm, and their routes fromResources/Bug.pm. The comment helpers stay there for thecommentsfield of bugget/searchuntil 2081860.run_last_changescalled the legacycomments()through inheritance; it now loads the comment directly (same output).new_sinceconverted to the database timezone,skip_private,_collapsed_comments, edit counts.qa/t/rest_bug_comment_misc.t(render, tag search, query parameters, OPTIONS).Behaviour changes
idsent as an object toadd_commentorrender_commentis rejected withinvalid_params, instead of reachingBugzilla::Bug->check()as object conditions.disable_bug_updateson,add_commentreturns a JSON error. The legacy REST server returned the HTML "updates disabled" page.add,removeandcomment_tagssent once in the query string or a form body are treated as a list (they used to cause a 500).Not carried over: ETag/304 and JSONP
callback=, as in the other migrated V1 modules.Merge order: please merge after #2785 and #2786. All three remove code from
Bugzilla/WebService/Bug.pmandResources/Bug.pm; this branch will be updated with master once they have landed.Test plan
GET /rest/bug/<id>/commentlogged out and logged in, withnew_since,skip_privateandinclude_fields=_default,_collapsed_commentsGET /rest/bug/comment/<id>?comment_ids=<other>returns bothPOST /rest/bug/<id>/commentwithcomment_tags, expecting 201POST /rest/bug/<id>/commentwith an objectid, expectinginvalid_paramsPUT/GET /rest/bug/comment/<id>/reactionsPUT /rest/bug/comment/<id>/tags, thenGET /rest/bug/comment/tags/<query>POST /rest/bug/comment/renderOPTIONSon each pathReferences