Closed Bug 424079 Opened 16 years ago Closed 16 years ago

Ability to get history of bug activity in the WebService (Bug.history)

Categories

(Bugzilla :: WebService, enhancement)

3.1.3
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.4

People

(Reporter: nelhawar, Assigned: nelhawar)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 5 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20070209 Fedora/1.5.0.9-3.fc6 Firefox/1.5.0.9 pango-text
Build Identifier: 

Need a new function to get bug activity in the webservice interface, Bugzilla::WebService::Bug::get_activity()

Reproducible: Always
Attachment #310734 - Flags: review?(mkanat)
Attachment #310734 - Flags: review?(LpSolit)
Assignee: webservice → nelhawar
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → Bugzilla 4.0
Version: unspecified → 3.1.3
Comment on attachment 310734 [details] [diff] [review]
Bugzilla::WebService::Bug::get_activity + POD

Looks good, works fine. r=LpSolit
Attachment #310734 - Flags: review?(LpSolit) → review+
Status: NEW → ASSIGNED
Flags: approval?
Noura, Frederic, once this approved I can go ahead and check this in for you. Who needs to approve, Max?

Thanks
Dave
Comment on attachment 310734 [details] [diff] [review]
Bugzilla::WebService::Bug::get_activity + POD

>+        ( $item{operations}, $item{incomplete_data} ) = Bugzilla::Bug::GetBugActivity($bug_id);

  incomplete_data does not need to be part of this API.

>+        my $bug = new Bugzilla::Bug($bug_id);
>+        if (Bugzilla->params->{'usebugaliases'}) {
>+            $item{alias} = type('string')->value($bug->alias);
>+        }

  You don't need to include the bug's alias as part of get_activity, that makes no sense.

  You didn't set the types or handle any of the names from GetBugActivity. I'm going to attach a file that has code that does that (that I wrote for a contract).

>+C<array> An array of hashes with each hash containing C<when>, which is a 
>+string that holds the date the bug activity/change happened, C<who> which is
>+a string that holds the login name for the person who performed the change,
>+and C<changes> which is an array of hashes that holds the change details.

  You need to describe the changes hash.

  This function also needs a "since" argument, but we can add that in another bug (since it requires parsing an input datetime).
Attachment #310734 - Flags: review?(mkanat) → review-
Flags: approval?
Attached patch Set types and fix {changes} (obsolete) — Splinter Review
This is the code necessary to fix up the returned changes to be an acceptable API.
Blocks: 432910
Could you attach your last patch as a real one? It's a plain text file. No idea how to apply it (and where).
(In reply to comment #6)
> Could you attach your last patch as a real one? It's a plain text file. No idea
> how to apply it (and where).

  That's OK, Noura will know. If she doesn't, she can ask me.
> >+        if (Bugzilla->params->{'usebugaliases'}) {
> >+            $item{alias} = type('string')->value($bug->alias);
> >+        }
> 
>   You don't need to include the bug's alias as part of get_activity, that makes
> no sense.

I thought adding the bug alias is a good idea in case people will pass a mixture of bugs ids and aliases then they would know the activities they got was for which value they passed wether bug id or bug alias. what do you think?

Noura   
(In reply to comment #8)
> I thought adding the bug alias is a good idea in case people will pass a
> mixture of bugs ids and aliases then they would know the activities they got
> was for which value they passed wether bug id or bug alias. what do you think?

  Oh, yes, that makes sense! :-) Add a comment that explains that?
New patch with Max suggestions. Please review when you can.

Thanks,
Noura
Attachment #310734 - Attachment is obsolete: true
Attachment #326168 - Flags: review?(mkanat)
Attachment #326168 - Flags: review?(LpSolit)
Comment on attachment 326168 [details] [diff] [review]
v2 for WebService function Bug.get_activity()

>Index: Bugzilla/WebService/Bug.pm
>+        $item{history} = [];

  Instead I think we should return a hash, where bug ids point to the history. I think that would be a lot easier for callers.

>+=item alias
>+
>+C<string> The alias of this bug. If there is no alias or aliases are 
>+disabled in this Bugzilla, this will be an empty string.

  Actually, it should be undef, not an empty string.

>+C<array> An array of hashes which contain the changes that happend to the bug

  Typo: happened


  I think attachment_id is missing from the docs on the return value.

  Otherwise this all looks pretty good!
Attachment #326168 - Flags: review?(mkanat)
Attachment #326168 - Flags: review?(LpSolit)
Attachment #326168 - Flags: review-
Thanks for the review Max, here is another patch with the modifications.

Noura
Attachment #326168 - Attachment is obsolete: true
Attachment #326224 - Flags: review?(mkanat)
Attachment #326224 - Attachment is obsolete: true
Attachment #326224 - Flags: review?(mkanat)
Please ignore previous patch. 

Noura
Attachment #326226 - Flags: review?(mkanat)
Comment on attachment 326226 [details] [diff] [review]
v3 for WebService Function Bug.get_activity 

This needs fixes to the POD related to bugid and attachment_id, which I will do on checkin.

Otherwise it looks good! :-)
Attachment #326226 - Flags: review?(mkanat) → review+
I fixed the POD, and I also renamed the method to get_history, since we're calling it "History" nowadays and I think that might be a clearer name for people using an API who don't know much about Bugzilla.
Attachment #326063 - Attachment is obsolete: true
Attachment #326226 - Attachment is obsolete: true
Attachment #326229 - Flags: review+
Checking in Bugzilla/WebService/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm,v  <--  Bug.pm
new revision: 1.12; previous revision: 1.11
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: approval+
Keywords: relnote
Target Milestone: Bugzilla 4.0 → Bugzilla 3.4
Flags: testcase?
Summary: Ability to get history of bug activity in the WebService → Ability to get history of bug activity in the WebService (Bug.history)
Added to the release notes for Bugzilla 3.4 in bug 494037.
Keywords: relnote
Actually, apparently I missed adding this one method to the release notes.
Keywords: relnote
Added to the release notes in bug 506500.
Keywords: relnote
Flags: testcase? → testcase+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: