From: "cron2 (Code Review)" Date: Fri, 8 Mar 2024 13:09:26 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <53a8b7f9f21318a50e0b8e940231491e0ecccf36-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="DH0nM1S5ixs="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: gerrit-send-mail: add missing Signed-off-by List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --DH0nM1S5ixs= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/530?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: gerrit-send-mail: add missing Signed-off-by ...................................................................... gerrit-send-mail: add missing Signed-off-by Our development documentation says we add this automatically when it is missing. So let's do that here as well. Change-Id: If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Message-Id: <20240308120557.9065-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28= 362.html Signed-off-by: Gert Doering --- M dev-tools/gerrit-send-mail.py 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/30/530/2 diff --git a/dev-tools/gerrit-send-mail.py b/dev-tools/gerrit-send-mail.py index 67a2cf1..10305e2 100755 --- a/dev-tools/gerrit-send-mail.py +++ b/dev-tools/gerrit-send-mail.py @@ -50,6 +50,12 @@ ack =3D f"{reviewer_name} <{reviewer_mail}>" print(f"Acked-by: {ack}") acked_by.append(ack) + # construct Signed-off-by in case it is missing + owner =3D json_data["owner"] + owner_name =3D owner.get("display_name", owner["name"]) + owner_mail =3D owner.get("email", owner["name"]) + sign_off =3D f"{owner_name} <{owner_mail}>" + print(f"Signed-off-by: {sign_off}") change_id =3D json_data["change_id"] # assumes that the created date in Gerrit is in UTC utc_stamp =3D ( @@ -67,6 +73,7 @@ "target": json_data["branch"], "msg_id": msg_id, "acked_by": acked_by, + "sign_off": sign_off, } @@ -81,10 +88,14 @@ def apply_patch_mods(patch_text, details, args): comment_start =3D patch_text.index("\n---\n") + len("\n---\n") + signed_off_text =3D "" + signed_off_comment =3D "" try: signed_off_start =3D patch_text.rindex("\nSigned-off-by: ") signed_off_end =3D patch_text.index("\n", signed_off_start + 1) + 1 except ValueError: # Signed-off missing + signed_off_text =3D f"Signed-off-by: {details['sign_off']}\n" + signed_off_comment =3D "\nSigned-off-by line for the author was ad= ded as per our policy.\n" signed_off_end =3D patch_text.index("\n---\n") + 1 assert comment_start > signed_off_end acked_by_text =3D "" @@ -94,6 +105,7 @@ acked_by_names +=3D f"{ack}\n" patch_text_mod =3D ( patch_text[:signed_off_end] + + signed_off_text + acked_by_text + patch_text[signed_off_end:comment_start] + f""" @@ -102,6 +114,7 @@ Gerrit URL: {args.url}/c/{details["project"]}/+/{args.changeid} This mail reflects revision {details["revision"]} of this Change. +{signed_off_comment} Acked-by according to Gerrit (reflected above): {acked_by_names} """ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/530?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa Gerrit-Change-Number: 530 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --DH0nM1S5ixs= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outda= ted and were removed: Code-Review+2 by cron2

gerrit-send-mail: add missing Signed-off-by

O= ur development documentation says we add this
automatically when it is m= issing. So let's do that
here as well.

Change-Id: If9cb7d66f0= 79fe1c87fcb5b4e59bc887533d77fa
Signed-off-by: Frank Lichtenheld <fran= k@...2641...>
Acked-by: Gert Doering <gert@...1296...>
Messa= ge-Id: <20240308120557.9065-1-gert@...1296...>
URL: https://www.ma= il-archive.com/openvpn-devel@lists.sourceforge.net/msg28362.html
Signed-= off-by: Gert Doering <gert@...1296...>
---
M dev-tools/gerrit-s= end-mail.py
1 file changed, 13 insertions(+), 0 deletions(-)

g=
it pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/30/530/2
<= pre style=3D"font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/dev-tools/gerrit-send-mail.py b/dev-tools/gerrit-send-mail.p= y
index 67a2cf1..10305e2 100755
--- a/dev-t= ools/gerrit-send-mail.py
+++ b/dev-tools/gerrit-send-mail.p= y
@@ -50,6 +50,12 @@
ack = =3D f"{reviewer_name} <{reviewer_mail}>"
= print(f"Acked-by: {ack}")
= acked_by.append(ack)
+ # construct Signed-off-by in case it is missing
+ owner =3D json_data["own= er"]
+ owner_= name =3D owner.get("display_name", owner["name"])
+ owner_mail =3D owner.= get("email", owner["name"])
+ sign_off =3D f"{owner_name} <{owner= _mail}>"
+ = print(f"Signed-off-by: {sign_off}")
change_= id =3D json_data["change_id"]
# assumes that= the created date in Gerrit is in UTC
utc_stamp =3D (<= /span>
@@ -67,6 +73,7 @@
"target&quo= t;: json_data["branch"],
"msg_id&qu= ot;: msg_id,
"acked_by": acked_by,
+ "sign_off&qu= ot;: sign_off,
}


@@ -81,10 +88,14 @@

def a= pply_patch_mods(patch_text, details, args):
comment_st= art =3D patch_text.index("\n---\n") + len("\n---\n")
+ signed_off_text = =3D ""
+ = signed_off_comment =3D ""
try:
signed_off_start =3D patch_text.rindex("\nSigned-off-by: = ")

signed_off_end =3D patch_text.index("= \n", signed_off_start + 1) + 1
except ValueError:= # Signed-off missing
+ = signed_off_comment =3D "\nSigned-off-by line for the author was ad= ded as per our policy.\n"
signed_off_end =3D = patch_text.index("\n---\n") + 1
assert comme= nt_start > signed_off_end
acked_by_text =3D "&= quot;
@@ -94,6 +105,7 @@
acked_by_= names +=3D f"{ack}\n"
patch_text_mod =3D (
patch_text[:signed_off_end]
+ + signed_off_text
+ acked_by_text

+ patch_text[signed_off_= end:comment_start]
+ f"""@@ -102,6 +114,7 @@

Gerrit URL: {= args.url}/c/{details["project"]}/+/{args.changeid}
This mail reflects revision {details["revision"]} of this Chan= ge.

+{signed_off_comm= ent}
Acked-by according to Gerrit (reflected above):
{acked_by_names}
"""

To view, visit change 530. To unsubscribe, or = for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If9cb7d66f079fe1c87fcb5b4e59= bc887533d77fa
Gerrit-Change-Number: 530
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--DH0nM1S5ixs=--