commit:     d869f1ba5f9dc8eb0192cfa2e45476ab7e8e72eb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 10 12:14:23 2026 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Feb 10 12:14:23 2026 +0000
URL:        
https://gitweb.gentoo.org/proj/repo-mirror-ci.git/commit/?id=d869f1ba

scan-pull-requests: Fix handling Codeberg + GitHub queue

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 pull-request/scan-pull-requests.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/pull-request/scan-pull-requests.py 
b/pull-request/scan-pull-requests.py
index 6a85105..03fe094 100755
--- a/pull-request/scan-pull-requests.py
+++ b/pull-request/scan-pull-requests.py
@@ -94,7 +94,9 @@ def scan_codeberg(db: dict):
                 desc = "QA checks pending. Currently {}. in queue.".format(i)
             cb.commit_set_status(sha, "pending", description=desc, 
context="gentoo-ci")
 
-            print(f"{pr_key}: {db.get(pr_key, '') or '(none)'} -> {sha}", 
file=sys.stderr)
+            print(
+                f"{pr_key}: {db.get(pr_key, '') or '(none)'} -> {sha}", 
file=sys.stderr
+            )
             queue.append(pr_key)
         return queue
 
@@ -181,15 +183,16 @@ def scan_github(db: dict, queue_len: int):
         pr_key = f"github/{pr.number}"
         db_key = pr.number if pr.number in db else pr_key
         commit = r.get_commit(pr.head.sha)
-        if i == 0:
+        if i + queue_len == 0:
             desc = "QA checks in progress..."
             db[db_key] = commit.sha
         else:
-            desc = f"QA checks pending. Currently {i+queue_len}. in queue."
+            desc = f"QA checks pending. Currently {i + queue_len}. in queue."
         commit.create_status(context="gentoo-ci", state="pending", 
description=desc)
 
         print(
-            f"{pr_key}: {db.get(db_key, '') or '(none)'} -> {pr.head.sha}", 
file=sys.stderr
+            f"{pr_key}: {db.get(db_key, '') or '(none)'} -> {pr.head.sha}",
+            file=sys.stderr,
         )
         queue.append(pr_key)
 

Reply via email to