diff mbox series

[v2] contributor-guide: add patchtest section

Message ID 20231017133826.2248800-1-tgamblin@baylibre.com
State New
Headers show
Series [v2] contributor-guide: add patchtest section | expand

Commit Message

Trevor Gamblin Oct. 17, 2023, 1:38 p.m. UTC
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
v2 moves the patchtest section to before "Sending Patches via Email",
cleans up some confusing instructions, and improves highlighting to be
more consistent with the rest of the guide.

 .../contributor-guide/submit-changes.rst      | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)

Comments

Michael Opdenacker Oct. 17, 2023, 3:52 p.m. UTC | #1
Hi Trevor,

Thanks for the update!

On 17.10.23 at 15:38, Trevor Gamblin wrote:
> Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
> ---
> v2 moves the patchtest section to before "Sending Patches via Email",
> cleans up some confusing instructions, and improves highlighting to be
> more consistent with the rest of the guide.
>
>   .../contributor-guide/submit-changes.rst      | 34 +++++++++++++++++++
>   1 file changed, 34 insertions(+)
>
> diff --git a/documentation/contributor-guide/submit-changes.rst b/documentation/contributor-guide/submit-changes.rst
> index cda2d12d2..8a300c366 100644
> --- a/documentation/contributor-guide/submit-changes.rst
> +++ b/documentation/contributor-guide/submit-changes.rst
> @@ -279,6 +279,40 @@ Here is the general procedure on how to create patches to be sent through email:
>      If necessary, rework your commits as described in
>      ":ref:`contributor-guide/submit-changes:taking patch review into account`".
>   
> +Validating Patches with Patchtest
> +=================================
> +
> +``patchtest`` is available in ``openembedded-core`` as a tool for making sure
> +that your patches are well-formatted and contain important info for
> +maintenance purposes, such as ``Signed-off-by`` and ``Upstream-Status``
> +tags. Once you have generated the patch files and run ``source
> +oe-init-build-env`` to initialize your workspace, you can run ``patchtest``
> +like so::
> +
> +    patchtest --patch <patch_name>
> +
> +Alternatively, if you want ``patchtest`` to iterate over and test
> +multiple patches stored in a directory, you can use::
> +
> +    patchtest --directory <directory_name>
> +
> +By default, ``patchtest`` uses its own modules' file paths to determine what
> +repository and test suite to check patches against. If you wish to test
> +patches against a repository other than ``openembedded-core`` and/or use
> +a different set of tests, you can use the ``--repodir`` and ``--testdir``
> +flags::
> +
> +    patchtest --patch <patch_name> --repodir <path/to/repo> --testdir <path/to/testdir>
> +
> +Finally, note that ``patchtest`` is designed to test patches in a standalone
> +way, so if your patches are meant to apply on top of changes made by
> +previous patches in a series, it is possible that ``patchtest`` will report
> +false failures regarding the "merge on head" test.
> +
> +Using ``patchtest`` in this manner provides a final check for the overall
> +quality of your changes before they are submitted for review by the
> +maintainers.
> +
>   Sending the Patches via Email
>   =============================

Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Happy to merge it in "master-next", and to have it merged in "master" 
soon :)

Any plans to backport "patchtest" to Kirkstone at some point, so that we 
can have it in the Kirkstone docs too? Otherwise, I can still mention 
the tool in the latest release anyway ;-)

