From fdd6ac4254c555ac660ae0fd81198f4210f079dc Mon Sep 17 00:00:00 2001 From: Laura Barcziova Date: Fri, 29 Nov 2024 15:48:30 +0100 Subject: [PATCH] Trim the UID for setting Pagure PR flag The limit for the length is 32 characters (https://pagure.io/api/0/#pull_requests-tab). --- packit_service/worker/reporting/reporters/pagure.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packit_service/worker/reporting/reporters/pagure.py b/packit_service/worker/reporting/reporters/pagure.py index 4cb15ffdc..843368b1a 100644 --- a/packit_service/worker/reporting/reporters/pagure.py +++ b/packit_service/worker/reporting/reporters/pagure.py @@ -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,