Bug 1614315 - Traceback when managing case bugs of JIRA type
Summary: Traceback when managing case bugs of JIRA type
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: python-nitrate
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Petr Šplíchal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-09 11:59 UTC by Tomas Dolezal
Modified: 2020-05-26 18:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-26 18:00:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Add Jira type to nitrate.Bug (1.17 KB, patch)
2018-08-17 06:32 UTC, Lukáš Zachar
no flags Details | Diff

Description Tomas Dolezal 2018-08-09 11:59:57 UTC
Description of problem:
RH TCMS allows adding of CaseBugs that are of following types: Bugzilla and JIRA. The second type causes enumeration to fail due to type mismatch.

There is no other known workaround than removing JIRA bugs from Testcases.

python-nitrate should at least recover from the error rather.

Version-Release number of selected component (if applicable):
python-nitrate-1.3-5.fc27.noarch

How reproducible:
always

Steps to Reproduce:
use testcase with any number of Bugzilla bugs plus at least one JIRA
python2 -c 'import nitrate; print nitrate.TestCase(575497).bugs[:]'

Actual results:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/nitrate/containers.py", line 142, in __getitem__
    return list(self)[index.start:index.stop:index.step]
  File "/usr/lib/python2.7/site-packages/nitrate/containers.py", line 152, in __len__
    return len(self._items)
  File "/usr/lib/python2.7/site-packages/nitrate/containers.py", line 102, in _items
    self._fetch()
  File "/usr/lib/python2.7/site-packages/nitrate/containers.py", line 408, in _fetch
    self._current = set([Bug(inject) for inject in injects])
  File "/usr/lib/python2.7/site-packages/nitrate/immutable.py", line 1189, in __init__
    self._fetch(inject)
  File "/usr/lib/python2.7/site-packages/nitrate/immutable.py", line 1235, in _fetch
    self._bug = int(inject["bug_id"])
ValueError: invalid literal for int() with base 10: 'RCM-38188'

Expected results:
similar to: [Bug(number), ...]

Additional info:
ValueError                                Traceback (most recent call last)
<ipython-input-13-a9207cf2fc63> in <module>()
----> 1 nitrate.TestCase(575497).bugs[:]

/usr/lib/python2.7/site-packages/nitrate/containers.pyc in __getitem__(self, index)
    140             return list(self)[index]
    141         elif isinstance(index, slice):
--> 142             return list(self)[index.start:index.stop:index.step]
    143         else:
    144             raise IndexError("Invalid index '{0}'".format(index))

/usr/lib/python2.7/site-packages/nitrate/containers.pyc in __len__(self)
    150     def __len__(self):
    151         """ Number of container items """
--> 152         return len(self._items)
    153 
    154     def __unicode__(self):

/usr/lib/python2.7/site-packages/nitrate/containers.pyc in _items(self)
    100         """ Set representation containing the items """
    101         if self._current is NitrateNone:
--> 102             self._fetch()
    103         # Fetch the whole container if there are uncached items (except when
    104         # the container is modified otherwise we would lose local changes).

/usr/lib/python2.7/site-packages/nitrate/containers.pyc in _fetch(self, inset)
    406         injects = self._server.TestCase.get_bugs(self.id)
    407         log.data(pretty(injects))
--> 408         self._current = set([Bug(inject) for inject in injects])
    409         self._original = set(self._current)
    410 

/usr/lib/python2.7/site-packages/nitrate/immutable.pyc in __init__(self, id, bug, system, **kwargs)
   1187         # If inject given, fetch bug data from it
   1188         if inject:
-> 1189             self._fetch(inject)
   1190         # Initialized by bug id and system id
   1191         elif bug is not None and system is not None:

/usr/lib/python2.7/site-packages/nitrate/immutable.pyc in _fetch(self, inject)
   1233         # Process provided inject
   1234         self._id = int(inject["id"])
-> 1235         self._bug = int(inject["bug_id"])
   1236         self._system = int(inject["bug_system_id"])
   1237         self._testcase = TestCase(int(inject["case_id"]))

ValueError: invalid literal for int() with base 10: 'RCM-38188'

Comment 2 Lukáš Zachar 2018-08-17 06:32:37 UTC
Created attachment 1476560 [details]
Add Jira type to nitrate.Bug

For jira issue AAA-1111 it will produce JIRA#AAA-1111. Not very nice but it should be a big issue.

Comment 3 Lukáš Zachar 2018-08-17 07:31:27 UTC
Meant to say "should not be a big issue" of course.

Comment 4 Lukáš Zachar 2018-08-17 08:01:15 UTC
Scratch that, nitrate.base._idify doesn't like str. Is it used somewhere else than in Bug.__hash__ ?

Comment 5 Ben Cotton 2019-05-02 21:05:10 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Ben Cotton 2019-05-28 22:09:59 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Petr Šplíchal 2019-12-04 16:18:48 UTC
Comment on attachment 1476560 [details]
Add Jira type to nitrate.Bug

Is this patch still relevant?

Comment 8 Tomas Dolezal 2019-12-10 14:42:57 UTC
Bug is still valid for python3-nitrate-1.5-4.fc30.noarch

> python3 -c 'import nitrate; print(nitrate.TestCase(575497).bugs[:])'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/nitrate/containers.py", line 145, in __getitem__
    return list(self)[index.start:index.stop:index.step]
  File "/usr/lib/python3.7/site-packages/nitrate/containers.py", line 155, in __len__
    return len(self._items)
  File "/usr/lib/python3.7/site-packages/nitrate/containers.py", line 105, in _items
    self._fetch()
  File "/usr/lib/python3.7/site-packages/nitrate/containers.py", line 411, in _fetch
    self._current = set([Bug(inject) for inject in injects])
  File "/usr/lib/python3.7/site-packages/nitrate/containers.py", line 411, in <listcomp>
    self._current = set([Bug(inject) for inject in injects])
  File "/usr/lib/python3.7/site-packages/nitrate/immutable.py", line 1191, in __init__
    self._fetch(inject)
  File "/usr/lib/python3.7/site-packages/nitrate/immutable.py", line 1237, in _fetch
    self._bug = int(inject["bug_id"])
ValueError: invalid literal for int() with base 10: 'RCM-38188'

applying the patch only breaks the package even for bugzilla-only testcases (e.g. TC#575496)
> python3 -c 'import nitrate; print(nitrate.TestCase(575497).bugs[:])'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/nitrate/containers.py", line 145, in __getitem__
    return list(self)[index.start:index.stop:index.step]
  File "/usr/lib/python3.7/site-packages/nitrate/containers.py", line 137, in __iter__
    for item in self._items:
  File "/usr/lib/python3.7/site-packages/nitrate/containers.py", line 105, in _items
    self._fetch()
  File "/usr/lib/python3.7/site-packages/nitrate/containers.py", line 411, in _fetch
    self._current = set([Bug(inject) for inject in injects])
  File "/usr/lib/python3.7/site-packages/nitrate/immutable.py", line 1223, in __hash__
    return _idify([self.system, self.bug])
  File "/usr/lib/python3.7/site-packages/nitrate/base.py", line 113, in _idify
    result = result * config._MAX_ID + value
TypeError: unsupported operand type(s) for +: 'int' and 'str'

Comment 9 Ben Cotton 2020-04-30 20:38:48 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Ben Cotton 2020-05-26 18:00:26 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.