Skip to content

Include alias in include_fields (closes #170) - #186

Merged
crobinso merged 5 commits into
python-bugzilla:mainfrom
crazyscientist:170-get-bug-by-alias
Feb 6, 2024
Merged

crobinso merged 5 commits into
python-bugzilla:mainfrom
crazyscientist:170-get-bug-by-alias

Conversation

@crazyscientist

Copy link
Copy Markdown
Contributor

Include alias in include_fields, when the parameter for getbug is an alias (closes #170)

Because the _getbugs method tries to return bug data in the same order as IDs and aliases are provided, the alias needs to be explicitly added to include_fields.

@codecov

codecov Bot commented Sep 19, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (182e0b0) 100.00% compared to head (abd8427) 100.00%.

❗ Current head abd8427 differs from pull request most recent head da30859. Consider uploading reports for the commit da30859 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #186   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines         2190      2200   +10     
=========================================
+ Hits          2190      2200   +10     
Files Coverage Δ
bugzilla/base.py 100.00% <100.00%> (ø)

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

@crazyscientist

Copy link
Copy Markdown
Contributor Author

@crobinso or should I have just removed the code for sorting in _getbugs()?

@crobinso

Copy link
Copy Markdown
Member

This needs to be rebased now, there's conflicts.

IMO we should not add the non-list include_fields safety checks. There's other parts in the code like _process_include_fields that implicitly expect a list.

@crobinso or should I have just removed the code for sorting in _getbugs()?

No, IIRC there were explicit complaints when I tried to remove that in the past :(

…is an alias (closes python-bugzilla#170)

Because the `_getbugs` method tries to return bug data in the same order as IDs and aliases are
provided, the `alias` needs to be explicitly added to `include_fields`.
@crazyscientist

Copy link
Copy Markdown
Contributor Author

IMO we should not add the non-list include_fields safety checks

OK, I've removed that part.

@crobinso
crobinso merged commit 0955d2e into python-bugzilla:main Feb 6, 2024
@crazyscientist
crazyscientist deleted the 170-get-bug-by-alias branch October 16, 2024 14:17
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.

include_fields in bz.getbug with string-named bug instead of id results in IndexError

2 participants