Add commit sha to create tag webhook payload #89

Closed
opened 2025-11-02 03:08:18 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @mjwwit on GitHub (Nov 28, 2016).

Originally assigned to: @bkcsoft on GitHub.

  • Gitea version (or commit ref): - (latest gogs tested 0.9.99)
  • Database:
    • PostgreSQL
    • MySQL
    • SQLite

Description

Drone 0.5 can not support tag hooks from Gitea when no commit sha is present in the webhook payload.
Drone needs the commit sha to request the .drone.yml config file through the Gitea API.

Drone issue link: https://github.com/drone/drone/issues/1870

Desired webhook payload:

{
+ "sha": "940bd336248efae0f9ee5bc7b2d5c985887b16ac",
  "ref": "v1.0.0",
  "ref_type": "tag",
  "repository": {
    "id": 1,
    "owner": {
      "id": 1,
      "username": "gordon",
      "full_name": "Gordon the Gopher",
      "email": "gordon@golang.org",
      "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
    },
    "name": "hello-world",
    "full_name": "gordon/hello-world",
    "description": "",
    "private": true,
    "fork": false,
    "html_url": "http://gogs.golang.org/gordon/hello-world",
    "ssh_url": "git@gogs.golang.org:gordon/hello-world.git",
    "clone_url": "http://gogs.golang.org/gordon/hello-world.git",
    "default_branch": "master",
    "created_at": "2015-10-22T19:32:44Z",
    "updated_at": "2016-11-24T13:37:16Z"
  },
  "sender": {
    "id": 1,
    "username": "gordon",
    "full_name": "Gordon the Gopher",
    "email": "gordon@golang.org",
    "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
  }
}
Originally created by @mjwwit on GitHub (Nov 28, 2016). Originally assigned to: @bkcsoft on GitHub. - Gitea version (or commit ref): - (latest gogs tested 0.9.99) - Database: - [ ] PostgreSQL - [ ] MySQL - [x] SQLite ## Description Drone 0.5 can not support tag hooks from Gitea when no commit sha is present in the webhook payload. Drone needs the commit sha to request the `.drone.yml` config file through the Gitea API. Drone issue link: https://github.com/drone/drone/issues/1870 Desired webhook payload: ```diff { + "sha": "940bd336248efae0f9ee5bc7b2d5c985887b16ac", "ref": "v1.0.0", "ref_type": "tag", "repository": { "id": 1, "owner": { "id": 1, "username": "gordon", "full_name": "Gordon the Gopher", "email": "gordon@golang.org", "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" }, "name": "hello-world", "full_name": "gordon/hello-world", "description": "", "private": true, "fork": false, "html_url": "http://gogs.golang.org/gordon/hello-world", "ssh_url": "git@gogs.golang.org:gordon/hello-world.git", "clone_url": "http://gogs.golang.org/gordon/hello-world.git", "default_branch": "master", "created_at": "2015-10-22T19:32:44Z", "updated_at": "2016-11-24T13:37:16Z" }, "sender": { "id": 1, "username": "gordon", "full_name": "Gordon the Gopher", "email": "gordon@golang.org", "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87" } } ```
GiteaMirror added the type/bug label 2025-11-02 03:08:18 -06:00
Author
Owner

@strk commented on GitHub (Nov 28, 2016):

Go @bkcsoft go ! :)

@strk commented on GitHub (Nov 28, 2016): Go @bkcsoft go ! :)
Author
Owner

@HZ89 commented on GitHub (Dec 19, 2016):

tag still not work, drone give back 404, when a tag delivery
gitea log is here

