Skip to content

Commit

Permalink
fix: mention proper permission level and login for GitLab (#2024)
Browse files Browse the repository at this point in the history
fix: mention proper permission level and login for GitLab

When creating commit statuses to GitLab, Packit needs to have Developer permissions to create them. Also add a proper login instead of the generic “author of the comment”.

Reviewed-by: Laura Barcziová
Reviewed-by: Matej Focko
  • Loading branch information
softwarefactory-project-zuul[bot] authored Jan 29, 2024
2 parents f3ec1ad + 0d54b59 commit 7337498
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packit_service/worker/helpers/job_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,15 @@ def _report(
so we can extend it in subclasses easily.
"""
if self.is_gitlab_instance and not self.is_reporting_allowed:
login = self.project.service.user.get_username()
description = (
f"{description}\n\n---\nPackit-User does not have access to the "
f"{description}\n\n---\nPackit does not have access to the "
"source project (=usually author's fork of the project). "
"(This is only about the representation of the results. "
"Packit is still able to do its job without having the permissions.)\n\n"
"*In case you wish to receive commit statuses instead of comments, please "
"add login of the author of this comment to your fork with a role "
"`Reporter`.*"
f"add {login} to your fork with a role `Developer`.*"
" For more details see our [guide](https://packit.dev/docs/guide#gitlab)."
)

final_commit_states = (
Expand Down

0 comments on commit 7337498

Please sign in to comment.