lab132 / buildbot-gitea

Buildbot plugin for integration with gitea.
MIT License
62 stars 21 forks source link

Exception: builtins.TypeError: Gitea._fetch() got an unexpected keyword argument 'abandonOnFailure' #29

Closed waterimp closed 2 years ago

waterimp commented 2 years ago

Problem: Gitea._fetch() does not have the same signature as Git._fetch() and can cause a failure in build master.

buidbot's signature for Git._fetch()

class Git(Source, GitStepMixin):
     ...
    def _fetch(self, _, abandonOnFailure=True):

buidbot-gitea's signature for Gitea._fetch()

notice that it is missing abandonOnFailure.

class Gitea(Git):
    ...
    def _fetch(self, arg):

example traceback

2022-09-05 09:30:09+0000 [-] BuildStep.failed; traceback follows
    Traceback (most recent call last):
      File "/my/venv/lib/python3.10/site-packages/twisted/internet/defer.py", line 700, in errback
        self._startRunCallbacks(fail)
      File "/my/venv/lib/python3.10/site-packages/twisted/internet/defer.py", line 763, in _startRunCallbacks
        self._runCallbacks()
      File "/my/venv/lib/python3.10/site-packages/twisted/internet/defer.py", line 857, in _runCallbacks
        current.result = callback(  # type: ignore[misc]
      File "/my/venv/lib/python3.10/site-packages/twisted/internet/defer.py", line 1750, in gotResult
        current_context.run(_inlineCallbacks, r, gen, status)
    --- <exception caught here> ---
      File "/my/venv/lib/python3.10/site-packages/buildbot/process/buildstep.py", line 486, in startStep
        self.results = yield self.run()
      File "/my/venv/lib/python3.10/site-packages/buildbot/steps/source/base.py", line 287, in run
        res = yield self.run_vc(branch, revision, patch)
      File "/my/venv/lib/python3.10/site-packages/buildbot/steps/source/git.py", line 141, in run_vc
        yield self._getAttrGroupMember('mode', self.mode)()
      File "/my/venv/lib/python3.10/site-packages/twisted/internet/defer.py", line 1656, in _inlineCallbacks
        result = current_context.run(
      File "/my/venv/lib/python3.10/site-packages/twisted/python/failure.py", line 514, in throwExceptionIntoGenerator
        return g.throw(self.type, self.value, self.tb)
      File "/my/venv/lib/python3.10/site-packages/buildbot/steps/source/base.py", line 287, in run
        res = yield self.run_vc(branch, revision, patch)
      File "/my/venv/lib/python3.10/site-packages/twisted/internet/defer.py", line 1660, in _inlineCallbacks
        result = current_context.run(gen.send, result)
      File "/my/venv/lib/python3.10/site-packages/buildbot/steps/source/git.py", line 141, in run_vc
        yield self._getAttrGroupMember('mode', self.mode)()
    builtins.TypeError: Gitea._fetch() got an unexpected keyword argument 'abandonOnFailure'
pampersrocker commented 2 years ago

Fixed with the merge of #28 and released in version v1.7.2: https://pypi.org/project/buildbot-gitea/1.7.2/