[Macaron] 2016-12-19 15:40:21: Started GET /RPM_Builder/Youzu_RPMs.git/info/refs?service=git-receive-pack for 192.168.42.251
2016/12/19 15:40:21 [D] Session ID: d451bd5caaf084a5
2016/12/19 15:40:21 [D] CSRF Token: Rn44b8gK2qKTcnOt_LHn682aILc6MTQ4MjEzMzIyMTA0MjgwMDM5NA==
[Macaron] 2016-12-19 15:40:21: Completed /RPM_Builder/Youzu_RPMs.git/info/refs?service=git-receive-pack 401 Unauthorized in 6.07528ms
[Macaron] 2016-12-19 15:40:21: Started GET /RPM_Builder/Youzu_RPMs.git/info/refs?service=git-receive-pack for 192.168.42.251
2016/12/19 15:40:21 [T] Dialing LDAP with security protocol (0) without verifying: false
2016/12/19 15:40:21 [T] LDAP will use BindDN.
2016/12/19 15:40:21 [D] Session ID: d5fab17a1e55f0a7
2016/12/19 15:40:21 [D] CSRF Token: MVtFVap6gQvcF6xJDiXLvEtMuP46MTQ4MjEzMzIyMTA2MTA4Njk4MQ==
2016/12/19 15:40:21 [T] Dialing LDAP with security protocol (0) without verifying: false
2016/12/19 15:40:21 [T] LDAP will use BindDN.
[Macaron] 2016-12-19 15:40:21: Completed /RPM_Builder/Youzu_RPMs.git/info/refs?service=git-receive-pack 200 OK in 325.485292ms
[Macaron] 2016-12-19 15:40:21: Started POST /RPM_Builder/Youzu_RPMs.git/git-receive-pack for 192.168.42.251
2016/12/19 15:40:21 [T] Dialing LDAP with security protocol (0) without verifying: false
2016/12/19 15:40:21 [T] LDAP will use BindDN.
2016/12/19 15:40:21 [D] Session ID: 50b0501f5c4c1cdd
2016/12/19 15:40:21 [D] CSRF Token: 1r8VSvXjCTke_2zYojS1MeFvG7c6MTQ4MjEzMzIyMTQwMjY2MTk4MQ==
2016/12/19 15:40:21 [T] Dialing LDAP with security protocol (0) without verifying: false
2016/12/19 15:40:21 [T] LDAP will use BindDN.
[git-module] /data/gitlab/ceph/gogs/rpm_builder/youzu_rpms.git: git show-ref --verify refs/tags/refs/tags/v0.0.5
2016/12/19 15:40:21 [...tea/models/update.go:131 PushUpdate()] [E] GetTagCommitID[refs/tags/v0.0.5]: object does not exist [id: refs/tags/refs/tags/v0.0.5, rel_path: ]
2016/12/19 15:40:21 [T] DeliverHooks [repo_id: 5]
2016/12/19 15:40:21 [T] AddTestPullRequestTask [head_repo_id: 5, head_branch: refs/tags/v0.0.5]: finding pull requests
[Macaron] 2016-12-19 15:40:21: Completed /RPM_Builder/Youzu_RPMs.git/git-receive-pack 200 OK in 537.17117ms
2016/12/19 15:40:21 [T] AddTestPullRequestTask [base_repo_id: 5, base_branch: refs/tags/v0.0.5]: finding pull requests
2016/12/19 15:40:23 [T] Hook delivery failed: 09afbc5f-d6d3-4e31-8102-0ca74053ab28
[Macaron] 2016-12-19 15:42:37: Started GET /RPM_Builder/Youzu_RPMs/settings/hooks/10 for 192.168.42.251
2016/12/19 15:42:37 [D] Session ID: fdc28ecacbf97bca
2016/12/19 15:42:37 [D] CSRF Token: y23MahUmnNk-3x8SfbW1oF5MT_I6MTQ4MjEyOTU3NDM3MDAyNDI2MA==
@HZ89 commented on GitHub (Dec 19, 2016): tag still not work, drone give back 404, when a tag delivery gitea log is here ``` [Macaron] 2016-12-19 15:40:21: Started GET /RPM_Builder/Youzu_RPMs.git/info/refs?service=git-receive-pack for 192.168.42.251 2016/12/19 15:40:21 [D] Session ID: d451bd5caaf084a5 2016/12/19 15:40:21 [D] CSRF Token: Rn44b8gK2qKTcnOt_LHn682aILc6MTQ4MjEzMzIyMTA0MjgwMDM5NA== [Macaron] 2016-12-19 15:40:21: Completed /RPM_Builder/Youzu_RPMs.git/info/refs?service=git-receive-pack 401 Unauthorized in 6.07528ms [Macaron] 2016-12-19 15:40:21: Started GET /RPM_Builder/Youzu_RPMs.git/info/refs?service=git-receive-pack for 192.168.42.251 2016/12/19 15:40:21 [T] Dialing LDAP with security protocol (0) without verifying: false 2016/12/19 15:40:21 [T] LDAP will use BindDN. 2016/12/19 15:40:21 [D] Session ID: d5fab17a1e55f0a7 2016/12/19 15:40:21 [D] CSRF Token: MVtFVap6gQvcF6xJDiXLvEtMuP46MTQ4MjEzMzIyMTA2MTA4Njk4MQ== 2016/12/19 15:40:21 [T] Dialing LDAP with security protocol (0) without verifying: false 2016/12/19 15:40:21 [T] LDAP will use BindDN. [Macaron] 2016-12-19 15:40:21: Completed /RPM_Builder/Youzu_RPMs.git/info/refs?service=git-receive-pack 200 OK in 325.485292ms [Macaron] 2016-12-19 15:40:21: Started POST /RPM_Builder/Youzu_RPMs.git/git-receive-pack for 192.168.42.251 2016/12/19 15:40:21 [T] Dialing LDAP with security protocol (0) without verifying: false 2016/12/19 15:40:21 [T] LDAP will use BindDN. 2016/12/19 15:40:21 [D] Session ID: 50b0501f5c4c1cdd 2016/12/19 15:40:21 [D] CSRF Token: 1r8VSvXjCTke_2zYojS1MeFvG7c6MTQ4MjEzMzIyMTQwMjY2MTk4MQ== 2016/12/19 15:40:21 [T] Dialing LDAP with security protocol (0) without verifying: false 2016/12/19 15:40:21 [T] LDAP will use BindDN. [git-module] /data/gitlab/ceph/gogs/rpm_builder/youzu_rpms.git: git show-ref --verify refs/tags/refs/tags/v0.0.5 2016/12/19 15:40:21 [...tea/models/update.go:131 PushUpdate()] [E] GetTagCommitID[refs/tags/v0.0.5]: object does not exist [id: refs/tags/refs/tags/v0.0.5, rel_path: ] 2016/12/19 15:40:21 [T] DeliverHooks [repo_id: 5] 2016/12/19 15:40:21 [T] AddTestPullRequestTask [head_repo_id: 5, head_branch: refs/tags/v0.0.5]: finding pull requests [Macaron] 2016-12-19 15:40:21: Completed /RPM_Builder/Youzu_RPMs.git/git-receive-pack 200 OK in 537.17117ms 2016/12/19 15:40:21 [T] AddTestPullRequestTask [base_repo_id: 5, base_branch: refs/tags/v0.0.5]: finding pull requests 2016/12/19 15:40:23 [T] Hook delivery failed: 09afbc5f-d6d3-4e31-8102-0ca74053ab28 [Macaron] 2016-12-19 15:42:37: Started GET /RPM_Builder/Youzu_RPMs/settings/hooks/10 for 192.168.42.251 2016/12/19 15:42:37 [D] Session ID: fdc28ecacbf97bca 2016/12/19 15:42:37 [D] CSRF Token: y23MahUmnNk-3x8SfbW1oF5MT_I6MTQ4MjEyOTU3NDM3MDAyNDI2MA== ```
Author
Owner

@tboerger commented on GitHub (Dec 19, 2016):

Your webhook failed to deliver, so the drone log could be interesting.

@tboerger commented on GitHub (Dec 19, 2016): Your webhook failed to deliver, so the drone log could be interesting.
Author
Owner

@HZ89 commented on GitHub (Dec 20, 2016):

drone log just 404, i found the 404 is from gitea api, api/v1/repos/owner/repos/raw/file always 404.
#426 @tboerger

@HZ89 commented on GitHub (Dec 20, 2016): drone log just 404, i found the 404 is from gitea api, api/v1/repos/owner/repos/raw/file always 404. #426 @tboerger
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#89