openSUSE / obs-build

OBS build script, can be used with OBS or stand alone
GNU General Public License v2.0
130 stars 181 forks source link

Open Build Service Flatpak builds - #!BuildVersion: directive in yaml file does not allow character as well as number strings. #989

Open cgrobertson opened 3 months ago

cgrobertson commented 3 months ago

Issue Description

For Flatpak builds: Specifying a #!BuildVersion: in the yaml file that contains any character that is not a number or a "." or is not strictly in "version number" style format is rejected with error:

Server returned an error: HTTP Error 400: Bad Request
remote error: could not parse build description (flatpak)  Invalid BuildVersion ...

For instance, #!BuildVersion: 115.8.0esr is invalid. Whereas #!BuildVersion: 115.8.0 is valid.

The #!BuildVersion: ... is used to populate the ...flatpak-builder --default-branch=115.8.0 ... default-branch option and after the flatpak is installed is displayed as the branch value when listing the installed flatpaks. It is also used in naming the resulting flatpak package binary (i.e. org.mozilla.FirefoxESR-115.8.0-89.1.flatpak).

Because the "BuildVersion" and "default-branch" have different meanings I propose the following:

Expected Result

BuildVersion should remain the same and used in naming the flatpak package, but should not be used as the value of the --default-branch= option.

A new optional build directive should be added, say, #!DefaultBranch: ..., to specify the value of --default-branch option of the flatpak-builder command and should allow any string of characters. If this directive does not exist, omit the --default-branch option on the command line.

How to Reproduce

  1. Add a character or more to the end of a #!BuildVersion: ..., save and build.
  2. See error

Further Information

adrianschroeter commented 3 months ago

This check got implemented intentionally, would this version be accepted by flatpack builder?

@perlpunk Tina, do you happen to know?