Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commit sha to create tag webhook payload #286

Closed
1 of 3 tasks
mjwwit opened this issue Nov 28, 2016 · 4 comments · Fixed by #300
Closed
1 of 3 tasks

Add commit sha to create tag webhook payload #286

mjwwit opened this issue Nov 28, 2016 · 4 comments · Fixed by #300
Assignees
Labels
Milestone

Comments

@mjwwit
Copy link
Contributor

mjwwit commented Nov 28, 2016

  • 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: harness/gitness#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": "[email protected]",
      "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
    },
    "name": "hello-world",
    "full_name": "gordon/hello-world",
    "description": "",
    "private": true,
    "fork": false,
    "html_url": "http:https://gogs.golang.org/gordon/hello-world",
    "ssh_url": "[email protected]:gordon/hello-world.git",
    "clone_url": "http:https://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": "[email protected]",
    "avatar_url": "https://secure.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
  }
}
@bkcsoft bkcsoft self-assigned this Nov 28, 2016
@bkcsoft bkcsoft added the type/enhancement An improvement of existing functionality label Nov 28, 2016
@bkcsoft bkcsoft added this to the 1.0.0 milestone Nov 28, 2016
@bkcsoft bkcsoft added type/bug and removed type/enhancement An improvement of existing functionality labels Nov 28, 2016
@strk
Copy link
Member

strk commented Nov 28, 2016

Go @bkcsoft go ! :)

@HZ89
Copy link

HZ89 commented 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==

@tboerger
Copy link
Member

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

@HZ89
Copy link

HZ89 commented 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

@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants