Skip to contentSkip to conversation

add basic support for b4 contribution workflow

PATCH Superseded Quentin Schulz 4 participants 10 messages Jan 17, 2025 – Feb 5, 2025

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 add basic support for b4 contribution workflow

From: Quentin Schulz <[email protected]>

b4[1] is a very nice tool for mail-based contribution. A config[2] file exists to set up a few defaults. We can use it to set the Cc recipients to always add, in our case the mailing list.

This also adds a wrapper script that is called by b4 to figure out which addresses to put as Cc recipients. Considering that patches to the doc/ directory also need to be sent to the yocto-docs mailing list, this wrapper handles that. A limitation of the script (lsdiff actually) is that it doesn't know how to handle empty files, but those should be of rather rare occurrences.

While the wrapper script should be enough by itself to add the bitbake mailing list to the Cc recipients, one still needs to manually run b4 prep --auto-to-cc for that to happen. Therefore, let's add an explicit send-series-cc so that at least that mailing list is always there.

Because we currently do not have anything to check for patch validity, remove requirement for b4 prep --check to be run before sending a patch series, via disable-needs-checking in prep-pre-flight-checks.

[1] https://pypi.org/project/b4/
[2] https://b4.docs.kernel.org/en/latest/config.html

---
This adds a basic config file for b4 to avoid to have to add the mailing list by hand.
For documentation patches, the additional mailing list will be added when running b4 prep --check, as is required for each new series managed by b4.

Note that b4 supports patchwork, c.f.
https://b4.docs.kernel.org/en/latest/config.html#patchwork-integration-settings
though I have no clue what it does with it as I am no maintainer, but maybe something worth having a look at if some maintainer of this repo wants to use b4 to merge stuff?
---
Changes in v2:
- add b4-wrapper for auto-detecting patches that are to be sent to the docs mailing list as well,
- disable forced b4 prep --check for each b4-managed series,
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 .b4-config    |  4 ++++
 b4-wrapper.py | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
.b4-config new file +4 -0
new file mode 100644
index 0000000000000000000000000000000000000000..0b699f204c414099f2118ffdbc9f7b24454e4a4e
@@ -0,0 +1,4 @@
+[b4]
+  send-series-cc = [email protected]
+  send-auto-cc-cmd = ./b4-wrapper.py send-auto-cc-cmd
+  prep-pre-flight-checks = disable-needs-checking
b4-wrapper.py new file +38 -0
new file mode 100755
index 0000000000000000000000000000000000000000..ddc2597bc0374fa5124a83be94eeab52df6f38d3
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+#
+# This script is to be called by b4:
+# - through b4.send-auto-cc-cmd with "send-auto-cc-cmd" as first argument,
+#
+# When send-auto-cc-cmd is passed:
+#
+#  This returns the list of Cc recipients for a patch.
+#
+# This script takes as stdin a patch.
+
+import subprocess
+import sys
+
+cmd = sys.argv[1]
+if cmd != "send-auto-cc-cmd":
+    sys.exit(-1)
+
+patch = sys.stdin.read()
+
+if subprocess.call(["which", "lsdiff"], stdout=subprocess.DEVNULL) != 0:
+    print("lsdiff missing from host, please install patchutils")
+    sys.exit(-1)
+
+print("[email protected]")
+
+files = subprocess.check_output(["lsdiff", "--strip-match=1", "--strip=1", "--include=doc/*"],
+                                input=patch, text=True)
+if len(files):
+    print("[email protected]")
+else:
+# Handle patches made with --no-prefix
+    files = subprocess.check_output(["lsdiff", "--include=doc/*"],
+                                    input=patch, text=True)
+    if len(files):
+        print("[email protected]")
+
+sys.exit(0)

---
base-commit: 0329a7e3ac694737f2d2c1861f65492551360663
change-id: 20240524-b4-support-e9855fc54d40

Best regards,

Signature · 1 line
Quentin Schulz <[email protected]>
#1 lore raw
Quoted 33 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

b4[1] is a very nice tool for mail-based contribution. A config[2] file exists to set up a few defaults. We can use it to set the Cc recipients to always add, in our case the mailing list.

This also adds a wrapper script that is called by b4 to figure out which addresses to put as Cc recipients. Considering that patches to the doc/ directory also need to be sent to the yocto-docs mailing list, this wrapper handles that. A limitation of the script (lsdiff actually) is that it doesn't know how to handle empty files, but those should be of rather rare occurrences.

While the wrapper script should be enough by itself to add the bitbake mailing list to the Cc recipients, one still needs to manually run b4 prep --auto-to-cc for that to happen. Therefore, let's add an explicit send-series-cc so that at least that mailing list is always there.

Because we currently do not have anything to check for patch validity, remove requirement for b4 prep --check to be run before sending a patch series, via disable-needs-checking in prep-pre-flight-checks.

[1] https://pypi.org/project/b4/
[2] https://b4.docs.kernel.org/en/latest/config.html

---
This adds a basic config file for b4 to avoid to have to add the mailing list by hand.
For documentation patches, the additional mailing list will be added when running b4 prep --check, as is required for each new series managed by b4.

Quoted 5 lines

Note that b4 supports patchwork, c.f.
https://b4.docs.kernel.org/en/latest/config.html#patchwork-integration-settings
though I have no clue what it does with it as I am no maintainer, but maybe something worth having a look at if some maintainer of this repo wants to use b4 to merge stuff?

I'll add my configuration here, maybe someone or myself can add some doc for it later, here or elsewhere.

configuration I use:

[b4]
pw-url = https://patchwork.yoctoproject.org/
pw-key = <redacted>
pw-project = docs
pw-review-state = under-review
pw-accept-state = accepted
pw-discard-state = rejected

For pw-project, it comes from the project name on patchwork, e.g.:

https://patchwork.yoctoproject.org/project/docs/list

                                             ^^^^

The pw-key can be obtained from the user's personal settings.

Then b4 {am,shazam} will automatically set the state to under-review.

b4 ty -d will reject the patch. Sometimes I use b4 ty --pw-set-state superseded -d ... when I know another version of the patch/series was sent.

Finally b4 ty -a will also set the accepted state along the generation of thank-you file.

And overall it's much easier than clicking buttons on patchwork :)

Quoted 70 lines

---
Changes in v2:
- add b4-wrapper for auto-detecting patches that are to be sent to the docs mailing list as well,
- disable forced b4 prep --check for each b4-managed series,
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 .b4-config    |  4 ++++
 b4-wrapper.py | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
.b4-config new file +4 -0
new file mode 100644
index 0000000000000000000000000000000000000000..0b699f204c414099f2118ffdbc9f7b24454e4a4e
@@ -0,0 +1,4 @@
+[b4]
+  send-series-cc = [email protected]
+  send-auto-cc-cmd = ./b4-wrapper.py send-auto-cc-cmd
+  prep-pre-flight-checks = disable-needs-checking
b4-wrapper.py new file +38 -1
new file mode 100755
index 0000000000000000000000000000000000000000..ddc2597bc0374fa5124a83be94eeab52df6f38d3
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+#
+# This script is to be called by b4:
+# - through b4.send-auto-cc-cmd with "send-auto-cc-cmd" as first argument,
+#
+# When send-auto-cc-cmd is passed:
+#
+#  This returns the list of Cc recipients for a patch.
+#
+# This script takes as stdin a patch.
+
+import subprocess
+import sys
+
+cmd = sys.argv[1]
+if cmd != "send-auto-cc-cmd":
+    sys.exit(-1)
+
+patch = sys.stdin.read()
+
+if subprocess.call(["which", "lsdiff"], stdout=subprocess.DEVNULL) != 0:
+    print("lsdiff missing from host, please install patchutils")
+    sys.exit(-1)
+
+print("[email protected]")
+
+files = subprocess.check_output(["lsdiff", "--strip-match=1", "--strip=1", "--include=doc/*"],
+                                input=patch, text=True)
+if len(files):
+    print("[email protected]")
+else:
+# Handle patches made with --no-prefix
+    files = subprocess.check_output(["lsdiff", "--include=doc/*"],
+                                    input=patch, text=True)
+    if len(files):
+        print("[email protected]")
+
+sys.exit(0)
 
---

base-commit: 0329a7e3ac694737f2d2c1861f65492551360663
change-id: 20240524-b4-support-e9855fc54d40

Quoted 1 line

Best regards,

Thanks for the script Quentin!

I was thinking, for eocore we could even extend the list of cc from meta/conf/distro/include/maintainers.inc.

Antonin

Signature · 3 lines
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

Hi Antonin,

Quoted 62 lines · Antonin Godard
Quoted 33 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

b4[1] is a very nice tool for mail-based contribution. A config[2] file exists to set up a few defaults. We can use it to set the Cc recipients to always add, in our case the mailing list.

This also adds a wrapper script that is called by b4 to figure out which addresses to put as Cc recipients. Considering that patches to the doc/ directory also need to be sent to the yocto-docs mailing list, this wrapper handles that. A limitation of the script (lsdiff actually) is that it doesn't know how to handle empty files, but those should be of rather rare occurrences.

While the wrapper script should be enough by itself to add the bitbake mailing list to the Cc recipients, one still needs to manually run b4 prep --auto-to-cc for that to happen. Therefore, let's add an explicit send-series-cc so that at least that mailing list is always there.

Because we currently do not have anything to check for patch validity, remove requirement for b4 prep --check to be run before sending a patch series, via disable-needs-checking in prep-pre-flight-checks.

[1] https://pypi.org/project/b4/
[2] https://b4.docs.kernel.org/en/latest/config.html

---
This adds a basic config file for b4 to avoid to have to add the mailing list by hand.
For documentation patches, the additional mailing list will be added when running b4 prep --check, as is required for each new series managed by b4.

Quoted 5 lines

Note that b4 supports patchwork, c.f.
https://b4.docs.kernel.org/en/latest/config.html#patchwork-integration-settings
though I have no clue what it does with it as I am no maintainer, but maybe something worth having a look at if some maintainer of this repo wants to use b4 to merge stuff?

I'll add my configuration here, maybe someone or myself can add some doc for it later, here or elsewhere.

configuration I use:

[b4]
pw-url = https://patchwork.yoctoproject.org/
pw-key = <redacted>
pw-project = docs
pw-review-state = under-review
pw-accept-state = accepted
pw-discard-state = rejected

For pw-project, it comes from the project name on patchwork, e.g.:

   https://patchwork.yoctoproject.org/project/docs/list
                                              ^^^^

The pw-key can be obtained from the user's personal settings.

Then b4 {am,shazam} will automatically set the state to under-review.

Quoted 8 lines

b4 ty -d will reject the patch. Sometimes I use b4 ty --pw-set-state superseded -d ... when I know another version of the patch/series was sent.

Finally b4 ty -a will also set the accepted state along the generation of thank-you file.

And overall it's much easier than clicking buttons on patchwork :)

Thanks!

How does this work if I don't have pw-key (which will be the case for most/all contributors)? Does b4 fail or goes on like it would if we had no pw-* settings?

Additionally, I'm pretty sure we do not want maintainers to mistakenly push their pw-key to the mailing list. So I guess this should be stored outside of the git repo and rather in .gitconfig, c.f. https://b4.docs.kernel.org/en/latest/config.html#configuration-options
Should we add some documentation on how to do that for maintainers?

Considering I cannot test this right now (i don't have patchwork set up, nor do I know if it makes sense to set it up if I'm not maintainer :) ), I think it'd make more sense to have someone able to test it to send a patch later to add support for that? What do you think?

Quoted 58 lines
Quoted 58 lines

---
Changes in v2:
- add b4-wrapper for auto-detecting patches that are to be sent to the docs mailing list as well,
- disable forced b4 prep --check for each b4-managed series,
- Link to v1: https://lore.kernel.org/r/[email protected]

---
  .b4-config    |  4 ++++
  b4-wrapper.py | 38 ++++++++++++++++++++++++++++++++++++++
  2 files changed, 42 insertions(+)
.b4-config new file +4 -0
new file mode 100644
index 0000000000000000000000000000000000000000..0b699f204c414099f2118ffdbc9f7b24454e4a4e
@@ -0,0 +1,4 @@
+[b4]
+  send-series-cc = [email protected]
+  send-auto-cc-cmd = ./b4-wrapper.py send-auto-cc-cmd
+  prep-pre-flight-checks = disable-needs-checking
b4-wrapper.py new file +31 -0
new file mode 100755
index 0000000000000000000000000000000000000000..ddc2597bc0374fa5124a83be94eeab52df6f38d3
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+#
+# This script is to be called by b4:
+# - through b4.send-auto-cc-cmd with "send-auto-cc-cmd" as first argument,
+#
+# When send-auto-cc-cmd is passed:
+#
+#  This returns the list of Cc recipients for a patch.
+#
+# This script takes as stdin a patch.
+
+import subprocess
+import sys
+
+cmd = sys.argv[1]
+if cmd != "send-auto-cc-cmd":
+    sys.exit(-1)
+
+patch = sys.stdin.read()
+
+if subprocess.call(["which", "lsdiff"], stdout=subprocess.DEVNULL) != 0:
+    print("lsdiff missing from host, please install patchutils")
+    sys.exit(-1)
+
+print("[email protected]")
+
+files = subprocess.check_output(["lsdiff", "--strip-match=1", "--strip=1", "--include=doc/*"],
+                                input=patch, text=True)
+if len(files):
+    print("[email protected]")
+else:
Quoted 8 lines

b4-wrapper.py line 38

Quoted 8 lines
b4-wrapper.py new file +7 -0
+# Handle patches made with --no-prefix
+    files = subprocess.check_output(["lsdiff", "--include=doc/*"],
+                                    input=patch, text=True)
+    if len(files):
+        print("[email protected]")
+
+sys.exit(0)

I forgot to add in the cover letter, but we could add a check to make sure a patch doesn't touch both documentation and code. But I'm not sure this is something we need to enforce, and maybe that's actually absolutely fine to have both in one commit? I can add that check though, so up to you.

Quoted 11 lines
Quoted 5 lines

---
base-commit: 0329a7e3ac694737f2d2c1861f65492551360663
change-id: 20240524-b4-support-e9855fc54d40

Best regards,

Thanks for the script Quentin!

I was thinking, for eocore we could even extend the list of cc from meta/conf/distro/include/maintainers.inc.

This is something Richard does not want :)

I'm working on b4 support for poky/oe-core and yocto-docs, but I somehow stumbled upon a bug in b4 now :), c.f. https://lore.kernel.org/tools/[email protected]/T/#u

Will send patches soon. poky will be fun to review :)

Cheers,
Quentin

#3 lore raw

Hi Quentin,

On Fri Jan 17, 2025 at 12:43 PM CET, Quentin Schulz wrote:
[...]

Quoted 34 lines
Quoted 34 lines
Quoted 5 lines

Note that b4 supports patchwork, c.f.
https://b4.docs.kernel.org/en/latest/config.html#patchwork-integration-settings
though I have no clue what it does with it as I am no maintainer, but maybe something worth having a look at if some maintainer of this repo wants to use b4 to merge stuff?

I'll add my configuration here, maybe someone or myself can add some doc for it later, here or elsewhere.

configuration I use:

[b4]
pw-url = https://patchwork.yoctoproject.org/
pw-key = <redacted>
pw-project = docs
pw-review-state = under-review
pw-accept-state = accepted
pw-discard-state = rejected

For pw-project, it comes from the project name on patchwork, e.g.:

   https://patchwork.yoctoproject.org/project/docs/list
                                              ^^^^

The pw-key can be obtained from the user's personal settings.

Then b4 {am,shazam} will automatically set the state to under-review.

b4 ty -d will reject the patch. Sometimes I use b4 ty --pw-set-state superseded -d ... when I know another version of the patch/series was sent.

Finally b4 ty -a will also set the accepted state along the generation of thank-you file.

Quoted 8 lines
Quoted 2 lines

And overall it's much easier than clicking buttons on patchwork :)

Thanks!

How does this work if I don't have pw-key (which will be the case for most/all contributors)? Does b4 fail or goes on like it would if we had no pw-* settings?

I just checked and if a pw-key is not set, b4 just does nothing related to patchwork (tested for shazam only).

Quoted 5 lines

Additionally, I'm pretty sure we do not want maintainers to mistakenly push their pw-key to the mailing list. So I guess this should be stored outside of the git repo and rather in .gitconfig, c.f.
https://b4.docs.kernel.org/en/latest/config.html#configuration-options
Should we add some documentation on how to do that for maintainers?

True, in fact all of this was configured from .git/config on a per-repo basis.

Quoted 4 lines

Considering I cannot test this right now (i don't have patchwork set up, nor do I know if it makes sense to set it up if I'm not maintainer :) ), I think it'd make more sense to have someone able to test it to send a patch later to add support for that? What do you think?

I'm not sure where would be a good place for such documentation, as this is personal tooling and personal taste in the end.

Antonin

Signature · 3 lines
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

Hi Antonin,

Quoted 41 lines · Antonin Godard

Hi Quentin,

On Fri Jan 17, 2025 at 12:43 PM CET, Quentin Schulz wrote:
[...]

Quoted 37 lines
Quoted 36 lines
Quoted 5 lines

Note that b4 supports patchwork, c.f.
https://b4.docs.kernel.org/en/latest/config.html#patchwork-integration-settings
though I have no clue what it does with it as I am no maintainer, but maybe something worth having a look at if some maintainer of this repo wants to use b4 to merge stuff?

I'll add my configuration here, maybe someone or myself can add some doc for it later, here or elsewhere.

configuration I use:

[b4]
pw-url = https://patchwork.yoctoproject.org/
pw-key = <redacted>
pw-project = docs
pw-review-state = under-review
pw-accept-state = accepted
pw-discard-state = rejected

For pw-project, it comes from the project name on patchwork, e.g.:

    https://patchwork.yoctoproject.org/project/docs/list
                                               ^^^^

The pw-key can be obtained from the user's personal settings.

Then b4 {am,shazam} will automatically set the state to under-review.

b4 ty -d will reject the patch. Sometimes I use b4 ty --pw-set-state superseded -d ... when I know another version of the patch/series was sent.

Finally b4 ty -a will also set the accepted state along the generation of thank-you file.

And overall it's much easier than clicking buttons on patchwork :)

Quoted 9 lines
Quoted 5 lines

Thanks!

How does this work if I don't have pw-key (which will be the case for most/all contributors)? Does b4 fail or goes on like it would if we had no pw-* settings?

I just checked and if a pw-key is not set, b4 just does nothing related to patchwork (tested for shazam only).

Thanks for testing!

Quoted 8 lines
Quoted 5 lines

Additionally, I'm pretty sure we do not want maintainers to mistakenly push their pw-key to the mailing list. So I guess this should be stored outside of the git repo and rather in .gitconfig, c.f.
https://b4.docs.kernel.org/en/latest/config.html#configuration-options
Should we add some documentation on how to do that for maintainers?

True, in fact all of this was configured from .git/config on a per-repo basis.

Quoted 8 lines
Quoted 4 lines

Considering I cannot test this right now (i don't have patchwork set up, nor do I know if it makes sense to set it up if I'm not maintainer :) ), I think it'd make more sense to have someone able to test it to send a patch later to add support for that? What do you think?

I'm not sure where would be a good place for such documentation, as this is personal tooling and personal taste in the end.

I believe those settings (except pw-key) would be identical for everybody, so having them in .b4-config within the repo makes sense to me. What do you think?

In a README/CONTRIBUTION file and/or as a comment in .b4-config we can explain how to finish the maintainer setup for example.

Cheers,
Quentin

#5 lore raw
In reply to Quentin Schulz
Quoted 65 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

b4[1] is a very nice tool for mail-based contribution. A config[2] file exists to set up a few defaults. We can use it to set the Cc recipients to always add, in our case the mailing list.

This also adds a wrapper script that is called by b4 to figure out which addresses to put as Cc recipients. Considering that patches to the doc/ directory also need to be sent to the yocto-docs mailing list, this wrapper handles that. A limitation of the script (lsdiff actually) is that it doesn't know how to handle empty files, but those should be of rather rare occurrences.

While the wrapper script should be enough by itself to add the bitbake mailing list to the Cc recipients, one still needs to manually run b4 prep --auto-to-cc for that to happen. Therefore, let's add an explicit send-series-cc so that at least that mailing list is always there.

Because we currently do not have anything to check for patch validity, remove requirement for b4 prep --check to be run before sending a patch series, via disable-needs-checking in prep-pre-flight-checks.

[1] https://pypi.org/project/b4/
[2] https://b4.docs.kernel.org/en/latest/config.html

---
This adds a basic config file for b4 to avoid to have to add the mailing list by hand.
For documentation patches, the additional mailing list will be added when running b4 prep --check, as is required for each new series managed by b4.

Note that b4 supports patchwork, c.f.
https://b4.docs.kernel.org/en/latest/config.html#patchwork-integration-settings
though I have no clue what it does with it as I am no maintainer, but maybe something worth having a look at if some maintainer of this repo wants to use b4 to merge stuff?
---
Changes in v2:
- add b4-wrapper for auto-detecting patches that are to be sent to the docs mailing list as well,
- disable forced b4 prep --check for each b4-managed series,
- Link to v1: https://lore.kernel.org/r/[email protected]

---
  .b4-config    |  4 ++++
  b4-wrapper.py | 38 ++++++++++++++++++++++++++++++++++++++
  2 files changed, 42 insertions(+)
.b4-config new file +4 -0
new file mode 100644
index 0000000000000000000000000000000000000000..0b699f204c414099f2118ffdbc9f7b24454e4a4e
@@ -0,0 +1,4 @@
+[b4]
+  send-series-cc = [email protected]
+  send-auto-cc-cmd = ./b4-wrapper.py send-auto-cc-cmd
+  prep-pre-flight-checks = disable-needs-checking
b4-wrapper.py new file +0 -0
new file mode 100755
index 0000000000000000000000000000000000000000..ddc2597bc0374fa5124a83be94eeab52df6f38d3

b4-wrapper.py line 2

Quoted 2 lines
b4-wrapper.py new file +2 -0
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+#

Forgot to add an SPDX-License-Identifier here, I can send a v3 for that or simply pick between MIT and GPL-2.0-only and GPL-2.0-or-later which seem to be the most common licenses for python scripts in our projects, I don't have a personal preference :) For now, will wait for feedback first!

Cheers,
Quentin

Quoted 42 lines
b4-wrapper.py new file +36 -1
+# This script is to be called by b4:
+# - through b4.send-auto-cc-cmd with "send-auto-cc-cmd" as first argument,
+#
+# When send-auto-cc-cmd is passed:
+#
+#  This returns the list of Cc recipients for a patch.
+#
+# This script takes as stdin a patch.
+
+import subprocess
+import sys
+
+cmd = sys.argv[1]
+if cmd != "send-auto-cc-cmd":
+    sys.exit(-1)
+
+patch = sys.stdin.read()
+
+if subprocess.call(["which", "lsdiff"], stdout=subprocess.DEVNULL) != 0:
+    print("lsdiff missing from host, please install patchutils")
+    sys.exit(-1)
+
+print("[email protected]")
+
+files = subprocess.check_output(["lsdiff", "--strip-match=1", "--strip=1", "--include=doc/*"],
+                                input=patch, text=True)
+if len(files):
+    print("[email protected]")
+else:
+# Handle patches made with --no-prefix
+    files = subprocess.check_output(["lsdiff", "--include=doc/*"],
+                                    input=patch, text=True)
+    if len(files):
+        print("[email protected]")
+
+sys.exit(0)
 
---

base-commit: 0329a7e3ac694737f2d2c1861f65492551360663
change-id: 20240524-b4-support-e9855fc54d40

Best regards,

#6 lore raw
In reply to Quentin Schulz

Hi all,

Quoted 55 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

b4[1] is a very nice tool for mail-based contribution. A config[2] file exists to set up a few defaults. We can use it to set the Cc recipients to always add, in our case the mailing list.

This also adds a wrapper script that is called by b4 to figure out which addresses to put as Cc recipients. Considering that patches to the doc/ directory also need to be sent to the yocto-docs mailing list, this wrapper handles that. A limitation of the script (lsdiff actually) is that it doesn't know how to handle empty files, but those should be of rather rare occurrences.

While the wrapper script should be enough by itself to add the bitbake mailing list to the Cc recipients, one still needs to manually run b4 prep --auto-to-cc for that to happen. Therefore, let's add an explicit send-series-cc so that at least that mailing list is always there.

Because we currently do not have anything to check for patch validity, remove requirement for b4 prep --check to be run before sending a patch series, via disable-needs-checking in prep-pre-flight-checks.

[1] https://pypi.org/project/b4/
[2] https://b4.docs.kernel.org/en/latest/config.html

---
This adds a basic config file for b4 to avoid to have to add the mailing list by hand.
For documentation patches, the additional mailing list will be added when running b4 prep --check, as is required for each new series managed by b4.

Note that b4 supports patchwork, c.f.
https://b4.docs.kernel.org/en/latest/config.html#patchwork-integration-settings
though I have no clue what it does with it as I am no maintainer, but maybe something worth having a look at if some maintainer of this repo wants to use b4 to merge stuff?
---
Changes in v2:
- add b4-wrapper for auto-detecting patches that are to be sent to the docs mailing list as well,
- disable forced b4 prep --check for each b4-managed series,
- Link to v1: https://lore.kernel.org/r/[email protected]

---
  .b4-config    |  4 ++++
  b4-wrapper.py | 38 ++++++++++++++++++++++++++++++++++++++
  2 files changed, 42 insertions(+)
.b4-config new file +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..0b699f204c414099f2118ffdbc9f7b24454e4a4e

.b4-config line 3

Quoted 3 lines
.b4-config new file +3 -0
@@ -0,0 +1,4 @@
+[b4]
+  send-series-cc = [email protected]
+  send-auto-cc-cmd = ./b4-wrapper.py send-auto-cc-cmd

All the above should be to instead of cc, will fix in next version.

@Richard, is the b4-wrapper.py below (this one for BitBake and not Poky!) fine in BitBake git repo? I believe it should since it needs to be called even when one develops from "vanilla" BitBake git repo and not poky combo repo. Just asking for confirmation here (and maybe you want a different name too?).

Cheers,
Quentin

#7 lore raw
Quoted 64 lines · Quentin Schulz via lists.openembedded.org

Hi all,

Quoted 55 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

b4[1] is a very nice tool for mail-based contribution. A config[2] file exists to set up a few defaults. We can use it to set the Cc recipients to always add, in our case the mailing list.

This also adds a wrapper script that is called by b4 to figure out which addresses to put as Cc recipients. Considering that patches to the doc/ directory also need to be sent to the yocto-docs mailing list, this wrapper handles that. A limitation of the script (lsdiff actually) is that it doesn't know how to handle empty files, but those should be of rather rare occurrences.

While the wrapper script should be enough by itself to add the bitbake mailing list to the Cc recipients, one still needs to manually run b4 prep --auto-to-cc for that to happen. Therefore, let's add an explicit send-series-cc so that at least that mailing list is always there.

