Closed
Bug 412850
Opened 16 years ago
Closed 16 years ago
Rename the webservice method Bug.get_bugs() to simple Bug.get()
Categories
(Bugzilla :: WebService, enhancement)
Bugzilla
WebService
Tracking
()
RESOLVED
FIXED
Bugzilla 3.2
People
(Reporter: dkl, Assigned: dkl)
Details
Attachments
(1 file, 2 obsolete files)
2.11 KB,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
I suggest that a consistent naming scheme is adopted for the the WebService methods. For example, Bug.get_bugs() is redundant in that it contains the bug work twice. Making it Bug.get() is easier to understand and less to type. The method would still accepts a single bug id or alias or list of bug id's and aliases. This would be more in line with the current method Bug.create() and the soon to be added method Bug.update(). And then extended further into Product.get(), Product.create(), Product.update(), User.get(), User.create() and so on. Thoughts? Dave
Comment 1•16 years ago
|
||
Yes, agreed completely. However, leave around the old names as aliases, so that we don't break existing WebService users. BEGIN { *get_bugs = \&get }
Assignee | ||
Comment 2•16 years ago
|
||
Attachment #297616 -
Flags: review?
Updated•16 years ago
|
Attachment #297616 -
Flags: review? → review?(bugzilla-mozilla)
Comment 3•16 years ago
|
||
Comment on attachment 297616 [details] [diff] [review] Patch to rename Bug.get_bugs() to Bug.get() in Bugzilla/WebServices/Bug.pm and contrib/bz_webservice_demo.pl >Index: contrib/bz_webservice_demo.pl That still has an outdated reference: > Call C<Bug.get_bug> with the ID of the bug you want to know more of. Change that for r+.
Attachment #297616 -
Flags: review?(bugzilla-mozilla) → review-
Assignee | ||
Comment 4•16 years ago
|
||
Thanks. I did a search for 'get_bugs' in the bz_webservice_demo.pl file so I missed that one since it was mispelled ;) Attaching updated patch.
Assignee | ||
Updated•16 years ago
|
Attachment #297672 -
Flags: review?(bugzilla-mozilla)
Comment 5•16 years ago
|
||
Comment on attachment 297672 [details] [diff] [review] Patch to rename Bug.get_bugs() to Bug.get() (v2) The docs should note that applications that want to be compatible with Bugzilla 3.0 should call it as get_bugs.
Attachment #297672 -
Flags: review?(bugzilla-mozilla) → review-
Assignee | ||
Comment 6•16 years ago
|
||
Added note to documentation stating that get_bugs could also be used for compatibility with 3.0 API.
Attachment #297672 -
Attachment is obsolete: true
Attachment #297687 -
Flags: review?(bugzilla-mozilla)
Assignee | ||
Updated•16 years ago
|
Attachment #297687 -
Flags: review?(mkanat)
Comment 7•16 years ago
|
||
Comment on attachment 297687 [details] [diff] [review] Patch to rename Bug.get_bugs() to Bug.get() (v3) Looks good to me. Checkin fix: "with the Bugzilla"
Attachment #297687 -
Flags: review?(mkanat)
Attachment #297687 -
Flags: review?(bugzilla-mozilla)
Attachment #297687 -
Flags: review+
Updated•16 years ago
|
Severity: normal → enhancement
Flags: approval+
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 3.2
Comment 8•16 years ago
|
||
(In reply to comment #1) > BEGIN { *get_bugs = \&get } What's the advantage of doing that in a BEGIN block? Why not just *get_bugs = \&get; ?
Comment 9•16 years ago
|
||
It makes the subroutine resolve at compile time if you need that for some reason. I suspect it may have other advantages as well (though they're slipping my mind at the moment, I've had to do it before).
Assignee | ||
Comment 10•16 years ago
|
||
Checking in Bugzilla/WebService/Bug.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm,v <-- Bug.pm new revision: 1.10; previous revision: 1.9 done Checking in contrib/bz_webservice_demo.pl; /cvsroot/mozilla/webtools/bugzilla/contrib/bz_webservice_demo.pl,v <-- bz_webservice_demo.pl new revision: 1.13; previous revision: 1.12 done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 11•16 years ago
|
||
Shouldn't we apply this patch to 3.0 as well so that we can use Bug.get() independently on both 3.0 and 3.2? Else you have to keep in mind that Bug.get() won't work on 3.0.
Comment 12•16 years ago
|
||
(In reply to comment #11) > Shouldn't we apply this patch to 3.0 as well so that we can use Bug.get() > independently on both 3.0 and 3.2? Else you have to keep in mind that Bug.get() > won't work on 3.0. No, it's better to know consistently that get() doesn't work on any 3.0 version, and not have to check exactly which 3.0.x you're running to know for certain.
You need to log in
before you can comment on or make changes to this bug.
Description
•