Classic confinement request for patman

To make the review of your request easier, please use the following template to provide all the required details and also include any other information that may be relevant.


  • name: patman

  • description: Patman creates, checks, sends and tracks patch series for projects that take patches by email, such as U-Boot and the Linux kernel. It turns a git branch into a patch series with a cover letter and change logs, runs checkpatch.pl and get_maintainer.pl from the project’s tree, sends the series with git send-email, and tracks it and its review tags on Patchwork. It can also draft reviews of patches using Claude Code.

  • snapcraft: github.com/deinde-dev/patman/blob/master/snap/snapcraft.yaml

  • upstream: URL pointing to the upstream repository, if open-source. Otherwise, ‘PRIVATE’

  • upstream-relation: I am the upstream author and maintainer. I wrote patman for U-Boot in 2011 and maintain the standalone project, which split out of U-Boot earlier this year.

  • supported-category: Developer tool which runs arbitrary user-configured commands (the ‘running arbitrary command’ criterion): patman drives the user’s own git and git send-email setup, and runs scripts from the project’s tree.

  • reasoning: patman is a developer tool which works directly on the user’s own source trees and toolchain:

    • It runs on whatever git repository the user is in, which can be anywhere on disk (e.g. /src, /work, ~/dev or external drives), not just $HOME.
    • It runs the user’s own git and git send-email, with their git configuration, hooks, SMTP and credential settings, including ssh keys, gpg signing and sendmail.
    • git send-email runs patman again via --cc-cmd, so it must be runnable as an ordinary executable from outside the snap’s environment.
    • It runs checkpatch.pl and get_maintainer.pl from the project’s own tree, which need the host’s perl and tools.
    • It launches the user’s editor, and for the review feature runs the user’s installed Claude Code (claude) command.

    The tool cannot work usefully with only the home and removable-media interfaces, since it must run the user’s chosen programs with their own configuration.

I understand that strict confinement is generally preferred over classic. [YES]

I’ve tried the existing interfaces to make the snap to work under strict confinement. [YES]

This request has been added to the queue for review by the @reviewers team.

A correction: the upstream field should read https://github.com/deinde-dev/patman (open source, GPL-2.0+). Revisions 1–3 were rejected automatically while this request is pending; revision 3 (0.6.0) is the one to review.

Thanks!

Simon

Hi @sjg

It runs on whatever git repository the user is in, which can be anywhere on disk (e.g. /src, /work, ~/dev or external drives), not just $HOME.

I believe this fits the unsupported reason access to arbitrary files on the system due to developer/user inertia (home and removable-media is almost always sufficient, though personal-files and system-files may be used under certain circumstances) as defined in Reviewing classic confinement snaps - Snap documentation

It runs the user’s own git and git send-email

This fits the unsupported reason dependent software only available on host (ship in instead snap (eg, stage-packages, build from source))

with their git configuration, hooks, SMTP and credential settings

It should be possible to grant access via personal-files interface

including ssh keys, gpg signing and sendmail.

ssh-keys and gpg-keys interfaces should cover this part

git send-email runs patman again via --cc-cmd, so it must be runnable as an ordinary executable from outside the snap’s environment.

Both should run in the snap environment

It runs checkpatch.pl and get_maintainer.pl from the project’s own tree, which need the host’s perl and tools.

This fits the unsupported reason dependent software only available on host (ship in instead snap (eg, stage-packages, build from source))

It launches the user’s editor

It might be possible to use xdg-open to achieve it.

and for the review feature runs the user’s installed Claude Code (claude) command.

This is the only bit that really requires classic confinement, but I don’t think that this alone justify granting classic where the strictly confined snap can be perfectly functional for most use cases

Thanks

Hi,

Thanks for the response and careful. You’re right: a strict snap covers most of what patman does. I’ve switched it to strict confinement by removing features which require a Claude agent (which adds about 140MB!).

The limitations are documented here:

https://patman.readthedocs.io/en/latest/guide/snap.html#using-the-snap

The strict snap (snapcraft.yaml) now:

  • uses home, removable-media, network and network-bind
  • ships its own git, git send-email (with the Perl SMTP, SASL and SSL modules), perl, vim and nano
  • runs checkpatch.pl and get_maintainer.pl from the project’s tree with that perl, and --cc-cmd works inside the snap
  • leaves out the review agent that needs Claude Code
  • checks for setups the snap cannot handle, such as a tree outside $HOME, a host-only editor, a sendmail program or a host credential helper. In those cases patman explains the problem and links to a page that describes the limits, instead of letting git fail.

The editor isn’t ideal: git send-email --annotate runs $EDITOR in the terminal and waits for it to exit, so xdg-open would not work. Bundling vim and nano works although of course it isn’t a great user experience.

I’d like to request use and auto-connection of two personal-files plugs, which patman needs to read its own settings and the user’s git configuration:

  • dot-patman, write: $HOME/.patman, $HOME/.config/patman.d. This is patman’s settings file and directory. patman writes to them when the user saves settings, such as with patman settings. dot-gitconfig, read-only: $HOME/.gitconfig, $HOME/.config/git. git and git send-email need the user’s name, email and sendemail settings, and patman reads the identity and aliases from there.

Without these, patman cannot find the user’s identity or SMTP server, so it would not work out of the box. For now the snap says so and gives the snap connect commands.

Is there a path to getting the rest of the functionality included?

Thanks,

Simon