From 844664c642bd4f9fb67d3ee5a01e5a0aadb7673e Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Sun, 7 Jun 2026 21:32:11 +0000 Subject: [PATCH] fix(queue): use label= (singular) not labels= (plural) for Gitea 1.22.6 API (#1306) Gitea 1.22.6 accepts `label` (singular) not `labels` (plural) for filtering issues by label in the GET /repos/{owner}/{repo}/issues endpoint. The queue script's list_queued_issues() has been passing `labels`, which Gitea silently ignores, causing the function to return all open PRs instead of only those tagged with QUEUE_LABEL. Change the query key from "labels" to "label" so the label filter is actually honoured. Fixes #1306 --- .gitea/scripts/gitea-merge-queue.py | 2 +- .gitea/scripts/tests/test_gitea_merge_queue.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/scripts/gitea-merge-queue.py b/.gitea/scripts/gitea-merge-queue.py index ceea9855a..a30fad20a 100644 --- a/.gitea/scripts/gitea-merge-queue.py +++ b/.gitea/scripts/gitea-merge-queue.py @@ -783,7 +783,7 @@ def list_queued_issues() -> list[dict]: query={ "state": "open", "type": "pulls", - "labels": QUEUE_LABEL, + "label": QUEUE_LABEL, }, ) diff --git a/.gitea/scripts/tests/test_gitea_merge_queue.py b/.gitea/scripts/tests/test_gitea_merge_queue.py index 6b8dd9e8e..ff60fd928 100644 --- a/.gitea/scripts/tests/test_gitea_merge_queue.py +++ b/.gitea/scripts/tests/test_gitea_merge_queue.py @@ -1130,7 +1130,7 @@ def test_list_candidate_issues_omits_label_filter_when_auto_discover(monkeypatch assert captured["query"].get("type") == "pulls" mq.list_candidate_issues(auto_discover=False) - assert captured["query"].get("labels") == "merge-queue" + assert captured["query"].get("label") == "merge-queue" def _wire_ready_process_once(monkeypatch, *, issues, pr_payload, calls): -- 2.52.0