-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Tag Hooks not working for Gogs #1870
Comments
I have a patch to improve the tag implementation that I will submit shortly, however, Gogs does not return the sha in the tag hook. This is a problem for Drone because we need a sha in order to fetch the .drone.yml using the Gogs API. I think we've done as much as we can from the Drone side of things, and now require improvements to the Gogs hook payload to include sha: {
+ "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"
}
} |
For gitea we already merged a fix for that, but we can't influence Gogs as unknwon is not available. |
Before this can be closed, a change is required in Drone. See go-gitea/gitea#420 (comment) for details |
I'm not sure why it uses the API for this at all? just regular |
It may have been part of @bradrydzewski's fix, because the SHA was not included in the webhook payload at first. It's just that it was never going to work because of an incorrect implementation. As far as I can see, there are two possible solutions now:
|
I think that we need something like GitHub because gogs try to implement
API like GitHub.
20 Дек 2016 г. 16:20 пользователь "Michael de Wit" <notifications@github.com>
написал:
… It may have been part of @bradrydzewski <https://github.com/bradrydzewski>'s
fix, because the SHA was not included in the webhook payload at first. It's
just that it was never going to work because of an incorrect implementation.
As far as I can see, there are two possible solutions now:
1. Fix the current raw API implementation, correctly using the short
ref. The upside of this fix will be that it will also be compatible with
Gogs.
2. Remove usage of the raw API and use the SHA to directly access the
file, as suggested by @bkcsoft <https://github.com/bkcsoft>. The
upside is that this is probably very similar to other Git services, the
downside is that Gogs will not work with this, since it's missing a SHA in
the payload.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1870 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAdYGwlrcrbS4sPd9fCQsbhHcC8J3lwyks5rJ9YFgaJpZM4K7t8q>
.
|
I prefer this option.
The potential problem with this option is Gogs and Gitea will eventually implement application oauth, granting access to API endpoints. For this reason I would prefer the Drone codebase to rely on the API endpoints as much as possible. |
Hi, any work on progress in this issue? |
@lunny I'm working on a PR |
👍 |
tested in my local, fantastic |
same issue here with latest gogs 0.9.113 (released yesterday). |
Drone does not support PR or branch create events. It supports push events. Lack of PR support is documented |
OK thank you! may be because gogs has delivery on these events, caused me to expect drone to support them!!! sorry! |
There is an open issue for PR support if you want to subscribe to #1605 It is certainly a feature I'd like to see, but unfortunately I have other items I need to focus on right now. Certainly open to contributions, though. |
merged fix, thanks! |
Tag hook support for Gogs was introduced in #1498 but is not working (anymore).
I tested using the latest Drone 0.5 image from Docker Hub and the latest version of Gogs on Docker Hub.
The Gogs webhook payload is:
It also sends the following headers:
The Drone response is successful (200 OK), but the body is empty and no build is triggered (the project has steps for "tag" events).
Tag Hooks are enabled in the Drone repository settings, and Create hooks are enabled in the Gogs repository settings.
The text was updated successfully, but these errors were encountered: