Jeremy White : gitlab: Respect READ_ONLY for mailtogitlab.py as well.

Alexandre Julliard julliard at winehq.org
Mon Jun 6 15:05:08 CDT 2022


Module: tools
Branch: master
Commit: dd97169f1220d1457bf5eb41b6499c54bbfac788
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=dd97169f1220d1457bf5eb41b6499c54bbfac788

Author: Jeremy White <jwhite at codeweavers.com>
Date:   Fri Jun  3 10:16:09 2022 -0500

gitlab: Respect READ_ONLY for mailtogitlab.py as well.

---

 gitlab/gitlab-to-mail/mailtogitlab.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gitlab/gitlab-to-mail/mailtogitlab.py b/gitlab/gitlab-to-mail/mailtogitlab.py
index d3eeee7..ecc73fc 100755
--- a/gitlab/gitlab-to-mail/mailtogitlab.py
+++ b/gitlab/gitlab-to-mail/mailtogitlab.py
@@ -139,8 +139,11 @@ def post_discussion_note(mr_iid, note, replyto):
         did = find_discussion(mr_iid, replyto)
         if did:
             url += f"/{did}/notes"
-    r = requests.post(url, headers={"PRIVATE-TOKEN": settings.GITLAB_TOKEN}, data={'body': note, 'note_id': replyto})
-    r.raise_for_status()
+    if settings.READ_ONLY:
+        print(f"Post: {url} (note_id: {replyto})\nBody:\n{note}\n---\n")
+    else:
+        r = requests.post(url, headers={"PRIVATE-TOKEN": settings.GITLAB_TOKEN}, data={'body': note, 'note_id': replyto})
+        r.raise_for_status()
 
 
 def main():




More information about the wine-cvs mailing list