Repository navigation
Conversation
…ts (attachments, add_attachment, update_attachment)
…orrect the legacy behaviour comment
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
attachments,add_attachmentandupdate_attachmentfromBugzilla::WebService::Buginto a nativeBugzilla::API::V1::BugAttachmentMojo controller, following the earlier migrations in this series.Second of the four sub-bugs of 2081819. The rest of the legacy Bug module stays until 2081860.
Changes
Bugzilla/API/V1/BugAttachment.pm, with the same responses as the legacy endpoints:GET/POST /rest/bug/<id>/attachmentGET/PUT /rest/bug/attachment/<attachment_id>OPTIONSon both (GET, POST/GET, PUT)Bugzilla/WebService/Bug.pm, and their routes fromResources/Bug.pm. The attachment/flag/user hash helpers stay there for buggetuntil 2081860.datais base64-decoded on input and encoded on output.idsmust be a list of plain values (invalid_paramsotherwise).idsfrom the body or query string win over the path.qa/t/rest_bug_update_attachment.t(PUT had almost no coverage).t/app-cgi-request-limit.t: the legacyrest.cgiCORS check now usesPOST /rest/bug, since the attachment path is native.Behaviour changes:
update_attachmentdrops request-level keys (api_key,Bugzilla_*,include_fields…) beforeset_all(). Anapi_keyin the query string no longer causes anunknown_methoderror; unknown fields still do.idsin the query string of a POST/PUT is now used as a list. The legacy server kept only the first value.disable_bug_updateson,add_attachmentreturns a JSON error. The legacy REST server returned the HTML "updates disabled" pageNot carried over: ETag/304 and JSONP
callback=, as in the other migrated V1 modules.Merge order: please merge after #2785 (2081849). Both remove code from
Bugzilla/WebService/Bug.pmandResources/Bug.pm; this branch will be updated with master once #2785 has landed.Test plan
GET /rest/bug/<id>/attachmentwithinclude_fields=_all&exclude_fields=data, logged out and logged inGET /rest/bug/attachment/<id>?include_fields=data, and?attachment_ids=<other>returns bothauth_failurePOST /rest/bug/<id>/attachmentwith base64data, expecting 201PUT /rest/bug/attachment/<id>changingsummary/is_obsoletewith acommentPUTwithidsin the body updates those ids, not the path onePUTwith anidshash of conditions, expectinginvalid_paramsOPTIONSon both pathsReferences