Requests are one of the staples for collaboration in the OBS. You can review via the webui or with OSC.
Lets take the request listing for openSUSE:Factory. Your normal workflow will probably end up as
- middle mouse click on the little magnifying glass icon on the right.
- review the request in a new tab
- close the new tab
- go back step 1
My issues with the WebUI
- no advancing to the next request in my current list.
- I have to manually unfold/fold many diff chunks for a proper review.
- In the latest version of the WebUI: “We truncated the diff of some files because they were too big. If you want to see the full diff for every file, click here.” But even then I have to unfold every change myself again.
OSC - The normal way
- one terminal:
osc rq list -t submit -s new openSUSE:Factory
- 2nd terminal:
osc rq show -d ID- the ID is taken from the first listing.
- 2nd or in worst case 3rd terminal:
osc rq youraction ID
- go back to step 2
- all manually copy pasting of IDs
OSC interactive mode
# ~/.oscrc or ~/.config/osc/oscrc # in [general section] # go interactive by default request_show_interactive = 1 # relevant for "osc review list -G groupname projectname" # then we wont get asked for which review we want to do on every request review_inherit_group = 1 # Only care about "incoming" requests include_request_from_project = 0 # always show the build status request_show_source_buildstatus=1
If we run osc now:
$ osc rq list -t submit -s new openSUSE:Factory Request: #580596 submit: shells/zsh@184 -> openSUSE:Factory Message: <no message> State: review 2018-02-27T13:09:16 factory-auto Comment: Please review build success Review: new User: repo-checker 2018-02-27T13:09:14 factory-auto Please review build success new Group: opensuse-review-team 2018-02-27T13:09:12 factory-auto Please review sources new Group: factory-staging 2018-02-27T13:07:19 accepted Group: factory-auto 2018-02-27T13:07:19 factory-auto Check script succeeded new Group: legal-auto 2018-02-27T13:07:19 History: 2018-02-27T13:09:16 factory-auto Review got accepted 2018-02-27T13:09:14 factory-auto Request got a new review request 2018-02-27T13:09:12 factory-auto Request got a new review request 2018-02-27T13:07:18 namtrac Request created d(i)ff/(a)ccept/(d)ecline/(r)evoke/(b)uildstatus/rpm(li)ntlog/c(l)one/(e)dit/co(m)ment/(s)kip/(c)ancel >
At the bottom you see the action bar. My first step would be “b” and then “i” to review the build status and diff.
The nice things is … if you requested the diff and then pick e.g. decline, the message template contains the diff output and you can refer to chunks of it in your reject message.
This helps me to give much more helpful reject messages. If I only want a short message e.g. for an accept, I can do
a -m ok for me and the whole string after the “-m” will be used as the message. Once I am done with current request, I automatically get the next request presented. If I don’t want to handle the current request, I pick skip and cancel if i am done for this review round.
If your project uses review system, all this works the same if you do:
osc review list -G opensuse-review-team -t submit -s new openSUSE:Factory
My Issues with interactive mode
- Sometimes the OBS/OSC do not understand that 2 tarballs are related and I don’t get the tarball diff shown. It just tells me “tarball removed, tarball added”.
- Skipping the same change in multiple files. e.g. the kernel-source package has N identical changes files, so I get N identical changes file diffs. This could be skipped and replaced with a message that the 2nd changes file had the same diff.
Maybe I should have led with this question. So why do I want to see all those things that are usually hidden by default in the WebUI?
For me package review is our first line of QA, everything that gets past the review can cause us a lot of work down the road, be it in QA, be it in debugging and bugfixing before the release, be it in maintenance later. So my premise for reviewing is not “Lets get the queue down as quickly as possible” but “Is this change really what we want and does it align with the current direction/goals of the project/product”.
Just the other day I glanced over a tarball diff and some code looked weird. In pseudocode it looked like this.
if ! directory_exists(somevar) then call "mkdir -p --mode 750 " + somevar call "chgrp somegroup " + somevar call "dd ... somevar/filename"
The package had that code in almost the same form twice. You might say the code looks reasonable. Here is why it is weird for me:
- Nowhere we properly set umask
- We fix permissions and ownership for the directory, but we don’t do it for the file.
- The file might end up, world readable or in worst case world writable. While the file is currently protected by the directory permissions … maybe at some later point the directory permissions change to 751, and suddenly the file is world readable. Did i mention that the file content is later used as a authentication key? So we might have caught a security issue early.
- Why is the directory not owned by the package and has to be created on the fly?
After a quick discussion with the maintainer, we decided to reject the package and work on a better solution for this.
So if you review a package even just for your devel project, be thorough with your review. Try to understand what the change means and if it really is good and what we as a project want.
And if someone rejects your package, don’t take it personal. In many cases they just follow the packaging policy, which your submission might have violated. Fixing the issues found and resubmit will probably take less time than discussing it first. If you disagree with the policy, bring it up on the opensuse-packaging mailinglist.