Closed
Bug 622203
Opened 14 years ago
Closed 14 years ago
Allow filing closed bugs via the WebService
Categories
(Bugzilla :: WebService, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.4
People
(Reporter: mkanat, Assigned: mkanat)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 5 obsolete files)
12.11 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
This is simpler than bug 399483--we just have to fix the backend and update the POD. Basically this just involves allowing Bugzilla::Bug to use the validators when $invocant is a class.
Assignee | ||
Comment 1•14 years ago
|
||
This is a bit more work than I anticipated, because there are lots of things that _check_resolution depends on.
I've decided that, for now, I'm not going to make filing new bugs as DUPLICATE work. But all other resolutions and _check_resolution stuff will still work.
Assignee: webservice → mkanat
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•14 years ago
|
||
All right, here's a patch that allows filing closed bugs via the WebService, but not yet via the enter_bug UI. (Note that enter_bug already filters out closed statuses in its code, so we don't have to worry about modifying it.)
I had to update the way that _check_dependencies works, also, so that "blocked" and "dependson" could go into VALIDATOR_DEPENDENCIES (since they now have to be checked before "resolution" when a bug is filed, due to noresolveonopenblockers).
Attachment #500432 -
Attachment is obsolete: true
Attachment #500494 -
Flags: review?(LpSolit)
Assignee | ||
Comment 3•14 years ago
|
||
v1 broke filing new bugs with a dependson value, and also had a bad error message for noresolveonopenblockers for new bugs.
Attachment #500494 -
Attachment is obsolete: true
Attachment #500496 -
Flags: review?(LpSolit)
Attachment #500494 -
Flags: review?(LpSolit)
Assignee | ||
Comment 4•14 years ago
|
||
I removed an incorrect comment that I had added, about commentonchange_resolution.
Attachment #500496 -
Attachment is obsolete: true
Attachment #500498 -
Flags: review?(LpSolit)
Attachment #500496 -
Flags: review?(LpSolit)
Assignee | ||
Updated•14 years ago
|
Attachment #500498 -
Flags: review?(LpSolit) → review?(dkl)
Assignee | ||
Comment 5•14 years ago
|
||
dkl: Any hope of getting a review on this? It's been waiting a LONG time.
Comment 6•14 years ago
|
||
Comment on attachment 500498 [details] [diff] [review]
v2.1
Review of attachment 500498 [details] [diff] [review]:
-----------------------------------------------------------------
Overall my testing has been positive with this patch except for the bug I found which I commented on below.
::: Bugzilla/Bug.pm
@@ +1450,5 @@
> + my ($invocant, $new_value, $field, $params) = @_;
> +
> + my $has_comment = ref($invocant) ? $invocant->{added_comments}
> + : (defined $params->{comment}
> + and $params->{comment} ne '');
$params->{'comment'} is a hash by this point with an empty value for 'thetext' if the user omitted a comment on Bug.create. So this never throws error.
Attachment #500498 -
Flags: review?(dkl) → review-
Assignee | ||
Updated•14 years ago
|
Target Milestone: Bugzilla 4.2 → Bugzilla 5.0
Assignee | ||
Comment 7•14 years ago
|
||
Thanks for the review, and thanks for catching that bug! I've updated the code exactly as you suggested.
Attachment #500498 -
Attachment is obsolete: true
Attachment #535777 -
Flags: review?(dkl)
Comment 8•14 years ago
|
||
Comment on attachment 535777 [details] [diff] [review]
v3
Review of attachment 535777 [details] [diff] [review]:
-----------------------------------------------------------------
In addition to my comment below, user-error.html.tmpl in error == 'comment_required', the template is
looking for old.name and new.name. _check_commenton is passing the actual values and not an object so
when the error displays, you get blank values.
dkl
::: Bugzilla/Bug.pm
@@ +1470,5 @@
> +
> + if ($is_changing && !$has_comment) {
> + my $old_value = ref($invocant) ? $invocant->$field : undef;
> + ThrowUserError('comment_required',
> + { old => $old_value, new => $new_value });
When closing an existing bug report that is currently open, to a closed state with resolution, you get the wrong error message.
When closing a bug, old_value will be empty and new_value will not be empty. So the error generated by user-error.html.tmpl will be
"You have to specify a description for this bug"
which is what should happend for a new bug, not an existing one. Instead something like
"You have to specify a comment when changing the status to RESOLVED"
The template is looking for [% IF old && new %] which is why the wrong error is occurring.
Attachment #535777 -
Flags: review?(dkl) → review-
Assignee | ||
Comment 9•14 years ago
|
||
Ah, good point. Okay, here's my attempt to address that issue. My solution isn't perfect; let me know if you have any thoughts or suggestions.
Attachment #535777 -
Attachment is obsolete: true
Attachment #537672 -
Flags: review?(dkl)
Comment 10•14 years ago
|
||
Comment on attachment 537672 [details] [diff] [review]
v4
Review of attachment 537672 [details] [diff] [review]:
-----------------------------------------------------------------
I think the solution you came up with is acceptable and works as expected. r=dkl
Attachment #537672 -
Flags: review?(dkl) → review+
Updated•14 years ago
|
Flags: approval?
![]() |
||
Comment 11•14 years ago
|
||
Comment on attachment 537672 [details] [diff] [review]
v4
>=== modified file 'Bugzilla/WebService/Bug.pm'
>+=item The ability to file new bugs with a C<resolution> was added in
>+Bugzilla B<4.2>.
4.2 -> 5.0 (or 4.4 for now).
Assignee | ||
Comment 12•14 years ago
|
||
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified editworkflow.cgi
modified Bugzilla/Bug.pm
modified Bugzilla/WebService/Bug.pm
modified template/en/default/admin/workflow/edit.html.tmpl
modified template/en/default/global/user-error.html.tmpl
Committed revision 7905
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: approval? → approval+
Resolution: --- → FIXED
![]() |
||
Updated•13 years ago
|
Flags: testcase?
You need to log in
before you can comment on or make changes to this bug.
Description
•