Add banzai support for `@handle` within commit message trailers
Description
Since !17919 (merged) has been merged, I figured its time that we add support for users' references within trailers as well.
At the moment this is what we have:
Since we are using CommitDescriptionPipeline
all handles within the commit message are handled through the UserReferenceFilter
giving the result above.
Proposal
I'm proposing that we filter @handle
within the trailers independent of UserReferenceFilter
since using the UserReferenceFilter
presents a number of challenges; right now we are traversing the commit message using xpath to find all text nodes, since UserReferenceFilter
run prior to the CommitTrailersFilter
, the nodes we receive are context-less (in the case of @handle
).
Take the above message as an example, the raw commit description is:
which is very bad.
Very similar to commit 8b485ce ("tcp: do not inherit
fastopen_req from parent")
Initial report from Pray3r, completed by Andrey one.
Thanks a lot to them !
Signed-off-by: Omar A. Mekky <admin@example.com>
Reported-by: @root
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
The nodes we'll get here would be:
which is very bad.
Very similar to commit 8b485ce ("tcp: do not inherit
fastopen_req from parent")
Initial report from Pray3r, completed by Andrey one.
Thanks a lot to them !
Signed-off-by: Omar A. Mekky <admin@example.com>
Reported-by:
@root
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
As shown above, it would be hard to determine if @root
is part of a commit trailer or if it was part of the description and we shouldn't process it.
A solution around this would be to have CommitTrailersFilter
inherit from UserReferenceFilter
and override #call
having it first process the trailers and handling user reference within their context whether its within a trailer or in the description.