Because we currently do not have anything to check for patch validity, remove requirement for b4 prep --check to be run before sending a patch series, via disable-needs-checking in prep-pre-flight-checks.

[1] https://pypi.org/project/b4/
[2] https://b4.docs.kernel.org/en/latest/config.html

---
This adds a basic config file for b4 to avoid to have to add the mailing list by hand.
For documentation patches, the additional mailing list will be added when running b4 prep --check, as is required for each new series managed by b4.

Note that b4 supports patchwork, c.f.
https://b4.docs.kernel.org/en/latest/config.html#patchwork-integration-settings
though I have no clue what it does with it as I am no maintainer, but maybe something worth having a look at if some maintainer of this repo wants to use b4 to merge stuff?
---
Changes in v2:
- add b4-wrapper for auto-detecting patches that are to be sent to the docs mailing list as well,
- disable forced b4 prep --check for each b4-managed series,
- Link to v1: https://lore.kernel.org/r/[email protected]
---
  .b4-config    |  4 ++++
  b4-wrapper.py | 38 ++++++++++++++++++++++++++++++++++++++

  2 files changed, 42 insertions(+)
.b4-config new file +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..0b699f204c414099f2118ffdbc9f7b24454e4a4e

.b4-config line 3

Quoted 3 lines
.b4-config new file +3 -0
@@ -0,0 +1,4 @@
+[b4]
+  send-series-cc = [email protected]
+  send-auto-cc-cmd = ./b4-wrapper.py send-auto-cc-cmd

All the above should be to instead of cc, will fix in next version.

Quoted 5 lines

@Richard, is the b4-wrapper.py below (this one for BitBake and not Poky!) fine in BitBake git repo? I believe it should since it needs to be called even when one develops from "vanilla" BitBake git repo and not poky combo repo. Just asking for confirmation here (and maybe you want a different name too?).

I guess the location is ok but can we call it b4-bitbake-wrapper.py please? This is so that if someone sends patches, it is clear which wrapper the patch is against. Top level files in repos can sometimes get interesting for that, even if b4 should be helping make sure the right patches go to the right lists in future!

Cheers,

Richard

#8 lore raw

Hi Richard,

Quoted 65 lines · Richard Purdie
Quoted 64 lines · Quentin Schulz via lists.openembedded.org

Hi all,

Quoted 55 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

b4[1] is a very nice tool for mail-based contribution. A config[2] file exists to set up a few defaults. We can use it to set the Cc recipients to always add, in our case the mailing list.

This also adds a wrapper script that is called by b4 to figure out which addresses to put as Cc recipients. Considering that patches to the doc/ directory also need to be sent to the yocto-docs mailing list, this wrapper handles that. A limitation of the script (lsdiff actually) is that it doesn't know how to handle empty files, but those should be of rather rare occurrences.

While the wrapper script should be enough by itself to add the bitbake mailing list to the Cc recipients, one still needs to manually run b4 prep --auto-to-cc for that to happen. Therefore, let's add an explicit send-series-cc so that at least that mailing list is always there.

Because we currently do not have anything to check for patch validity, remove requirement for b4 prep --check to be run before sending a patch series, via disable-needs-checking in prep-pre-flight-checks.

[1] https://pypi.org/project/b4/
[2] https://b4.docs.kernel.org/en/latest/config.html

---
This adds a basic config file for b4 to avoid to have to add the mailing list by hand.
For documentation patches, the additional mailing list will be added when running b4 prep --check, as is required for each new series managed by b4.

Note that b4 supports patchwork, c.f.
https://b4.docs.kernel.org/en/latest/config.html#patchwork-integration-settings
though I have no clue what it does with it as I am no maintainer, but maybe something worth having a look at if some maintainer of this repo wants to use b4 to merge stuff?
---
Changes in v2:
- add b4-wrapper for auto-detecting patches that are to be sent to the docs mailing list as well,
- disable forced b4 prep --check for each b4-managed series,
- Link to v1: https://lore.kernel.org/r/[email protected]

---
   .b4-config    |  4 ++++
   b4-wrapper.py | 38 ++++++++++++++++++++++++++++++++++++++
   2 files changed, 42 insertions(+)
.b4-config new file +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..0b699f204c414099f2118ffdbc9f7b24454e4a4e

.b4-config line 3

Quoted 3 lines
.b4-config new file +3 -0
@@ -0,0 +1,4 @@
+[b4]
+  send-series-cc = [email protected]
+  send-auto-cc-cmd = ./b4-wrapper.py send-auto-cc-cmd

