Hello everyone,
a few years ago, I launched the Fedora Review Service over the Christmas break. It was a success, so this year I implemented another packaging-related idea that I’ve been sitting on for a while.
I’d like to work towards running the fedora-review tool for every commit for every (or at least opt-in) packages.
Motivation
We have a strong Package Review Process. Before a package is added to the official Fedora repositories, it is often rigorously scrutinized, and is only accepted after it meets our standards for quality. This relies on a heavy investment from both the contributor and the reviewer, but it is worth it because once the package gets accepted we know it is good enough.
The problem is, we have no idea what happens after that. We let the package(r) live on their own. Technically, I could revert all the changes that were recommended to me during the review, because they were too annoying, and nobody may notice. I guess that’s not a common scenario, though. What bothers me more is that I unknowingly let my packages decay out of my own ignorance. I maintain some sufficiently complicated packages and sometimes when updating to a new upstream version, I need to do non-trivial changes. I do them with the best intentions, but I have no idea whether they are correct or whether they’d pass the initial package review. Also, the best practices evolve as we invent new macros and stop using old ones.
And so, my packages probably get worse and worse every year.
Proof of concept
Currently, we use Pagure for our DistGit, but it is a done deal, that we are moving to Forgejo. I didn’t want to waste time with considering solutions that would work for Pagure, so my PoC is more future-oriented than I would normally like.
I created this Forgejo action - GitHub - FrostyX/fedora-review-ci
It can be easily used as a workflow by any other repository. Then, it takes a specfile within that repository, builds a SRPM out of it, and runs the fedora-review tool on it.
Since we don’t have a testing Forgejo instance for our future DistGit yet, I created a fake repository on GitHub that pretends to be a DistGit repository for the hello package for our purposes - GitHub - FrostyX/fedora-review-ci-hello
On the last commit, I got this CI failure:
Run cat /tmp/fedora-review/review-light/review.json |jq '[.results.MUST.Generic[] | select(.result == "fail")]'
[
{
"result": "fail",
"text": "Permissions on files are set properly.",
"note": "See rpmlint output",
"name": "CheckFilePermissions",
"url": "https://docs.fedoraproject.org/en-US/packaging-guidelines/#_file_permissions"
},
{
"result": "fail",
"text": "If (and only if) the source package includes the text of the license(s) in its own file, then that file, containing the text of the license(s) for the package is included in %license.",
"note": "License file COPYING is not marked as %license",
"name": "CheckLicensInDoc",
"url": "https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/#_license_text"
}
]
Run test "2" -eq 0
Error: Process completed with exit code 1.
Random thoughts
- Please see
action.ymlin the first repository to see what exactly it does - I want to run and report only
MUSTerrors and ignoreSHOULDandEXTRAto avoid being too pedantic - I want to report the errors in a more user-friendly way, e.g. comment in a pull request, or using whatever is the best practice for reporting errors in Forgejo Actions
- We already do scratch builds for our PRs. I want to make this action dependent on those, so that this action could simply download the already built RPM results instead of building them for the second time
- Examples are hosted on GitHub because we AFAIK don’t have any Forgejo instance with hosted action runners. But I wrote them based on the Forgejo Action documentation, not GitHub documentation, so they should work once we move to Forgejo
- This is not an official Fedora Change Proposal and this is not something I’d want to force on us, no matter the cost. If we decide to continue, there will be a lot of time, official announcements, and it would definitely start as an opt-in.
What’s next?
I mainly wanted to start a discussion and see your thoughts about the topic. Maybe somebody else is already working on this, maybe this is a bad idea, maybe there is a better approach. I can easily see an alternative implementation for this using Packit and Testing Farm.
In case nobody weighs in, my plan would be continuing to work on this action, wait for the Forgejo migration, enable it for my own packages, allow anyone to do the same, try it for a couple of months, make the user experience nice for myself, and then suggest this for all Fedora packages with an option to opt-out.