RFE: Number of comments by <LP ID>

Bug #89762 reported by Emilio Pozuelo Monfort
2
Affects Status Importance Assigned to Milestone
Bug Helper
Fix Released
Wishlist
Markus Korn

Bug Description

I would love to see this option. For example:

$ bughelper --comments=65342
5

Of course, '5' is the number of comments the bug has.

I have seen Bug #79133, though I think this isn't possible with it.

Best regards
Emilio

Revision history for this message
Pappan (ppadman) wrote :

Emilio,

Thanks for your report.

The above is possible using bugnumbers

$ bugnumbers -l https://launchpad.net/bughelper/+bug/65342 --count

Will this suit your needs ?

Revision history for this message
Pappan (ppadman) wrote :

Sorry copy/paster error in the URL in the last message :)

You can use like this:

$ bugnumbers -l https://launchpad.net/ubuntu/+bug/65342 --count

Revision history for this message
Daniel Holbach (dholbach) wrote :
Changed in bughelper:
status: Unconfirmed → Fix Released
Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

That works, but it would be fine to have the ability of show the bugs in a known bug, as of this:
./bugnumbers --bug=89762 --count
3
or

./bugnumbers -l https://launchpad.net/bugs/89762
3

Is this possible?

Thanks
Emilio

Revision history for this message
Markus Korn (thekorn) wrote :

My opinion on that:
for now the workaround like
./bugnumbers -l https://launchpad.net/ubuntu/+bug/65342 --count
should solve this.

In the future (r0.2?) we should think about a tool like "./buginfo" which gives us the information provided by the Bug-class for one special bug.
We also should move the "count-comments"-thing from the BugList-class to the Bug-class.

I understand "./bugnumbers" as an interface for the BugList-class with a list of Bugs as output.

Markus

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

Hello

Markus, your workaround doesn't work for me:
emilio@kiko:~/deb/bughelper/bughelper.main$ ./bugnumbers -l https://launchpad.net/ubuntu/+bug/65342 --count
No bugs found.

With bughelper.main branch up-to-date.

Any idea?

Revision history for this message
Markus Korn (thekorn) wrote :

Hello Emilio,
I'm very sorry, I should better start thinking before writing a comment! At the moment we are not able to get information on one special bug, so no workaround, sorry.

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

No problem ;)

I'm opening the report again, because what I'm asking for is not possible atm.

Changed in bughelper:
status: Fix Released → Confirmed
Revision history for this message
Markus Korn (thekorn) wrote :

I added a program called "bugtool" to my branch https://code.launchpad.net/~thekorn/+branch/bughelper/bughelper.r01

Example usage:
markus@thekorn:~/prog/bugs/bughelper.r01$ ./bugtool --bugnr 88102 --comments
88102
Comments: 8
[('1', 'hggdh2', '2007-02-26 20:37:51 UTC'), ('2', 'dfarning', '2007-02-26 22:05:20 UTC'), ('3', 'dfarning', '2007-02-26 22:06:30 UTC'), ('4', 'dfarning', '2007-02-26 22:07:20 UTC'), ('5', 'ppadman', '2007-02-27 04:46:20 UTC'), ('6', 'dfarning', '2007-02-27 21:51:29 UTC'), ('7', 'dholbach', '2007-03-05 15:28:09 UTC'), ('8', 'dfarning', '2007-03-05 16:41:18 UTC')]

I do not know if that is what you expected.
Needs a lot of testing!

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

Hey Markus
That's perfect!

That's what I need: in one hand, the number of comments. In the other hand, the author and the date of them. :)

Thanks a lot!
And I'm going to test it right now ;)

Changed in bughelper:
importance: Undecided → Wishlist
Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

Hi Markus

I've tested it, and it works really fine. Good work :)

But I have some questions:

Is it possible to output just the numbers of comments? (for a script).
For example:
bugtool --bugnr 89762 --number_of_comments (or something else)
10

And, also, is it possible to print just one comment, or even, a part of the comment (such as the author)?
For example:
bugtool --bugnr 89762 --comments=1
('1', 'ppadman', '2007-03-05 06:21:47 UTC')

bugtool --bugnr 89762 --comments=1 --author
ppadman

Thanks
Emilio

Revision history for this message
Markus Korn (thekorn) wrote :

Hi Emelio,
thanks for your suggestions. I added some options to my branch (r116)
Example usage:
* markus@thekorn:~/prog/bugs/bughelper.r01$ ./bugtool --bugnr 89762 --countcomments
11
* markus@thekorn:~/prog/bugs/bughelper.r01$ ./bugtool --bugnr 89762 --comment 1
('1', 'ppadman', '2007-03-05 06:21:47 UTC')
* markus@thekorn:~/prog/bugs/bughelper.r01$ ./bugtool --bugnr 89762 --comment 1 --author
ppadman

You can add the "-v" option to get a list of available comment-numbers if a comment no exist.
* markus@thekorn:~/prog/bugs/bughelper.r01$ ./bugtool --bugnr 89762 --comment 100 -v
available comments: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

Wow!!

It's perfect :)

Another suggestion ;)

Is it possible a --date (like --author).

For example:
./bugtool --bugnr 89762 --comment 1 --date
2007-03-05 06:21:47 UTC

Thanks for your nice work.
Emilio

Changed in bughelper:
assignee: nobody → thekorn
status: Confirmed → In Progress
Revision history for this message
Markus Korn (thekorn) wrote :

Added --date option to my branch (r117)

Markus

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

Works perfectly!

I was thinking also in "--comments last" to put the last comment, but it can easily done executing "--countcomments" and assinging the output to a variable, "lastcomment", and then execute "--comment lastcomment"

Looks finished to me.
Thanks a lot Markus.

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

Markus, you said we could name this tool as buginfo. What about changing it? (it looks more appropiate).

Everybody else: what about mergind this into bughelper.main?

Thanks
Emilio

Revision history for this message
Markus Korn (thekorn) wrote :

I renamed "bugtool" into "buginfo".
Also added a "--lastcomment" option to "buginfo".
Example usage:
markus@thekorn:~/prog/bugs/bughelper.r01$ ./buginfo --bugnr 89762 --lastcomment --author --date
pochu
2007-03-07 22:23:29 UTC

Markus

Revision history for this message
Emilio Pozuelo Monfort (pochu) wrote :

Can anybody review it and merge it into bughelper.main?

Seems ok for me (and of course, works fine).

Changed in bughelper:
status: In Progress → Fix Committed
Revision history for this message
Markus Korn (thekorn) wrote :

patch against r109 of bughelper.main to add buginfo withe the option discussed in this bugreport

Revision history for this message
Daniel Holbach (dholbach) wrote :

------------------------------------------------------------
revno: 110
committer: Daniel Holbach <email address hidden>
branch nick: bughelper.main
timestamp: Thu 2007-03-15 10:41:33 +0100
message:
  merged Markus Korn's patch to fix #89762
------------------------------------------------------------

Changed in bughelper:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.