Skip to content

Commit

Permalink
Trim the UID for setting Pagure PR flag (#2667)
Browse files Browse the repository at this point in the history
Trim the UID for setting Pagure PR flag

The limit for the length is 32 characters
(https://pagure.io/api/0/#pull_requests-tab).
RELEASE NOTES BEGIN
N/A
RELEASE NOTES END

Reviewed-by: Nikola Forró
  • Loading branch information
softwarefactory-project-zuul[bot] authored Nov 29, 2024
2 parents e50032d + fdd6ac4 commit f07b8c0
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 f07b8c0

Please sign in to comment.