From patchwork Sun Mar 29 15:01:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2083 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774796545; bh=gDi3/0qox4MDbiZZ1tE8Ry119Ko95KezgGUe4sl9anA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=CMeh3J+OkLrcd8r76Bol8utAa+yO2HTXaCv7hV07g2Ii3Bv7/NUWjCNK50f9BsfmW JNy9wZG30ZVx0Zk5UN/KXBD/SIHrt4yb6oF5tShLKYLUBwEGA1cjDzVR4ekCV+vvNI yR1c7GH9MogAfxf6bO16CGM2z9ilgED6mpryAiVqR0t8txuVs6UJ8vPQlzTASq8vOD kdqFj38I9zFDbee6A1BxW12ZVO6y9QXPsHtepKCqssfmpfu5VaK6n32mIM9rwxuBas W9Y0hts0G7Bmc+cj1ITsH28mC2YcaCj27NcFB+hazurs1c6PHyAMfuORCPsJ4d5/UH G7NuI/8/fL9iw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3D0076A02E for ; Sun, 29 Mar 2026 09:02:25 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id UrExjIap-qIi for ; Sun, 29 Mar 2026 09:02:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774796545; bh=gDi3/0qox4MDbiZZ1tE8Ry119Ko95KezgGUe4sl9anA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=CMeh3J+OkLrcd8r76Bol8utAa+yO2HTXaCv7hV07g2Ii3Bv7/NUWjCNK50f9BsfmW JNy9wZG30ZVx0Zk5UN/KXBD/SIHrt4yb6oF5tShLKYLUBwEGA1cjDzVR4ekCV+vvNI yR1c7GH9MogAfxf6bO16CGM2z9ilgED6mpryAiVqR0t8txuVs6UJ8vPQlzTASq8vOD kdqFj38I9zFDbee6A1BxW12ZVO6y9QXPsHtepKCqssfmpfu5VaK6n32mIM9rwxuBas W9Y0hts0G7Bmc+cj1ITsH28mC2YcaCj27NcFB+hazurs1c6PHyAMfuORCPsJ4d5/UH G7NuI/8/fL9iw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2CF9B6A2AB for ; Sun, 29 Mar 2026 09:02:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774796543; bh=HT99tAx9QIPfrE5rxQiTPGkPGYsjpF9McedZBFCyYeU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aibVm9bykwMGGjQ+e97kx9eJLbnGNh8Tpl4OoXRe4aHoXLIUp3NpGsdAM9ww8tkmy JRAtib0IHB++2CkIfS3bbbr6p+qPmXTYmRe9F4txs+xfPqDvtpbmfdtGGB4JluZHzw JNl8noDCGX3pxiYdTMFFXvHoDJlYnrsrRLGcknZ/woOe8pgZcE9lp+k/dFOT6iqaie H1etNNbKBONWs9DRyHwqpRwpqQpcqpvmtvYe7RLuHOPgnfuXvvKiqI8DJP6bGYkHIN z1Ax4lExL/Tl3jO+2kMGWKmFsRtsZD2yXB2VMjzQ3buC87BKvoA0uqhHnXxraMx+rG pP2S5FV+ssLPg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 366456A02E; Sun, 29 Mar 2026 09:02:23 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 3zVW4ern5Ham; Sun, 29 Mar 2026 09:02:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774796537; bh=ZALzZ56kmzIQIH7QtkTwbzI9D0R1te3Tf4of0zBqWc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nfBNsfuiEqu/xPs3yL3jRqEtQWYR2HB2E3cVNDnH6/SBaFblSNr3kLNWDFnor2MoY bdmoUuPmRJbpFQY+zxbSK0R7TJTKJdrEWlld6nPnsBDV44HDyeQNMpwNCzbLCmGRFb LVO2fAeugxa8mwZA/1EhUNzCbhzLlXU1+FtaZ+YfXNxWms4vWGb4CRLGDJr2TJ8Xrg q6gUW6k8f+9TA9l8GkcQivzRebvV8lgv/RQorHUdLdA1334USg69Uxvav+klW20zeE 4ovwNSu0kR+zvmMJQp/9zySKa6pwjge7y+7d665TkMXuref6MRePj4o+QNAxruizAm Do9tOAU8wo/xg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E65E86A2CB; Sun, 29 Mar 2026 09:02:16 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sun, 29 Mar 2026 09:01:34 -0600 Message-ID: <20260329150140.4095446-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260329150140.4095446-1-sjg@u-boot.org> References: <20260329150140.4095446-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HRUQQ777QQW36AF7K2YXE7ZPZQLLNXQS X-Message-ID-Hash: HRUQQ777QQW36AF7K2YXE7ZPZQLLNXQS X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/11] patman: Record series send in the workflow table List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When a series is sent, record the event as a SENT workflow entry and automatically create a TODO entry 7 days out so the developer is reminded to follow up on reviews. Sending again archives the previous entries and creates fresh ones. Signed-off-by: Simon Glass --- tools/patman/cseries.py | 4 ++++ tools/patman/test_cseries.py | 30 ++++++++++++++++++++++++++++++ tools/patman/workflow.py | 18 ++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index 8f159a8308f..4dddc70b679 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -20,6 +20,7 @@ from patman import cser_helper from patman.cser_helper import AUTOLINK, oid from patman import send from patman import status +from patman import workflow class Cseries(cser_helper.CseriesHelper): @@ -988,6 +989,9 @@ class Cseries(cser_helper.CseriesHelper): args.branch = self._get_branch_name(ser.name, version) likely_sent = send.send(args, git_dir=self.gitdir, cwd=self.topdir) + if likely_sent: + workflow.sent(self, ser.idnum) + if likely_sent and autolink: tout.notice(f'Autolinking with Patchwork ({autolink_wait} seconds)') self.link_auto(pwork, name, version, True, wait_s=autolink_wait) diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 8fcdbd340fb..01f4f4a133d 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -4293,3 +4293,33 @@ Date: .* with terminal.capture() as (out, _): self.run_args('wf', 'todo-list') self.assertIn('No todos due', out.getvalue()) + + def test_workflow_sent(self): + """Test that sending a series creates SENT and TODO entries""" + cser = self.get_cser() + with terminal.capture(): + cser.add('first', 'my description', allow_unmarked=True) + + cser.fake_now = datetime(2025, 3, 1, 12, 0, 0) + ser = cser.get_series_by_name('first') + + # Record a send + wf.sent(cser, ser.idnum) + + # Should have a SENT entry with current time + ts = cser.db.workflow_get('sent', ser.idnum) + self.assertEqual('2025-03-01 12:00:00', ts) + + # Should have a TODO entry 7 days out + ts = cser.db.workflow_get('todo', ser.idnum) + self.assertEqual('2025-03-08 12:00:00', ts) + + # Sending again should archive old entries and create new ones + cser.fake_now = datetime(2025, 3, 5, 12, 0, 0) + wf.sent(cser, ser.idnum) + + ts = cser.db.workflow_get('sent', ser.idnum) + self.assertEqual('2025-03-05 12:00:00', ts) + + ts = cser.db.workflow_get('todo', ser.idnum) + self.assertEqual('2025-03-12 12:00:00', ts) diff --git a/tools/patman/workflow.py b/tools/patman/workflow.py index 029d63cf6a4..42e38db56f6 100644 --- a/tools/patman/workflow.py +++ b/tools/patman/workflow.py @@ -11,9 +11,27 @@ import enum class Wtype(enum.StrEnum): """Types of workflow entry""" + SENT = 'sent' TODO = 'todo' +def sent(cser, series_id): + """Record that a series was sent and create a follow-up todo + + Args: + cser (CseriesHelper): Series helper with open database + series_id (int): ID of the series that was sent + """ + ts = cser.get_now().strftime('%Y-%m-%d %H:%M:%S') + cser.db.workflow_archive(Wtype.SENT, series_id) + cser.db.workflow_add(Wtype.SENT, series_id, ts) + when = cser.get_now() + timedelta(days=7) + todo_ts = when.strftime('%Y-%m-%d %H:%M:%S') + cser.db.workflow_archive(Wtype.TODO, series_id) + cser.db.workflow_add(Wtype.TODO, series_id, todo_ts) + cser.commit() + + def todo(cser, series, days): """Mark a series as a todo item after a number of days