mock icon indicating copy to clipboard operation
mock copied to clipboard

[RFE]: Plugin/Hook for mandatory post-build/lint checks to run after packages are built

Open Conan-Kudo opened this issue 7 years ago • 4 comments
trafficstars

In obs-build, there's a way to extend it with a hook to run a number of checks after packages are built, and these checks can be used to fail the overall build if it's bad enough.

For example, it'll run rpmlint and if the rpmlint badness score is high enough, rpmlint fails the packages, and it'll fail the build.

There's also other build checks that it'll run to ensure the sanity of the packages.

It'd be great if this was possible in mock, especially for setups with Koji or COPR that could be set up to strictly evaluate the built packages and fail the whole thing if the packages are bad enough.

You can see an example of this in this build log: https://build.opensuse.org/package/live_build_log/system:packagemanager:dnf/dnf/openSUSE_Tumbleweed/x86_64

Conan-Kudo avatar Jan 01 '18 04:01 Conan-Kudo

Is there some definition of the format where/how to define the checks? I cannot see anything relevant (but the code) in the referenced git.

xsuchy avatar Jan 01 '18 12:01 xsuchy

In obs-build, here's some of the code for the post-build invocation of rpmlint and package build comparisons and generating deltarpms: https://github.com/openSUSE/obs-build/blob/master/build-recipe-spec#L194-L256

Here's the logic that invokes post-build-checks: https://github.com/openSUSE/obs-build/blob/master/build#L1455-L1457

Conan-Kudo avatar Jan 01 '18 12:01 Conan-Kudo

I do not like the suse approach. They basicaly run /usr/local/bin/rpmlint if it is present in builder.

I discussed this in Copr team and the best suggestion so far was to introduce new option --external-check=rpmlint or --external-check=fedora-review etc.

xsuchy avatar Jan 23 '18 10:01 xsuchy

The SUSE approach is necessary when you can't configure things inside. If Koji and COPR can configure mock to run the checks, then that's obviously better. For Mageia, for example, we want to be able to run rpmlint and fail the build if it fails rpmlint after the packages are produced in Koji/COPR.

But it should be possible to add checks that mock can invoke trivially, for third parties using their own build environments.

Conan-Kudo avatar Jan 23 '18 12:01 Conan-Kudo