From 5b23960ed9079c6728042d727a62bf759dde442a Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Thu, 5 Mar 2026 12:56:02 +0100 Subject: [PATCH] air: do not hard-code PW project link name Instances of pw_air_poller.py are not tracking 'Netdev + BPF' PW project like air-submit.py does. It is then required to save the project link name in the DB to be able to set links to the right PW project in the UI side. To be able to achieve that, the Patchwork class needs to remember the project link name that is present in the project info from PW, based on the project full name or ID given in the config. Then, this link name can be attached to the submission, and used in the UI if available. This should then fix the PW URLs on the reports linked to other PW instances like the MPTCP one. Signed-off-by: Matthieu Baerts (NGI0) --- pw/patchwork.py | 4 ++++ pw_air_poller.py | 1 + ui/ai-review.html | 3 ++- ui/air.html | 6 ++++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pw/patchwork.py b/pw/patchwork.py index c08e07c..ce14c87 100644 --- a/pw/patchwork.py +++ b/pw/patchwork.py @@ -55,6 +55,10 @@ def __init__(self, config): self._project = int(config_project) except ValueError: raise Exception("Patchwork project not found", config_project) + pw_project = self.get('projects', self._project) + if not pw_project: + raise Exception("Patchwork project not found", config_project) + self.project_link_name = pw_project['link_name'] def _request(self, url): try: diff --git a/pw_air_poller.py b/pw_air_poller.py index 468f75e..06947a3 100755 --- a/pw_air_poller.py +++ b/pw_air_poller.py @@ -237,6 +237,7 @@ def submit_to_air(self, series_id: int) -> Optional[str]: 'token': self.air_token, 'tree': self.air_tree, 'patchwork_series_id': series_id, + 'patchwork_project_link_name': self.patchwork.project_link_name, } if self.air_branch: diff --git a/ui/ai-review.html b/ui/ai-review.html index 8bc88d1..612afd7 100644 --- a/ui/ai-review.html +++ b/ui/ai-review.html @@ -561,7 +561,8 @@

Review Information ${data.patchwork_series_id}`; } diff --git a/ui/air.html b/ui/air.html index aeb8e9d..ed4161d 100644 --- a/ui/air.html +++ b/ui/air.html @@ -1940,7 +1940,8 @@

Daily Averages (by feedback status)

// Show patch source information if (data.patchwork_series_id) { - const pwUrl = `https://patchwork.kernel.org/project/netdevbpf/list/?series=${data.patchwork_series_id}`; + const pwProject = data.patchwork_project_link_name || 'netdevbpf'; + const pwUrl = `https://patchwork.kernel.org/project/${pwProject}/list/?series=${data.patchwork_series_id}`; html += `

Patchwork Series: ${data.patchwork_series_id}

`; } else if (data.hash) { html += `

Hash/Range: ${data.hash}

`; @@ -2035,7 +2036,8 @@

Daily Averages (by feedback status)

// Determine submission type let submissionType = ''; if (review.patchwork_series_id) { - const pwUrl = `https://patchwork.kernel.org/project/netdevbpf/list/?series=${review.patchwork_series_id}`; + const pwProject = data.patchwork_project_link_name || 'netdevbpf'; + const pwUrl = `https://patchwork.kernel.org/project/${pwProject}/list/?series=${review.patchwork_series_id}`; submissionType = `Patchwork: ${review.patchwork_series_id}`; } else if (review.hash) { submissionType = `Hash: ${review.hash.substring(0, 12)}`;