openSUSE / obs-service-replace_using_package_version

An OBS service to replace a regex with some package version available in the build time repositories
GNU General Public License v3.0
4 stars 12 forks source link

Attempt to read version from obsinfo if no version is found #32

Closed davidcassany closed 1 year ago

davidcassany commented 1 year ago

Fixes https://github.com/rancher/elemental-operator/issues/233

Signed-off-by: David Cassany dcassany@suse.com

davidcassany commented 1 year ago

This PR allows to pull the version from the obsinfo file if there is also an SCM service defined. With this the version can also be taken from the sources. This is particularly handy for applications that are distributed as helm charts and the helm chart lives into the same repository as the application source code. The helm chart recipe does not require the application as build dependency, hence is not possible to take the version from the RPM.

See https://github.com/openSUSE/obs-service-set_version/pull/81#issuecomment-1305630250 for further background on the motivation of this PR.

davidcassany commented 1 year ago

Making it a draft as I realized the spec file is pretty outdated, the package does no longer build in OBS...

davidcassany commented 1 year ago

it would be nice if you could add some internal documentation what this obsinfo file is, where to find it and what its contents are (I have literally never heard of these…)

I will add a commit with some text probably in the README. The obsinfo files are part of the result of the obs_scm service, the main service to pull sources. You can see this change in action here https://build.opensuse.org/package/show/home:dcassany:Elemental:Dev/elemental-operator-helm the version of the helm chart is discovered by reading the *.obsinfo file that includes something like:

name: elemental-operator
version: 0.6.3+git20221109.221af67
mtime: 1667983167
commit: 221af672d7feccd9a90a9b3ef8276beb6c2a678f
davidcassany commented 1 year ago

Just rebased