All the above should be to instead of cc, will fix in next version.

Quoted 7 lines
Quoted 5 lines

@Richard, is the b4-wrapper.py below (this one for BitBake and not Poky!) fine in BitBake git repo? I believe it should since it needs to be called even when one develops from "vanilla" BitBake git repo and not poky combo repo. Just asking for confirmation here (and maybe you want a different name too?).

I guess the location is ok but can we call it b4-bitbake-wrapper.py

b4-wrapper-bitbake.py to follow the same naming scheme as for the one for poky that is stored in OE-Core maybe?

Quoted 5 lines

please? This is so that if someone sends patches, it is clear which wrapper the patch is against. Top level files in repos can sometimes get interesting for that, even if b4 should be helping make sure the right patches go to the right lists in future!

One could have the interesting idea of contributing patches to the b4-wrapper-bitbake.py script without using b4, so a unique name across the code bases makes sense to me.

Looking at it, do we want the script to be in contrib/ in BitBake repo maybe?

Cheers,
Quentin

#9 lore raw
Quoted 74 lines · Quentin Schulz

Hi Richard,

Quoted 71 lines · Richard Purdie
Quoted 69 lines · Quentin Schulz via lists.openembedded.org

Hi all,

Quoted 55 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

b4[1] is a very nice tool for mail-based contribution. A config[2] file exists to set up a few defaults. We can use it to set the Cc recipients to always add, in our case the mailing list.

This also adds a wrapper script that is called by b4 to figure out which addresses to put as Cc recipients. Considering that patches to the doc/ directory also need to be sent to the yocto-docs mailing list, this wrapper handles that. A limitation of the script (lsdiff actually) is that it doesn't know how to handle empty files, but those should be of rather rare occurrences.

While the wrapper script should be enough by itself to add the bitbake mailing list to the Cc recipients, one still needs to manually run b4 prep --auto-to-cc for that to happen. Therefore, let's add an explicit send-series-cc so that at least that mailing list is always there.

Because we currently do not have anything to check for patch validity, remove requirement for b4 prep --check to be run before sending a patch series, via disable-needs-checking in prep-pre-flight-checks.

[1] https://pypi.org/project/b4/
[2] https://b4.docs.kernel.org/en/latest/config.html

---
This adds a basic config file for b4 to avoid to have to add the mailing list by hand.
For documentation patches, the additional mailing list will be added when running b4 prep --check, as is required for each new series managed by b4.

Note that b4 supports patchwork, c.f.
https://b4.docs.kernel.org/en/latest/config.html#patchwork-integration-settings
though I have no clue what it does with it as I am no maintainer, but maybe something worth having a look at if some maintainer of this repo wants to use b4 to merge stuff?
---
Changes in v2:
- add b4-wrapper for auto-detecting patches that are to be sent to the docs mailing list as well,
- disable forced b4 prep --check for each b4-managed series,
- Link to v1: https://lore.kernel.org/r/[email protected]
---
   .b4-config    |  4 ++++
   b4-wrapper.py | 38 ++++++++++++++++++++++++++++++++++++++

   2 files changed, 42 insertions(+)
.b4-config new file +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..0b699f204c414099f2118ffdbc9f7b24454e4a4e

.b4-config line 3

Quoted 3 lines
.b4-config new file +3 -0
@@ -0,0 +1,4 @@
+[b4]
+  send-series-cc = [email protected]
+  send-auto-cc-cmd = ./b4-wrapper.py send-auto-cc-cmd

All the above should be to instead of cc, will fix in next version.

@Richard, is the b4-wrapper.py below (this one for BitBake and not Poky!) fine in BitBake git repo? I believe it should since it needs to be called even when one develops from "vanilla" BitBake git repo and not poky combo repo. Just asking for confirmation here (and maybe you want a different name too?).

Quoted 4 lines
Quoted 1 line

I guess the location is ok but can we call it b4-bitbake-wrapper.py

b4-wrapper-bitbake.py to follow the same naming scheme as for the one for poky that is stored in OE-Core maybe?

That makes sense, might as well try and be consistent :)

Quoted 11 lines
Quoted 4 lines

please? This is so that if someone sends patches, it is clear which wrapper the patch is against. Top level files in repos can sometimes get interesting for that, even if b4 should be helping make sure the right patches go to the right lists in future!

One could have the interesting idea of contributing patches to the b4-wrapper-bitbake.py script without using b4, so a unique name across the code bases makes sense to me.

Looking at it, do we want the script to be in contrib/ in BitBake repo maybe?

I'd wondered about that and would be fine with it. It would reduce "clutter" in the top level directory which already has too many files to me!

Cheers,

Richard