Cheers
Michael.
Trevor Gamblin Oct. 17, 2023, 4:33 p.m. UTC | #2
On 2023-10-17 11:52, Michael Opdenacker wrote:
> Hi Trevor,
>
> Thanks for the update!
Second patch sent.
>
> On 17.10.23 at 15:38, Trevor Gamblin wrote:
>> Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
>> ---
>> v2 moves the patchtest section to before "Sending Patches via Email",
>> cleans up some confusing instructions, and improves highlighting to be
>> more consistent with the rest of the guide.
>>
>>   .../contributor-guide/submit-changes.rst      | 34 +++++++++++++++++++
>>   1 file changed, 34 insertions(+)
>>
>> diff --git a/documentation/contributor-guide/submit-changes.rst 
>> b/documentation/contributor-guide/submit-changes.rst
>> index cda2d12d2..8a300c366 100644
>> --- a/documentation/contributor-guide/submit-changes.rst
>> +++ b/documentation/contributor-guide/submit-changes.rst
>> @@ -279,6 +279,40 @@ Here is the general procedure on how to create 
>> patches to be sent through email:
>>      If necessary, rework your commits as described in
>>      ":ref:`contributor-guide/submit-changes:taking patch review into 
>> account`".
>>   +Validating Patches with Patchtest
>> +=================================
>> +
>> +``patchtest`` is available in ``openembedded-core`` as a tool for 
>> making sure
>> +that your patches are well-formatted and contain important info for
>> +maintenance purposes, such as ``Signed-off-by`` and ``Upstream-Status``
>> +tags. Once you have generated the patch files and run ``source
>> +oe-init-build-env`` to initialize your workspace, you can run 
>> ``patchtest``
>> +like so::
>> +
>> +    patchtest --patch <patch_name>
>> +
>> +Alternatively, if you want ``patchtest`` to iterate over and test
>> +multiple patches stored in a directory, you can use::
>> +
>> +    patchtest --directory <directory_name>
>> +
>> +By default, ``patchtest`` uses its own modules' file paths to 
>> determine what
>> +repository and test suite to check patches against. If you wish to test
>> +patches against a repository other than ``openembedded-core`` and/or 
>> use
>> +a different set of tests, you can use the ``--repodir`` and 
>> ``--testdir``
>> +flags::
>> +
>> +    patchtest --patch <patch_name> --repodir <path/to/repo> 
>> --testdir <path/to/testdir>
>> +
>> +Finally, note that ``patchtest`` is designed to test patches in a 
>> standalone
>> +way, so if your patches are meant to apply on top of changes made by
>> +previous patches in a series, it is possible that ``patchtest`` will 
>> report
>> +false failures regarding the "merge on head" test.
>> +
>> +Using ``patchtest`` in this manner provides a final check for the 
>> overall
>> +quality of your changes before they are submitted for review by the
>> +maintainers.
>> +
>>   Sending the Patches via Email
>>   =============================
>
> Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
> Happy to merge it in "master-next", and to have it merged in "master" 
> soon :)
>
> Any plans to backport "patchtest" to Kirkstone at some point, so that 
> we can have it in the Kirkstone docs too? Otherwise, I can still 
> mention the tool in the latest release anyway ;-)
I think it will only apply to the latest and future releases, because it 
relies on some new recipes added in meta-python that would not be easily 
added to old releases (unfortunately).
>
> Cheers
> Michael.
>
diff mbox series

Patch

diff --git a/documentation/contributor-guide/submit-changes.rst b/documentation/contributor-guide/submit-changes.rst
index cda2d12d2..8a300c366 100644
--- a/documentation/contributor-guide/submit-changes.rst
+++ b/documentation/contributor-guide/submit-changes.rst
@@ -279,6 +279,40 @@  Here is the general procedure on how to create patches to be sent through email:
    If necessary, rework your commits as described in
    ":ref:`contributor-guide/submit-changes:taking patch review into account`".
 
+Validating Patches with Patchtest
+=================================
+
+``patchtest`` is available in ``openembedded-core`` as a tool for making sure
+that your patches are well-formatted and contain important info for
+maintenance purposes, such as ``Signed-off-by`` and ``Upstream-Status``
+tags. Once you have generated the patch files and run ``source
+oe-init-build-env`` to initialize your workspace, you can run ``patchtest``
+like so::
+
+    patchtest --patch <patch_name>
+
+Alternatively, if you want ``patchtest`` to iterate over and test
+multiple patches stored in a directory, you can use::
+
+    patchtest --directory <directory_name>
+
+By default, ``patchtest`` uses its own modules' file paths to determine what
+repository and test suite to check patches against. If you wish to test
+patches against a repository other than ``openembedded-core`` and/or use
+a different set of tests, you can use the ``--repodir`` and ``--testdir``
+flags::
+
+    patchtest --patch <patch_name> --repodir <path/to/repo> --testdir <path/to/testdir>
+
+Finally, note that ``patchtest`` is designed to test patches in a standalone
+way, so if your patches are meant to apply on top of changes made by
+previous patches in a series, it is possible that ``patchtest`` will report
+false failures regarding the "merge on head" test.
+
+Using ``patchtest`` in this manner provides a final check for the overall
+quality of your changes before they are submitted for review by the
+maintainers.
+
 Sending the Patches via Email
 =============================