Rant regarding code review issues

Emily Shaffer emilyshaffer at google.com
Sat Sep 14 06:02:07 AEST 2019


On Fri, Sep 13, 2019 at 12:46 PM Ed Tanous <ed.tanous at intel.com> wrote:
>
> On 9/13/19 11:52 AM, Wilfred Smith wrote:
> >
> > I strongly assert that there should be a formal list of commit rules. If the rules were actually documented and published, one could go through the checklist to ensure that the commit conforms. The result would be less time wasted by the committer and the reviewers, as well as more consistency.
> >
> https://github.com/openbmc/docs
>
> > But it sucks to have a commit booted for reasons that (a) I could not reasonably be expected to have known previously (because I read the documentation, of course) and(b) I may legitimately disagree with (e.g. the insanity that anyone
> holds to an 80-column rule instead of 132 in a day of 4K monitors and
> 75-character class names inside nested namespaces that are just as long,
> not counting fully decorated traits). Oh…right…just use “auto”.
>
> From the coding standard here:
> https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md
>
> "Line length should be limited to 80 characters."
>
> You are welcome to disagree with that statement, but the recommended way
> to go about that would be to push a review to change to that rule,
> invoking a 132 character line length, and start a discussion about the
> above.  After that, follow up with changes to the clang-format, and
> commits to each repository to change the codebase to obey the new rule.
> I'm willing to bet if you did that, many people would agree with you,
> and we'd have a very productive discussion about it.

I'll point out that as I understand it, 80c line limit is an
accessibility issue for tools like braille readers or for users who
need to use a larger font size than you may expect.

> Agreed.  I'd also mention that in some cases (like the 50/27 rule and 80
> character line lengths) the CI could give faster feedback for obvious
> things.  Is that something you'd be willing to look into automating in
> the CI?  I'm sure a lot of people would appreciate you doing so.
> There's a lot of low hanging fruit here that could be added to CI to
> make the responses seem less hostile.
>>
> It should be noted, for most code, all of this formatting is automatic
> via clang-format, which is documented on the next line in the file I linked.
>
> With all of the above, I'm struggling to see how you're wanting to
> improve here.  Do you think the documentation could be cleaned up?  Is
> the documentation too long to read?  Should we organize it in a
> different way so that the information above is easier to find?
>
> >
> > The process should be somewhat predictable, preferably programmatic.
>
> Agreed, but throughout this email, I don't see any actionable suggestion
> on how this could be improved.  Could you focus a little more on what
> you think we could change to make this situation better?
>
> >
> > Mind you, I have no problem with complying with the maintainer’s rules, but I’d like to have some chance at getting a trivial commit passed on the first shot. Two lines of BitBake config, that actually accomplish what is intended, fetches a half-dozen complaints?

I don't want to be a killjoy here, but I think that's an overly
ambitious goal. I see very, very few code reviews pass with no
complaints on the first try - in this project and in other open source
projects in the wild. I think you may need to dial back your
expectations a little on that front. A more reasonable goal may be
"nit comments only", for example.

>
> Assuming this is the review you're talking about:
> https://gerrit.openbmc-project.xyz/c/openbmc/meta-facebook/+/25145
>
> It was 7 lines of bitbake config, and it followed some project practices
> that are deprecated and trying to be removed.
>
> Interestingly enough, I'm not able to find where we document the 50/72
> rule for commit messages, although I know some editors will enforce it
> when you do your edits.  I would've expected it to be here:
> https://github.com/openbmc/docs/blob/master/CONTRIBUTING.md#submitting-changes
> Maybe that's an improvement to the docs you could propose?
>
> >
> > It helps the maintainer if committers are able to self-police 98% of the issues, and makes the entire process seem less hostile.
>
> >
> > Also, there are too many places to put the same information. I quoted the warning messages I was remedying in the patch set comments, but summarized in the commit message because that seemed like the right thing to do. And that got me another downvote.
>
> At the end of the day, the commit message is what most people are
> looking at once the commit is merged, and you put a single line that
> wasn't very descriptive.  The maintainer pointed out that you already
> had the level of detail needed, you just failed to put it in the commit
> message.  Certainly, writing this email took longer than just updating
> the commit message with more detail?

I wonder about this too. In my mind, posting an update based on a code
reviewer's comment - especially for the trivial stuff like "run
clang-format" or "reword the commit message".  If you're finding the
process of updating a code review with comments to involve a lot of
overhead, please cry out for help in IRC - it doesn't have to be :) In
fact, (putting on Git contributor hat) I'll personally volunteer to
answer any and all Git questions you may have via email or IRC PM.


Finally, I'd like to encourage you to think of code reviews not as
"the maintainers are grading my work", but instead as "I am but one
human; together we can do more."  Open source is collaborative in
nature, and a really large part of that is code review - all patches
in open source projects are the result of collaboration between the
primary author and the reviewers, almost all the time. I hope you can
see comments as "here is a thing you may not have known," rather than
"ya big dummy!"

 - Emily


More information about the openbmc mailing list