Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sentry-io bot opened this issue Sep 4, 2024 · 0 comments · Fixed by #861
Closed
Labels
area/gitlab Related to GitLab implementation. complexity/easy-fix No planning/thinking about design needed, should be finished in an hour. gain/low This doesn't bring that much value to users. good-first-issue Good for newcomers. impact/low This issue impacts only a few users. kind/bug Something isn't working.

Comments

@sentry-io
Copy link

sentry-io bot commented Sep 4, 2024

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)
@lbarcziova lbarcziova added kind/bug Something isn't working. good-first-issue Good for newcomers. labels Sep 5, 2024
@nforro nforro added area/gitlab Related to GitLab implementation. gain/low This doesn't bring that much value to users. impact/low This issue impacts only a few users. complexity/easy-fix No planning/thinking about design needed, should be finished in an hour. labels Sep 5, 2024
@nforro nforro moved this from new to backlog in Packit Kanban Board Sep 5, 2024
kapr200 added a commit to kapr200/ogr that referenced this issue Sep 27, 2024
@kapr200 kapr200 mentioned this issue Sep 27, 2024
4 tasks
kapr200 added a commit to kapr200/ogr that referenced this issue Sep 27, 2024
kapr200 added a commit to kapr200/ogr that referenced this issue Sep 27, 2024
kapr200 added a commit to kapr200/ogr that referenced this issue Sep 27, 2024
kapr200 added a commit to kapr200/ogr that referenced this issue Sep 27, 2024
softwarefactory-project-zuul bot added a commit that referenced this issue Oct 1, 2024
Fix #856

Related to #856

TODO:

 Write new tests or update the old ones to cover new functionality.
 Update doc-strings where appropriate.
 Update or write new documentation in packit/packit.dev.
 ‹fill in›



Fixes #856
Related to
Merge before/after

RELEASE NOTES BEGIN
We have fixed an issue that caused inconsistencies with the expected behavior stated by the documentation when adding duplicit reactions to GitLab comments.
RELEASE NOTES END

Reviewed-by: Matej Focko
@github-project-automation github-project-automation bot moved this from backlog to done in Packit Kanban Board Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gitlab Related to GitLab implementation. complexity/easy-fix No planning/thinking about design needed, should be finished in an hour. gain/low This doesn't bring that much value to users. good-first-issue Good for newcomers. impact/low This issue impacts only a few users. kind/bug Something isn't working.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants