Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run rpmlint in Actions to catch mistakes like one in 5558630f #40

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

mirekdlugosz
Copy link
Contributor

rpmlint is a bit peculiar. If I run it against spec from 5558630 it will warn about lack of spaces, but still consider it fine:

$ rpmlint quipucords-installer.spec
==================================================================== rpmlint session starts ===================================================================
rpmlint: 2.5.0
...
quipucords-installer.spec: W: no-%build-section
quipucords-installer.spec:28: W: comparison-operator-in-deptoken podman>=4.7.0
=============================== 0 packages and 1 specfiles checked; 0 errors, 2 warnings, 1 filtered, 0 badness; has taken 0.1 s ==============================
$ echo $?
0

I can use -s, --strict flag to turn all warnings into errors, but then we will get pipeline that always fail due to that no-%build-section.

So in Actions I'm telling rpmlint to ignore no-%build-section, but consider everything else an error.

rpmlint is Python program. I decided to use package from Ubuntu repositories, which generally lags behind upstream a bit (Ubuntu 24.04 has 2.5.0, upstream is now on 2.6.1). But upstream does not see very active development and releases no more than 2-3 times a year, so I don't think we are losing much. We can always switch to rpmlint from PyPI.

rpmlint warns that it runs different checks for spec files, source RPMs and binary RPMs; they recommend running the tool against all artifacts for greatest coverage. But our RPMs are built by packit, so we would have to ask packit to run rpmlint against them, and this is where I draw the line.

@mirekdlugosz mirekdlugosz requested review from a team October 10, 2024 09:50
@mirekdlugosz
Copy link
Contributor Author

mirekdlugosz commented Oct 10, 2024

Correction:

We use ubuntu-latest GitHub runner image, but we get Ubuntu 22.04 instead of 24.04. No idea why. Ubuntu 22.04 has rpmlint 2.2.0, which is noticeably older.

rpmlint on Ubuntu doesn't have a bunch of configuration files that Fedora has, so CI showed some errors that I did not see on my local environment:

quipucords-installer.spec: E: no-cleaning-of-buildroot %clean
quipucords-installer.spec: E: no-cleaning-of-buildroot %install
quipucords-installer.spec: E: no-buildroot-tag
 0 packages and 1 specfiles checked; 3 errors, 0 warnings, 3 badness; has taken 0.0 s 

I added them to ignore list for now.

@mirekdlugosz mirekdlugosz merged commit 38269fc into main Oct 10, 2024
11 checks passed
@mirekdlugosz mirekdlugosz deleted the add-rpmlint branch October 10, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants