fedora-review(1)

πŸ“¦
version 0.12.0 Β· 2 versions
, in fedora 43, fedora 44

πŸ’– fedora-review β€” bestie's guide to the fedora-review(1) manual πŸ’–

okay so you opened the General Commands Manual and it's the page for fedora-review, and honestly? iconic. let's get into it 🫢


✨ NAME ✨

fedora-review β€” a Customized review template for Fedora packages. yes that's literally the whole vibe: it makes you a review template. slay.


🌸 SYNOPSIS 🌸

here's the shape of it, copy-paste-able, no cap:

fedora-review [options] -b <bug>
fedora-review [options] [--prebuilt] -n <package name>
fedora-review [options] [--prebuilt] -rn <srpm path>
fedora-review [options] -u <url>

πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole point: it Makes reviews of rpm packages for Fedora easier by providing a customized review template, and it automates some trivial tasks for you. πŸ’…

The tool runs a number of checks to test whether a package complies to the Fedora Packaging Guidelines β€” before creating the template. And through a bash API the checks can be extended, which is highkey the fun part.

Right now we have checks for C/C++, R, Java and Perl packages. periodt.


🌈 USAGE 🌈

Basic usage, the starter pack:

$ fedora-review -b <bug number>
$ fedora-review -u <url>

This will download the SPEC & SRPM files from the Bugzilla report, build them in mock, run a number of tests and generate a template. it's giving full pipeline πŸ’–

heads up bestie: Not all bugzillas support the -b option. The -u option is available for these. See the --url usage notes below. πŸ‘€
$ fedora-review -n <package name>

This alternative usage expects <package name>.spec and source rpm in current directory. By adding the -p switch, fedora-review uses already built rpms in current directory instead of building using mock. lowkey the lazy-girl route and we respect it.

$ fedora-review --rpm-spec -n <srpm path>

This form accepts a single path to a source rpm. It uses the specfile bundled in the srpm package. so you don't gotta hunt for a spec file separately πŸŽ€


You will need to have mock installed and be member of the mock group for the build to work. Run as root:

# usermod -a -G mock [your user name]

After this, you need to logout and login again (or use newgrp(1)) β€” the changes in user's group list is not read until a new login. yes it's annoying. yes you still gotta do it. 😭


πŸ‘‘ MODE OPTIONS β€” one is required πŸ‘‘

fr fr, pick exactly one of these. no mode = no review.

  • -b, --bug <bug nr> β€” Run against Fedora bugzilla at bugzilla.redhat.com, using the bugzilla bug number.
  • --copr-build <build_descriptor> β€” Run against COPR build identified by its ID, frontend build uri, or backend build chroot uri. Checks for overall build success and looks up rawhide build results of the client machine arch. Implies --prebuilt. ✨
  • -n, --name <name> β€” Runs the checks against the named spec and source rpm located in the current working directory. The files are expected to have the names <name>.spec and <name>*.src.rpm. When used together with --rpm-spec/-r, name can also be a complete path to a source rpm. πŸ’…
  • -u url, --url <url> β€” Fetch data from given url, typically another bugzilla instance such as rpmfusion. Before using this, first try the more convenient --bug <bug nr> --other-bz <url>. The option tries to retrieve the URL:s by scanning the page. See URL Limitations for how the url must look to be found. πŸ”
  • -d, --display-checks β€” List all available checks, usable as arguments to --exclude and --single.
  • -f, --display-flags β€” List all available flags, usable as arguments to --define or -D.
  • -g, --display-plugins β€” List all plugins which can be enabled/disabled using --plugins.
  • -V, --version β€” Show version info. short and sweet πŸ“

πŸ’œ GENERAL OPTIONS πŸ’œ

  • -B, --no-colors β€” Disable use of ansi colors in console output. (not me being sad about this one 😭)
  • -c, --cache β€” Do not redownload the files from bugzilla or upstream, use the local ones from previous run instead. recycling queen 🌸
  • -D, --define <flag[=value]> β€” Define a flag e. g., EPEL7. A flag can either just be activated using flag or set to a value using flag=value. --display-flags shows available flags.
  • -k, --checksum <md5|sha1|sha224|sha256|sha384|sha512> β€” Algorithm used for checksum.
  • -L, --local-repo <rpm directory> β€” Directory with rpms to install together with reviewed package during build and install phases.
  • -m, --mock-config <configuration> β€” Specify which mock config to use, one of the files in /etc/mock, with the .cfg suffix stripped. Defaults to the root defined in /etc/mock/default.cfg.
  • -o, --mock-options options... β€” Mock options for the build. Defaults to --no-cleanup-after --no-clean, you might want this along with other options you provide.
  • --no-report β€” Do not generate the review template.
  • --no-build β€” Do not rebuild or install the source rpm, instead use the last installed package available in mock. Implies --cache.
  • --other_bz β€” Url of alternative bugzilla, instead of using default https://bugzilla.redhat.com
  • -p, --prebuilt β€” When using -n <name>, use prebuilt rpms in current directory instead of building new ones in mock.
  • -P, --plugins β€” Normally, the right plugin(s) to run are autodetected. Using --plugins overrides the decision to run a plugin or not. The argument is a comma-separated list of plugins, each possibly with a :off suffix e. g.,
--plugins Java:off,C/C++

Use --display-plugins to see available plugins. Enabling plugins has no well-defined semantics: some tests might leave no trace in the report even though they are actually run. πŸ’€ (yeah. it just be like that.)

  • -r, --rpm-spec β€” Instead of using a spec file URL, use the spec file bundled in the srpm file.
  • -s test, --single test β€” Run a single test, as listed by --display-checks. Does not run dependencies, only the given test.
  • -v, --verbose β€” Provides a more detailed output of what's going on. the girlies love receipts πŸ”₯
  • -x test1, test2, ... , --exclude test1, test2, ... β€” Comma-separated list of test(s) to exclude, as listed by --display-checks. A test which depends on an excluded test, will run.

πŸŽ€ THE REVIEW DIRECTORY πŸŽ€

The review directory is created with a name corresponding to the command line options. The package name is always part of the name, sometimes also the bug number. Here's what lives inside (iykyk):

  • review.txt β€” The review template.
  • report.xml β€” Report with failed issues based on the firehose xml format. This is as yet experimental and not stable. See https://github.com/fedora-static-analysis/firehose. πŸ™ˆ
  • srpm directory β€” Holds whats downloaded, normally a src.rpm and a spec file. When using --rpm-spec, here is no .spec file.
  • srpm-unpacked directory β€” Holds the unpacked content of the src.rpm file.
  • upstream directory β€” contains sources downloaded from the Source: url in the spec file.
  • upstream-unpacked directory β€” Occasionally contains the unpacked sources, but is normally empty.
  • dependencies β€” Used for dependencies specfiles when EXARCH flag is set, otherwise empty.
  • BUILD link β€” Points to the mock directory containing the sources used in the build. These sources have been created and modified by the %prep stuff in the spec file. The link is only valid direct after the run, it's overwritten next time mock executes. ⏳
  • results directory β€” Contains the result from the build, logs and rpm packages.

🧚 LOCAL SOURCES (GIT-BASED OR SIMILAR) 🧚

Normally, the Source0 (or others SourceX) in the specfile contains an URL to the upstream source. fedora-review uses this url to download the upstream source and then compare md5sum with source in rpm. standard behavior bestie πŸ’–

However, in some cases the Source0: is just a filename e. g., when sources are generated from git, svn or similar tools. In these cases, fedora-review will look for a file matching the Source0 in current directory. If it exists, it's used as upstream source. This way, a reviewer can generate the source according the comments in the spec before running fedora-review and then have it checked. ✨ DIY era.


⭐ USING KOJI SCRATCH BUILDS ⭐

It's possible to use koji to build packages instead of mock when using fedora-review. The basic idea is to run a koji scratch build, download the built packages and invoke fedora-review on these. This workflow uses the --prebuilt option, and has some limitations on checks performed since fedora-review cannot access the build directories.

The workflow, step by step:

  1. Invoke koji, note the task number:
koji build --scratch my-package.src.rpm
  1. Download the results:
koji-download-scratch <task number>
  1. Invoke fedora-review using --prebuilt, --name options and --rpm-spec:
fedora-review --rpm-spec --prebuilt --name my-package

πŸ” URL limitations πŸ”

fedora-review handles two types of URLs: the spec and srpm url found in e. g., the bugzilla page and the source url(s) found in the spec file.

For the srpm and spec file url:

  • The parameters (i. e., the ? and everything beyond) is removed.
  • The rest must end with /*.spec or /*.src.rpm

For the source url, possible parameters are not removed. It must end with /filename, typically something like /package-2.0.1.tar.gz


πŸ’« EXAMPLES πŸ’«

Make a report template for Fedora bug 817271:

$ fedora-review -b 817271

fetches spec and srpm file from bugzilla.redhat.com and makes a report. To instead handle a bug at rpmfusion use something like

$ fedora-review --url \
https://bugzilla.rpmfusion.org/show_bug.cgi?id=2150 \
--mock-config fedora-16-i386-rpmfusion_free

Occasionally, fedora-review isn't able to pick up the links e. g., when the links does not end in .spec and/or .src.rpm. In these case you need to download files manually. Using --rpm-spec only the srpm is needed:

$ wget https://somewhere.com/bad-srpmlink -O my-package-1.2-1.fc16.src.rpm
$ fedora-review --rpm-spec -n my-package-1.2-1.fc16.src.rpm

You can use this command to run a review against a COPR build with a given ID (the ID 670893 is just an example one):

$ fedora-review --copr-build 670893

πŸ“ FILES πŸ“

  • ~/.cache/fedora-review.log β€” Debug logging from last session.
  • /usr/share/fedora-review/plugins β€” System-wide python plugins directory.
  • /usr/share/fedora-review/scripts β€” System-wide scripts directory.
  • ~/.local/share/fedora-review/plugins/ β€” User supplied directory for python plugins.
  • ~/.local/share/fedora-review/scripts/ β€” User supplied directory with shell-based plugins.

...and that's part 1 bestie, don't go anywhere, there's more coming πŸ’…

🌸 ENVIRONMENT 🌸

ok so these are the vibes you can set in your environment before running, and fedora-review will respect them, periodt πŸ’…

  • REVIEW_LOGLEVEL β€” this is the loglevel used when you're not passing -v/--verbose. it takes a logging.* style value, like 'DEBUG', 'Info', or 'warning'. and bestie, setting REVIEW_LOGLEVEL to 'debug' is literally the same as handing over the -v/--verbose option. same energy, different font 🫢
  • REVIEW_NO_MOCKGROUP_CHECK β€” okay so normally fedora-review checks that you're a member of the mock group before it proceeds, because that's required to run mock in most setups. but if that check isn't useful for you, you can suppress it with this variable. it's giving "i know what i'm doing" πŸ’…
  • XDG_DATA_HOME β€” fedora-review respects XDG_DATA_HOME, which defaults to ~/.local/share. like, for example, the personal data directory with plugins is by default ~/.local/share/fedora-review/plugins, but it becomes $XDG_DATA_HOME/fedora-review/plugins if XDG_DATA_HOME is set. go peek at FILES for the receipts πŸ‘‘
  • XDG_CACHE_HOME β€” if you set this, it defines the directory where the logfile fedora-review.log gets written. defaults to ~/.cache. so cute, so tidy ✨

πŸ‘‘ AUTHORS πŸ‘‘

the origin story, no cap:

  • Original author: Tim Lauridsen <tim.lauridsen@gmail.com>

Developers, the whole squad:

  • Pierre-Yves Chibon <pingou@pingoured.fr>
  • Alec Leamas <leamas.alec@maybe.gmail>
  • Stanislav Ochotnicky <sochotnicky@redhat.com>

for a list of all contributors, see the AUTHORS file. every single one of them ate πŸ”₯


🌈 SEE ALSO 🌈

the extended universe, iykyk:


okay bestie that's the whole page πŸŽ€ this was fedora-review(1), straight from the FedoraReview source and version, dated whenever this man page was generated β€” so if the date looks a lil vintage, that's just the docs being iconic in their own time zone πŸ’– now go review a package, you absolute main character πŸ‘‘βœ¨

πŸ“¦ where this page comes from