packit / ogr

One Git library to Rule -- one API for many git forges
MIT License
50 stars 55 forks source link

AttributeError: 'ProjectMergeRequestNoteAwardEmoji' object has no attribute 'awardemojis' #856

Closed sentry-io[bot] closed 1 month ago

sentry-io[bot] commented 2 months ago

Sentry Issue: PCKT-002-PACKIT-SERVICE-8DK

GitlabHttpError: 404: 404 Award Emoji Name has already been taken Not Found
  File "gitlab/exceptions.py", line 325, in wrapped_f
    return f(*args, **kwargs)
  File "gitlab/mixins.py", line 300, in create
    server_data = self.gitlab.http_post(path, post_data=data, files=files, **kwargs)
  File "gitlab/client.py", line 1015, in http_post
    result = self.http_request(
  File "gitlab/client.py", line 798, in http_request
    raise gitlab.exceptions.GitlabHttpError(

GitlabCreateError: 404: 404 Award Emoji Name has already been taken Not Found
  File "ogr/services/gitlab/comments.py", line 63, in add_reaction
    reaction_obj = self._raw_comment.awardemojis.create({"name": reaction})
  File "gitlab/exceptions.py", line 327, in wrapped_f
    raise error(e.error_message, e.response_code, e.response_body) from e

AttributeError: 'ProjectMergeRequestNoteAwardEmoji' object has no attribute 'awardemojis'

<class
'gitlab.v4.objects.award_emojis.ProjectMergeRequestNoteAwardEmoji'>
was created via a list() call and only a subset of the data may be
present. To ensure all data is present get the object using a
get(object.id) call. For more details, see:

https://python-gitlab.readthedocs.io/en/v3.9.0/faq.html#attribute-error-list
(9 additional frame(s) were not displayed)
...
  File "packit_service/worker/jobs.py", line 742, in get_handlers_for_comment_and_rerun_event
    self.event.comment_object.add_reaction(COMMENT_REACTION)
  File "ogr/abstract.py", line 106, in wrapper
    return function(*args, **kwargs)
  File "ogr/services/gitlab/comments.py", line 70, in add_reaction
    (reaction_obj,) = filter(
  File "ogr/services/gitlab/comments.py", line 75, in <lambda>
    == item.awardemojis.gitlab.user.name
  File "gitlab/base.py", line 134, in __getattr__
    raise AttributeError(message)