! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Add a git post-commit hook to add a comment to related bug
Status:
RESOLVED: FIXED
Product:
bugzilla.xfce.org
Component:
General

Comments

Description Skunnyk editbugs 2017-04-20 12:27:51 CEST
Based on a known pattern, for example 'Fix #xxxxx' where xxxxx is the issue number, add a git post-hook to add a comment to the related bug.

We can use the bugzilla rest api ( https://bugzilla.readthedocs.io/en/latest/api/core/v1/general.html#authentication / https://bugzilla.readthedocs.io/en/latest/api/core/v1/comment.html#create-comments ).
Comment 1 Skunnyk editbugs 2017-04-20 12:43:28 CEST
This is auto generated comment
Comment 2 Skunnyk editbugs 2017-04-20 12:45:50 CEST
I m a curl bot. Hook Hook !
Comment 3 Simon Steinbeiss editbugs 2017-04-22 13:59:50 CEST
Some food for the curl bot to feast on:

git log |grep -Poi "(?<=Bug)[:# ]*[0-9]+"|tr -d ':# '|xargs -I BUG_NUMBER echo "https://bugzilla.xfce.org/show_bug.cgi?id=BUG_NUMBER"
Comment 4 Simon Steinbeiss editbugs 2017-04-22 14:17:17 CEST
Just a test-comment with a commit link: https://git.xfce.org/xfce/xfce4-panel/commit/?id=6514d86d6fb2b2ee1e262da2012fa3c396c3fba9
Comment 5 Simon Steinbeiss editbugs 2017-04-22 14:24:59 CEST
Ok, so just to document this clearly here.

Step1: Get API token (be sure to wrap the URL in double-quotes, otherwise bash interprets the ampersand as forking):
curl "https://bugzilla.xfce.org/rest/login?login=gitbot@xfce.org&password=secretpassword"

Step2: Add comment:
curl -H "Content-Type: application/json" -X POST -d '{ "comment": "Just a test-comment with a commit link: https://git.xfce.org/xfce/xfce4-panel/commit/?id=6514d86d6fb2b2ee1e262da2012fa3c396c3fba9", "is_private": false, "is_markdown": true }' https://bugzilla.xfce.org/rest/bug/13510/comment?token=yoursecrettoken
Comment 6 Skunnyk editbugs 2017-04-24 13:57:14 CEST
Fixed in $newrev
Comment 7 Skunnyk editbugs 2017-04-24 14:05:49 CEST
Fixed in f26f1c077e3e3dd100c83880160f6b49318a06fb
Comment 8 Skunnyk editbugs 2017-04-24 14:13:03 CEST
Fixed in ae16b1b01225582a1f160c2544ae25557e626866
Comment 9 Skunnyk editbugs 2017-04-24 23:18:34 CEST
Fixed by ae16b1b01225582a1f160c2544ae25557e626866 on users/skunnyk/bugzilla
Comment 10 Skunnyk editbugs 2017-04-25 00:02:13 CEST
Fixed by ae16b1b01225582a1f160c2544ae25557e626866 on users/skunnyk/bugzilla
Comment 11 Skunnyk editbugs 2017-04-25 00:06:11 CEST
Fixed by 6bb96fc71ec57704e0658a9f71302471cef33629 on users/skunnyk/bugzilla
Comment 13 Skunnyk editbugs 2017-04-25 00:19:28 CEST
This bug was referenced in commit [ecb86a8d34257f636b68cb4e68a5fedbe80697d2](https://git.xfce.org/users/skunnyk/bugzilla/commit?id=ecb86a8d34257f636b68cb4e68a5fedbe80697d2)
Comment 14 Git Bot editbugs 2017-04-29 22:41:33 CEST
This bug was referenced in this commit: https://git.xfce.org/users/skunnyk/bugzilla/commit?id=8a5324aee6fb23d04fe043f88fd357182231c581
Comment 15 Git Bot editbugs 2017-05-09 13:20:28 CEST
"Skunnyk referenced this bugreport in commit 14360bbf8ff7b6042913e885eb255f0955e14508

Post commit hook : Fix bug #13510"
https://git.xfce.org/users/skunnyk/bugzilla/commit?id=14360bbf8ff7b6042913e885eb255f0955e14508
Comment 16 Git Bot editbugs 2017-05-09 13:33:24 CEST
Skunnyk referenced this bugreport in commit 846f3519edf134094c57260bc9dc5b9864f26151

Again, I test the commit hook for bug #13510

      - Now we print author name + commithash + commitmessage in bz issue
      - With a nice formatting
      - This is a usefull commit message
      - Will this works ?


https://git.xfce.org/users/skunnyk/bugzilla/commit?id=846f3519edf134094c57260bc9dc5b9864f26151
Comment 17 Git Bot editbugs 2017-05-09 23:21:10 CEST
Skunnyk referenced this bugreport in commit 5621cc6a6fb02857b8ac96125cfefbe849c71feb

Only print subject on bugzilla hook

  - fix bug #13510
  - Now we print author name + commithash + commitmessage in bz issue
  - With a nice formatting
  - This is a usefull commit message
  - Will this works ?


https://git.xfce.org/users/skunnyk/bugzilla/commit?id=5621cc6a6fb02857b8ac96125cfefbe849c71feb
Comment 18 Git Bot editbugs 2017-05-09 23:22:52 CEST
Skunnyk referenced this bugreport in commit 2a889c6eb9733838aa727132b2baf6aaf8d58f2f

Only print subject on bugzilla hook, for real

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=2a889c6eb9733838aa727132b2baf6aaf8d58f2f
Comment 19 Git Bot editbugs 2017-06-09 13:53:07 CEST
Skunnyk referenced this bugreport in commit de8603a6834f9aacfb53fa0a4998c9fbbbcd1c8d

fix bug #13510

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=de8603a6834f9aacfb53fa0a4998c9fbbbcd1c8d
Comment 20 Git Bot editbugs 2017-06-09 13:56:23 CEST
Skunnyk referenced this bugreport in commit 0a918c8c005a334c8d1476698eed61448b79b08a

Commit number two fix bug #13510

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=0a918c8c005a334c8d1476698eed61448b79b08a
Comment 21 Git Bot editbugs 2017-06-09 23:14:53 CEST
Skunnyk referenced this bugreport in commit 21b53c6d394475fff46a8ce4f5c59aa26e3666eb

Fix bug #13510

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=21b53c6d394475fff46a8ce4f5c59aa26e3666eb
Comment 22 Git Bot editbugs 2017-06-09 23:25:04 CEST
Skunnyk referenced this bugreport in commit 2ca0669f70d807c07d90c159db420e084f540a3c

Fix bug #13510

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=2ca0669f70d807c07d90c159db420e084f540a3c
Comment 23 Git Bot editbugs 2017-06-09 23:26:25 CEST
Skunnyk referenced this bugreport in commit 8ee1a89e493918febb2d9f08e4ced096d5e43973

Fix bug #13510 again

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=8ee1a89e493918febb2d9f08e4ced096d5e43973
Comment 24 Git Bot editbugs 2017-06-09 23:28:00 CEST
Skunnyk referenced this bugreport in commit f5e01ccf3618e0a7feeb6bcb4f90c6e4f58e233d

Fix bug #13510 again again

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=f5e01ccf3618e0a7feeb6bcb4f90c6e4f58e233d
Comment 25 Git Bot editbugs 2017-06-09 23:40:01 CEST
Skunnyk referenced this bugreport in commit 9c85a20f706d3a4f01617030f631b9331051b8c0

Fix bug #13510 again 2

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=9c85a20f706d3a4f01617030f631b9331051b8c0
Comment 26 Git Bot editbugs 2017-06-09 23:51:19 CEST
Skunnyk referenced this bugreport in commit 2351e2d29ae27a9f4fd2f4eedf8915280e48e2dd

Maybe Fix Bug #13510

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=2351e2d29ae27a9f4fd2f4eedf8915280e48e2dd
Comment 27 Git Bot editbugs 2017-06-09 23:54:15 CEST
Skunnyk referenced this bugreport in commit 595573369d1b635e8ba71f45e15e2df59d256503

Yes Bug #13510

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=595573369d1b635e8ba71f45e15e2df59d256503
Comment 28 Git Bot editbugs 2017-06-10 11:58:53 CEST
Skunnyk referenced this bugreport in commit 83df6a7b397d3c22983654a6fb813fbda9a20521

Yes fix Bug #13510

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=83df6a7b397d3c22983654a6fb813fbda9a20521
Comment 29 Git Bot editbugs 2017-06-10 11:58:55 CEST
Skunnyk referenced this bugreport in commit d00c95a5e0ae555fd4c93ad9093042298071eadd

Yes fix again Bug: 13510

https://git.xfce.org/users/skunnyk/bugzilla/commit?id=d00c95a5e0ae555fd4c93ad9093042298071eadd
Comment 30 Git Bot editbugs 2020-04-13 23:44:17 CEST
Romain Bouvier referenced this bugreport in commit 443207c966926b554b4956b86a247edcf5a4aa16

Fix bug #13510 on gitlab for real

https://gitlab.xfce.org/project-116/commit/-/443207c966926b554b4956b86a247edcf5a4aa16
Comment 31 Git Bot editbugs 2020-04-14 01:14:47 CEST
Simon Steinbeiss referenced this bugreport in commit 671b0da9e44491821e5eec88140d0e6f2f51d58b

Fix bug #13510 on gitlab for real

https://gitlab.xfce.org/skunnyk/my-project/commit/-/671b0da9e44491821e5eec88140d0e6f2f51d58b
Comment 32 Git Bot editbugs 2020-04-14 01:19:13 CEST
Simon Steinbeiss referenced this bugreport in commit 2293a8813239ff6242e73153bcd66e6be64897e9

Fix bug #13510 on gitlab for real

https://gitlab.xfce.org/skunnyk/my-project/commit/2293a8813239ff6242e73153bcd66e6be64897e9
Comment 33 Git Bot editbugs 2020-04-15 22:42:52 CEST
Simon Steinbeiss referenced this bugreport in commit 69fccfd8712a0259199f8da36de9dd5538e0aad8

Test commit bug #13510

https://gitlab.xfce.org/skunnyk/my-project/commit/69fccfd8712a0259199f8da36de9dd5538e0aad8

Bug #13510

Reported by:
Skunnyk
Reported on: 2017-04-20
Last modified on: 2020-05-20

People

Assignee:
Skunnyk
CC List:
1 user

Version

Version:
unspecified

Attachments

Additional information