Skip to content

Commit

Permalink
Trim the UID for setting Pagure PR flag
Browse files Browse the repository at this point in the history
The limit for the length is 32 characters
(https://pagure.io/api/0/#pull_requests-tab).
  • Loading branch information
lbarcziova committed Nov 29, 2024
1 parent e50032d commit fdd6ac4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packit_service/worker/reporting/reporters/pagure.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def set_status(
# generate a custom uid from the check_name,
# so that we can update flags we set previously,
# instead of creating new ones (Pagure specific behaviour)
uid = hashlib.sha256(check_name.encode()).hexdigest()
# the max length of uid is 32 chars
uid = hashlib.sha256(check_name.encode()).hexdigest()[:32]
self.pull_request_object.set_flag(
username=check_name,
comment=description,
Expand Down

0 comments on commit fdd6ac4

Please sign in to comment.