canonical / snapcraft

Package, distribute, and update any app for Linux and IoT.
https://snapcraft.io
GNU General Public License v3.0
1.19k stars 447 forks source link

Add regex validator for app commands #4999

Open mr-cal opened 3 months ago

mr-cal commented 3 months ago

What needs to get done

Add a validator for command, stop-command, reload-command, post-stop-command, and bus-name to match snapd's validation.

Why it needs to get done

Using an = sign is a common mistake:

apps:
  my-app:
     command: my-app --parameter=foo
syncronize-issues-to-jira[bot] commented 3 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3293.

This message was autogenerated

medubelko commented 3 months ago

Let's make sure to enumerate the character limitations this imposes on the schema. Citing the (unedited) old schema doc:

The command must consist only of alphanumeric characters, spaces, and the following special characters: /, ., _, #, :, $, -. If other characters are required, a wrapper script should be used for the command.