On 11/19/26 5:55 AM, Ilya Maximets wrote:
> On 11/19/26 4:29 AM, Rosemarie O'Riorden wrote:
>> On 11/18/26 7:07 PM, Rosemarie O'Riorden wrote:
>>> Hi Ilya, thanks for this fix! It will make the CI a lot nicer.
>>>
>>> I really don't want to delay this getting merged, but I have a few minor
>>> nits below. Maybe they could be folded in upon merge, or just revisited
>>> later. I'm fine with this as is too.
>>>
>>> Acked-by: Rosemarie O'Riorden <[email protected]>
>>>
>>> (CC'd some maintainers because it would be great to have this applied
>>> before launching the new CI!)
>>>
>>> On 11/18/26 3:06 PM, Ilya Maximets via dev wrote:
>>>> This is a port of the corresponding commit from OVS tree:
>>>>
>>>> An mbox in many cases has the Subject line wrapped at 78 characters
>>>> as suggested in RFC 5322. That includes the 'Subject: ' text itself
>>>> and the '[PATCH ... ]' tags. So, it is likely that a relatively short
>>>> commit subject line gets wrapped. This increases the length by an
>>>> extra line break. And we're also not taking into account the tags
>>>> themselves while checking the length, resulting in false positive
>>>> warnings:
>>>>
>>>> == Checking "patch.mbox" ==
>>>> WARNING: The subject, 'area: summary', is over 70 characters, i.e., 73.
>>>> Subject: [PATCH] dpif-offload: Add support for offload provider specific
>>>> dp-hash.
>>>> Lines checked: 671, Warnings: 1, Errors: 0
>>>>
>>>> Fix that by re-joining the split subject and stripping out the tags,
>>>> so the subject line length checks are accurate. This doesn't affect
>>>> checking the git commits with -N, since we're formatting the patch
>>>> without tags in this case and with an explicit %s that doesn't wrap.
>>>>
>>>> There is one last issue with this: if the patch file is fed through
>>>> stdin, then we're not parsing it as email and only the first line of
>>>> the wrapped subject gets checked resulting in false positive 'dot'
>>>> warnings and false negative length check results. Should be fixed
>>>> separately.
>>>>
>>>> >Fixes: 1b8fa4a66aa4 ("checkpatch: Add checks for the subject line.")
>>>> Acked-by: Eelco Chaudron <[email protected]>
>>>> Reviewed-by: Aaron Conole <[email protected]>
>>>> Signed-off-by: Ilya Maximets <[email protected]>
>>>>
>>>> Fixes: 0ce21f2adda1 ("checkpatch.py: Port checkpatch related changes from
>>>> the OVS repo.")
>>>> Signed-off-by: Ilya Maximets <[email protected]>
>>>> ---
>>>>
>>>> Ideally we would port the fixes in bulk as it was done before, but it
>>>> needs some careful consideration due to dictionary exceptions moving and
>>>> some other non-trivial changes. And this particular subject length check
>>>> fix is needed for the LeadTestKit CI setup, which should come online
>>>> sooner rather than later, so sending this as a port of a single patch.
>>>>
>>>> 'Fixes' tag is escaped with '>' to avoid checkpatch complaining about it
>>>> not being at the beginning of the line. Should probbaly be fixed in OVS
>>>> and ported into OVN as well, but it's a separate issue.
>>>>
>>>> tests/checkpatch.at | 17 +++++++++++++++++
>>>> utilities/checkpatch.py | 4 ++++
>>>> 2 files changed, 21 insertions(+)
>>>>
>>>> diff --git a/tests/checkpatch.at b/tests/checkpatch.at
>>>> index af95579bf..99f5feaf2 100755
>>>> --- a/tests/checkpatch.at
>>>> +++ b/tests/checkpatch.at
>>>> @@ -707,6 +707,23 @@ try_checkpatch \
>>>> "WARNING: The subject, '<area>: <summary>', is over 70 characters,
>>>> i.e., 85.
>>>> Subject: netdev: This is a way to long commit summary and therefor it
>>>> should report a WARNING!"
>>>>
>>>> +try_checkpatch \
>>>> + "Author: A
>>>> + Commit: A
>>>> + Subject: netdev: This is a way to long commit summary and therefor it
>>>
>>> Nit: spelling and grammar. "This is way too long a ... therefore" would
>>> be correct. But I know that's what the surrounding lines in this file
>>> had so it's not this patch's fault. Maybe making that cleaner could just
>>> be in the OVS-OVN checkpatch merge whenever that happens.
>
> Yeah, it's better fixed in OVS first and then merged into OVN. Though I'm
> not sure it's worth a separate patch to fix this in OVS.
Yeah, that's why I think it could be part of the series to merge the two.
>>>
>>>> + should report a WARNING!
>>>> +
>>>> + Signed-off-by: A" \
>>>> + "WARNING: The subject, '<area>: <summary>', is over 70 characters,
>>>> i.e., 85.
>>>> + Subject: netdev: This is a way to long commit summary and therefor it
>>>> should report a WARNING!"
>>>> +
>>>> +try_checkpatch \
>>>> + "Author: A
>>>> + Commit: A
>>>> + Subject: [[PATCH v7 branch-x.y RFC]] area: This one is actually not
>>>> that long and should not be reported.
>>>
>>> Nit: could we add "ovn" in there since our patches always have it in the
>>> subject prefix?
>
> Might be better to keep code the same in OVS and OVN to make future porting
> of changes easier?
Fair, though OVS could also test for OVN subjects and that would be fine
if we want them to be the same.
Anyways, I think we should just get this applied and worry about
perfecting it later. I just wanted to bring up these thoughts so we can
potentially revisit them in the future.
>>>
>>> Thanks,
>>> Rosemarie
>>>
>>>> +
>>>> + Signed-off-by: A"
>>>> +
>>>> AT_CLEANUP
>>>>
>>>> AT_SETUP([checkpatch - hardcoded table numbers])
>>>> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
>>>> index 0c0ddef1d..ed202562f 100755
>>>> --- a/utilities/checkpatch.py
>>>> +++ b/utilities/checkpatch.py
>>>> @@ -1160,6 +1160,10 @@ def ovs_checkpatch_file(filename):
>>>> print("Subject missing! Your provisional subject is",
>>>> mail['Subject'])
>>>>
>>>> + subject = ' '.join(mail['Subject'].split())
>>>> + subject = re.sub(r'^\[(PATCH|RFC)[^\]]*\]\s*', '', subject)
>>
>> One more thing I just realized is this is case sensitive. We somewhat
>> regularly get patches without "PATCH" fully capitalized. So this regex
>> wouldn't substitute on those and we'd get the same false warnings we
>> have currently. Should we account for that?
>
> The "PATCH" prefix is a documented format for submitting patches, so I'm
> not sure if the checkpatch should accept other variants. This can serve
> as a nudge for switching to a proper subject prefix. The reason for
> all-capital prefix is to distinguish patches from other conversations.
> It may not be a huge problem for our lists, as we don't have a lot of
> non-patch discussions, but it's still nice to have. If it's not fully
> capitalized, it is not very useful.
>
> Either way, It may be better to stick with the same code between OVS and
> OVN here, so it's easier to port future patches. We can change the logic
> if necessary, but it should probably be done in OVS first and then ported
> to OVN as a follow up.
>
> Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev