[Concept,0/9] pickman: Provide better ways to check cherry-picks

Message ID 20251224213045.3010514-1-sjg@u-boot.org
Headers
Series pickman: Provide better ways to check cherry-picks |

Message

Simon Glass Dec. 24, 2025, 9:30 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

After a few weeks of using this tool a couple of things have come to
light, mostly in a recent attempt to cherry-pick ~260 commits.

Firstly, it is hard to manually check a cherry-pick against the
original. The GitLab GUI allows you to click on both, but it does not
give a sense of the detail.

Secondly, commits have sometimes already been applied to the tree, but
in this case effort is still paid to cherry pick it, sometimes with
unfortunate results.

Thirdly, building once at the end does not catch every problems. In the
case in question, about five commits were mangled, three of which would
have been caught by doing a build.

This series introduces a new 'check' command which provides a simple
check of the diff delta between an original commit and its cherry pick.,
thus providing a list of suspect cherry-picks, e.g. (omitting some long
lines):

  Cherry-pick Delta% Original   Subject
  ----------- ------ ---------- -------
  aaea489b2a     100 9bab7d2a7c net: wget: let wget_with_dns work with
  e557daec17     100 f0315babfb hash: Plumb crc8 into the hash functions
  08a86f1769      40 6acada5daa configs: j7*: Enable TI_COMMON_CMD_OPTIONS
  de37f6abb6     100 fc37a73e66 fdt: Swap the signature for
  d1437b065a     100 e2cc9b4fc1 tools: binman: add 'fit, encrypt' property
  09b800b0df     100 12d7be498a Docker/CI: Only test Xtensa on amd64 hosts
  0256d8140c     100 ece1631f5e test/cmd/wget: replace bogus response with
  e005799d8f      33 15e0c5e390 lmb: Remove lmb_alloc_addr_flags()
  eaba5aae8f      79 99afa58e6d sandbox: Correct guard around readq/writeq
  c347fb4b1a      41 99145eec2d x86: select CONFIG_64BIT for X86_64
  14192a60e0      89 60a684e0a9 trace: add support for 'trace wipe'
  8f58cfe76d      66 905204ddcf test: test_trace.py: test 'trace wipe'
  12 problem commit(s) found

The -d option shows a diff of the patch diffs, which can aid a fast
review.

This series also includes some updates to the agent prompt to build
after each commit, some refactoring and tidy-ups to remove pylint
warnings and a way to tell the agent about possible already-applied
commits.

Further refinements will likely be needed as time goes on.


Simon Glass (9):
  pickman: Fix 80-column line length compliance
  pickman: Add URL constants to improve test readability
  pickman: Improve function names and line-length compliance
  pickman: Disable pylint too-many-positional-arguments warnings
  pickman: Enhance agent prompts with per-commit validation
  pickman: Add a check command for cherry-pick delta analysis
  pickman: Add an option to show patch diffs
  pickman: Use named tuples for better code clarity
  pickman: Add already-applied commit detection / comparison

 tools/pickman/README.rst    |  61 ++-
 tools/pickman/__main__.py   |  73 +++-
 tools/pickman/agent.py      | 105 +++--
 tools/pickman/control.py    | 596 +++++++++++++++++++++++++++--
 tools/pickman/database.py   |  11 +-
 tools/pickman/ftest.py      | 744 ++++++++++++++++++++++++++++--------
 tools/pickman/gitlab_api.py |  17 +-
 7 files changed, 1341 insertions(+), 266 deletions(-)
  

Comments

Simon Glass Dec. 24, 2025, 9:30 p.m. UTC | #1
From: Simon Glass <simon.glass@canonical.com>

Add too-many-positional-arguments to existing pylint-disable comments
for functions with many parameters:
- agent.py: 4 functions updated
- control.py: 1 function updated
- database.py: 2 functions updated
- gitlab_api.py: 1 function updated

These functions require many parameters for their interface contracts
and the warnings don't add value.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>