Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to retrieve comments from bugs #6

Closed
vortechs2000 opened this issue Sep 17, 2015 · 6 comments
Closed

No way to retrieve comments from bugs #6

vortechs2000 opened this issue Sep 17, 2015 · 6 comments

Comments

@vortechs2000
Copy link
Contributor

From what I can see, the current code doesn't allow the retrieval of comments based on bug number. It should be as simple as adding a 'self._proxy.Bug.comments({'ids': bug_ids})' type of call into the base and referencing that from with the Bug class.

Any reason not to do this? I have a POC that seems to work that I could submit.

@ralphbean
Copy link
Contributor

I think you can do this as things stand now:

>>> import bugzilla
>>> bz = bugzilla.Bugzilla('https://bugzilla.redhat.com')
>>> bug = bz.getbug(1234567)
>>> bug.comments
[{'count': 0, 'author': 'jonathan.underwood@gmail.com', 'text': 'The Emacs add-on packaging guidelines no longer stipulate that packages which also bundle support for Emacs should split out 
those Emacs files into separate sub-packages. This package should instead ship those files with the main package which should also Require emacs-filesystem. See https://fedoraproject.org/wik
i/Packaging:Emacs for more detail.', 'creator': 'jonathan.underwood@gmail.com', 'creation_time': <DateTime '20150622T17:53:39' at 7fd40edfbbd8>, 'bug_id': 1234567, 'creator_id': 163554, 'tim
e': <DateTime '20150622T17:53:39' at 7fd40edfb950>, 'id': 8360743, 'is_private': False}, {'count': 1, 'author': 'jkurik@redhat.com', 'text': "This bug appears to have been reported against '
rawhide' during the Fedora 23 development cycle.\nChanging version to '23'.\n\n(As we did not run this process for some time, it could affect also pre-Fedora 23 development\ncycle bugs. We a
re very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)\n\nMore information and reason for this action is here:\nhttps://fedoraproject.org/wiki/BugZappers/House
Keeping/Fedora23", 'creator': 'jkurik@redhat.com', 'creation_time': <DateTime '20150715T13:56:19' at 7fd40edfbc68>, 'bug_id': 1234567, 'creator_id': 352756, 'time': <DateTime '20150715T13:56
:19' at 7fd40edfba28>, 'id': 8443503, 'is_private': False}]

@vortechs2000
Copy link
Contributor Author

I tried this, and it didn't work for our BZ 4.0.3 or 5.0 installation. There is no comments attribute on my bug object.

I had to do this to be able to retrieve them:
vortechs2000@daaea08

@vortechs2000
Copy link
Contributor Author

This is the traceback I get:

>>> b = bz.getbug(53334)
>>> b.comments
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python2.7/dist-packages/bugzilla/bug.py", line 106, in __getattr__
      raise AttributeError("Bug object has no attribute '%s'" % name) 
AttributeError: Bug object has no attribute 'comments'

@crobinso
Copy link
Member

yeah the "comments" as a return for getbug/query is a bugzilla.redhat.com extension AFAIK. so if you have a patch for comments(), send it over and we can find a way to make it work with rh and non-rh bugzilla

@vortechs2000
Copy link
Contributor Author

Opened pull request #7 as a potential fix for this

@crobinso
Copy link
Member

Thanks, I've pushed your patch now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants