Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@mrbahrani
Copy link
Contributor

Using the api, I used to think the only way to retrieve the comments is to go through a Bugzilla instance. Later, I figured out the the Bug objects have the method get_attachments and I was amazed that there is no get_comments. Digging into the code I realized the method has been named getcomments. I have changed all the occurrences of getcomments method of the Bug class to get_comment

@codecov
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (8f77896) to head (1062e85).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #226   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines         2211      2212    +1     
=========================================
+ Hits          2211      2212    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mrbahrani
Copy link
Contributor Author

I also figured we'd better keep getcomments interface as well for the sake of backwards compatibility in a few future versions.

@mrbahrani
Copy link
Contributor Author

Finally all the checks passed :)

@crobinso
Copy link
Member

Thanks for the suggestion, and I agree get_comments is the better naming at this point, but the deprecation stuff is maintenance pain for not a lot of gain IMO. Can we just get_comments = getcomments + unittest coverage and be done with it?

@mrbahrani
Copy link
Contributor Author

Sorry. I got a little confused reading your message. So, you say we keep the change and modify the unit tests or to defer the change to a better time? (I'm fine either way. I'm already using getcomments without much trouble in my code. Just that it took me a while to figure out this is the neat way. :))

@crazyscientist
Copy link
Contributor

@mrbahrani If I understand @crobinso correctly, he is proposing the following:

  • Renaming the existing method (as you already did).
  • Add a getcomments attribute to the class and set its value to the method object self.get_comments (so that both method are identical).
  • Don't bother with creating deprecation warnings or examples for the deprecated method.

Does that clarify things?

bugzilla/bug.py Outdated Show resolved Hide resolved
tests/test_rw_functional.py Outdated Show resolved Hide resolved
mrbahrani and others added 2 commits October 29, 2024 09:17
Copy link
Contributor

@crazyscientist crazyscientist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution.

@crazyscientist crazyscientist merged commit adf33b6 into python-bugzilla:main Oct 30, 2024
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

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.