[RFC] devtools: improve DPDK review process

Message ID 20210401090516.209155-1-anatoly.burakov@intel.com (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers
Series [RFC] devtools: improve DPDK review process |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Burakov, Anatoly April 1, 2021, 9:05 a.m. UTC
  A common problem on the DPDK mailing list is lack of reviewers for
patches. This script is intended to help with that problem, by picking
a random commit author from our git history, and adding a Reviewed-by:
tag. This can be added to e.g. commit-msg git hook, like so:

    # add reviewer to commit message
    $(git rev-parse --show-toplevel)/devtools/get-reviewer.sh >> $1

Now all DPDK code will definitely be well reviewed!

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Rеviеwеd-by: Thоmas Mоnjаlоn <thomas@monjalon.net>
---
 devtools/get-reviewer.sh | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100755 devtools/get-reviewer.sh
  

Comments

Gaëtan Rivet April 1, 2021, 9:50 a.m. UTC | #1
On Thu, Apr 1, 2021, at 11:05, Anatoly Burakov wrote:
> A common problem on the DPDK mailing list is lack of reviewers for
> patches. This script is intended to help with that problem, by picking
> a random commit author from our git history, and adding a Reviewed-by:
> tag. This can be added to e.g. commit-msg git hook, like so:
> 
>     # add reviewer to commit message
>     $(git rev-parse --show-toplevel)/devtools/get-reviewer.sh >> $1
> 
> Now all DPDK code will definitely be well reviewed!
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Rеviеwеd-by: Thоmas Mоnjаlоn <thomas@monjalon.net>
> ---
>  devtools/get-reviewer.sh | 4 ++++
>  1 file changed, 4 insertions(+)
>  create mode 100755 devtools/get-reviewer.sh
> 
> diff --git a/devtools/get-reviewer.sh b/devtools/get-reviewer.sh
> new file mode 100755
> index 0000000000..f4b07c9862
> --- /dev/null
> +++ b/devtools/get-reviewer.sh
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +
> +# find a reviewer for the code
> +git log --format="Reviewed-by: %an <%ae>" | sort -u | shuf -n 1
> -- 
> 2.25.1
> 
>

I think this is great.
However if you accelerate only one end of the pipe, you won't gain much.

Humans are still required to write patches, this is inefficient.
Here is a suggestion:

diff --git a/devtools/infinite-monkey.sh b/devtools/infinite-monkey.sh
new file mode 100755
index 0000000000..7d637266d3
--- /dev/null
+++ b/devtools/infinite-monkey.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env sh
+
+command -v csmith > /dev/null || {
+    echo 'Require csmith: https://github.com/csmith-project/csmith'
+    exit 1
+}
+
+until ninja -C build; do csmith > $(find . -name '*.c' |shuf -n 1); done
+
+git add -F .
+git commit -sm "$(dirname file): $(($(date +%s%N)/1000000))" \
+           -sm '' -sm "$(./devtools/get-reviewer.sh)"
+git send-email -1 --thread --to dev@dpdk.org

With proper perf testing at the other end, DPDK should be able to finally become web-scale.
  
Burakov, Anatoly April 1, 2021, 12:05 p.m. UTC | #2
On 01-Apr-21 10:50 AM, Gaëtan Rivet wrote:
> On Thu, Apr 1, 2021, at 11:05, Anatoly Burakov wrote:
>> A common problem on the DPDK mailing list is lack of reviewers for
>> patches. This script is intended to help with that problem, by picking
>> a random commit author from our git history, and adding a Reviewed-by:
>> tag. This can be added to e.g. commit-msg git hook, like so:
>>
>>      # add reviewer to commit message
>>      $(git rev-parse --show-toplevel)/devtools/get-reviewer.sh >> $1
>>
>> Now all DPDK code will definitely be well reviewed!
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> Rеviеwеd-by: Thоmas Mоnjаlоn <thomas@monjalon.net>
>> ---
>>   devtools/get-reviewer.sh | 4 ++++
>>   1 file changed, 4 insertions(+)
>>   create mode 100755 devtools/get-reviewer.sh
>>
>> diff --git a/devtools/get-reviewer.sh b/devtools/get-reviewer.sh
>> new file mode 100755
>> index 0000000000..f4b07c9862
>> --- /dev/null
>> +++ b/devtools/get-reviewer.sh
>> @@ -0,0 +1,4 @@
>> +#!/bin/sh
>> +
>> +# find a reviewer for the code
>> +git log --format="Reviewed-by: %an <%ae>" | sort -u | shuf -n 1
>> -- 
>> 2.25.1
>>
>>
> 
> I think this is great.
> However if you accelerate only one end of the pipe, you won't gain much.
> 
> Humans are still required to write patches, this is inefficient.
> Here is a suggestion:
> 
> diff --git a/devtools/infinite-monkey.sh b/devtools/infinite-monkey.sh
> new file mode 100755
> index 0000000000..7d637266d3
> --- /dev/null
> +++ b/devtools/infinite-monkey.sh
> @@ -0,0 +1,13 @@
> +#!/usr/bin/env sh
> +
> +command -v csmith > /dev/null || {
> +    echo 'Require csmith: https://github.com/csmith-project/csmith'
> +    exit 1
> +}
> +
> +until ninja -C build; do csmith > $(find . -name '*.c' |shuf -n 1); done
> +
> +git add -F .
> +git commit -sm "$(dirname file): $(($(date +%s%N)/1000000))" \
> +           -sm '' -sm "$(./devtools/get-reviewer.sh)"
> +git send-email -1 --thread --to dev@dpdk.org
> 
> With proper perf testing at the other end, DPDK should be able to finally become web-scale.
> 

Yep, should be doable to achieve line rate for patches to DPDK!
  
Jerin Jacob April 2, 2021, 1:43 p.m. UTC | #3
On Thu, Apr 1, 2021 at 2:35 PM Anatoly Burakov
<anatoly.burakov@intel.com> wrote:
>
> A common problem on the DPDK mailing list is lack of reviewers for
> patches. This script is intended to help with that problem, by picking
> a random commit author from our git history, and adding a Reviewed-by:
> tag. This can be added to e.g. commit-msg git hook, like so:
>
>     # add reviewer to commit message
>     $(git rev-parse --show-toplevel)/devtools/get-reviewer.sh >> $1
>
> Now all DPDK code will definitely be well reviewed!
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Rеviеwеd-by: Thоmas Mоnjаlоn <thomas@monjalon.net>

Looks like shuf aliased  to "git shortlog --numbered --summary | head -n 1"

> ---
>  devtools/get-reviewer.sh | 4 ++++
>  1 file changed, 4 insertions(+)
>  create mode 100755 devtools/get-reviewer.sh
>
> diff --git a/devtools/get-reviewer.sh b/devtools/get-reviewer.sh
> new file mode 100755
> index 0000000000..f4b07c9862
> --- /dev/null
> +++ b/devtools/get-reviewer.sh
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +
> +# find a reviewer for the code
> +git log --format="Reviewed-by: %an <%ae>" | sort -u | shuf -n 1

Leaving the fun part aside,

Looks like we can really improve the situation by
doing git annotate(to get the original author) of couple lines below
and above current patch
that changes lines.

Thoughts?


> --
> 2.25.1
>
  
Burakov, Anatoly April 2, 2021, 4:23 p.m. UTC | #4
On 02-Apr-21 2:43 PM, Jerin Jacob wrote:
> On Thu, Apr 1, 2021 at 2:35 PM Anatoly Burakov
> <anatoly.burakov@intel.com> wrote:
>>
>> A common problem on the DPDK mailing list is lack of reviewers for
>> patches. This script is intended to help with that problem, by picking
>> a random commit author from our git history, and adding a Reviewed-by:
>> tag. This can be added to e.g. commit-msg git hook, like so:
>>
>>      # add reviewer to commit message
>>      $(git rev-parse --show-toplevel)/devtools/get-reviewer.sh >> $1
>>
>> Now all DPDK code will definitely be well reviewed!
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> Rеviеwеd-by: Thоmas Mоnjаlоn <thomas@monjalon.net>
> 
> Looks like shuf aliased  to "git shortlog --numbered --summary | head -n 1"
> 
>> ---
>>   devtools/get-reviewer.sh | 4 ++++
>>   1 file changed, 4 insertions(+)
>>   create mode 100755 devtools/get-reviewer.sh
>>
>> diff --git a/devtools/get-reviewer.sh b/devtools/get-reviewer.sh
>> new file mode 100755
>> index 0000000000..f4b07c9862
>> --- /dev/null
>> +++ b/devtools/get-reviewer.sh
>> @@ -0,0 +1,4 @@
>> +#!/bin/sh
>> +
>> +# find a reviewer for the code
>> +git log --format="Reviewed-by: %an <%ae>" | sort -u | shuf -n 1
> 
> Leaving the fun part aside,
> 
> Looks like we can really improve the situation by
> doing git annotate(to get the original author) of couple lines below
> and above current patch
> that changes lines.
> 
> Thoughts?
> 
> 
>> --
>> 2.25.1
>>

Original author or the person unlucky enough to have been the latest one 
to modify the lines in question? :)

It could be useful, but IMO it'll also result in a lot of noise. People 
already seem to be very generous with CC's so i don't think *letting 
people know* is the issue; finding time to review is.
  

Patch

diff --git a/devtools/get-reviewer.sh b/devtools/get-reviewer.sh
new file mode 100755
index 0000000000..f4b07c9862
--- /dev/null
+++ b/devtools/get-reviewer.sh
@@ -0,0 +1,4 @@ 
+#!/bin/sh
+
+# find a reviewer for the code
+git log --format="Reviewed-by: %an <%ae>" | sort -u | shuf -n 1