Skip to content

Allow bug creation with an explicitly empty list of groups#213

Merged
crobinso merged 1 commit into
python-bugzilla:mainfrom
crazyscientist:210-create-bug-groups
Sep 4, 2024
Merged

Allow bug creation with an explicitly empty list of groups#213
crobinso merged 1 commit into
python-bugzilla:mainfrom
crazyscientist:210-create-bug-groups

Conversation

@crazyscientist
Copy link
Copy Markdown
Contributor

@crazyscientist crazyscientist commented Jun 13, 2024

This allows the caller of this method to create a bug with no groups assigned, even if server-side default group assignments are configured.

Closes #210

…thon-bugzilla#210)

This allows the caller of this method to create a bug with no groups assigned,
even if server-side default group assignments are configured.
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (c2b4fed) to head (45c3a59).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #213   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines         2209      2209           
=========================================
  Hits          2209      2209           

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

@crazyscientist
Copy link
Copy Markdown
Contributor Author

The functional tests are passing except for one:

________________________________________________ test_login_stubs[XMLRPC] _________________________________________________
Traceback (most recent call last):
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/runner.py", line 340, in from_call
    result: Optional[TResult] = func()
                                ^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/runner.py", line 240, in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_callers.py", line 138, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
    yield from thread_exception_runtest_hook()
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
    yield
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
    yield
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
    yield from self._runtest_for(item, "call")
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/logging.py", line 832, in _runtest_for
    yield
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
    raise e
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
    item.runtest()
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/python.py", line 1772, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_callers.py", line 138, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/virtualenvs/bz/lib/python3.12/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
    result = testfunction(**testargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/workspace/python-bugzilla/tests/test_ro_functional.py", line 461, in test_login_stubs
    bz.logout()
  File "/home/andi/workspace/python-bugzilla/bugzilla/base.py", line 689, in logout
    self._backend.user_logout()
  File "/home/andi/workspace/python-bugzilla/bugzilla/_backendxmlrpc.py", line 226, in user_logout
    return self._xmlrpc_proxy.User.logout()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/xmlrpc/client.py", line 1122, in __call__
    return self.__send(self.__name, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/workspace/python-bugzilla/bugzilla/_backendxmlrpc.py", line 125, in _ServerProxy__request
    ret = ServerProxy._ServerProxy__request(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/xmlrpc/client.py", line 1461, in __request
    response = self.__transport.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/workspace/python-bugzilla/bugzilla/_backendxmlrpc.py", line 100, in request
    return self.__request_helper(url, request_body)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/workspace/python-bugzilla/bugzilla/_backendxmlrpc.py", line 47, in __request_helper
    return self.parse_response(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/andi/workspace/python-bugzilla/bugzilla/_backendxmlrpc.py", line 84, in parse_response
    return unmarshaller.close()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/xmlrpc/client.py", line 668, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault -32601: "The requested method 'User.logout' was not found.">

@crazyscientist crazyscientist changed the title Allow bug creation with an explicitly empty list of groups (closes #210) Allow bug creation with an explicitly empty list of groups Jun 13, 2024
Copy link
Copy Markdown
Member

@crobinso crobinso left a comment

Choose a reason for hiding this comment

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

LGTM

@crobinso crobinso merged commit 9e9d39b into python-bugzilla:main Sep 4, 2024
@crazyscientist crazyscientist deleted the 210-create-bug-groups 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.

build_createbug filters out empty list of groups

2 participants