You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JIRA class constructor provides several fields to prevent (or enable) initially connecting to JIRA to get information from it. For example, get_server_info will enable connecting to get server information if True, but disable it if False.
However, the end of the constructor has this code:
This makes it impossible to construct a JIRA object without connecting to JIRA, even if you have set the 2-3 "check things" arguments to False. In a test or development environment, it's common to have dummy/do-nothing configurations for such things, and stub out or patch the code doing the actual connection/calling, but when you can't even construct an object without connecting, it makes testing more difficult. Not impossible, mind you, just more difficult.
Additionally, self._fields is, currently, only used while searching, so connecting and retrieving this information eagerly wastes I/O if you aren't going to use the JIRA instance for searching.
I propose making self._fields be a lazy-loading property, instead. It would be compatible with all code currently using self._fields, but it would delay connecting and retrieving this field information util necessary.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You way want to consider using the Sponsor button in order to persuade someone to address it.
stalebot
added
the
stale
Ticket that is likely to go nowhere and that will be closed soon
label
Dec 1, 2019
The
JIRA
class constructor provides several fields to prevent (or enable) initially connecting to JIRA to get information from it. For example,get_server_info
will enable connecting to get server information ifTrue
, but disable it ifFalse
.However, the end of the constructor has this code:
This makes it impossible to construct a
JIRA
object without connecting to JIRA, even if you have set the 2-3 "check things" arguments toFalse
. In a test or development environment, it's common to have dummy/do-nothing configurations for such things, and stub out or patch the code doing the actual connection/calling, but when you can't even construct an object without connecting, it makes testing more difficult. Not impossible, mind you, just more difficult.Additionally,
self._fields
is, currently, only used while searching, so connecting and retrieving this information eagerly wastes I/O if you aren't going to use theJIRA
instance for searching.I propose making
self._fields
be a lazy-loadingproperty
, instead. It would be compatible with all code currently usingself._fields
, but it would delay connecting and retrieving this field information util necessary.The text was updated successfully, but these errors were encountered: