lizheming
(lizheming)
December 18, 2018, 1:44am
1
Drone have upgrade to gitlab api v4 long ago
committed 12:50AM - 09 Sep 17 UTC
Update gitlab API to version v4 #2068
Can we compatitable with gitlab v3 api with some configure? just because my company is using Gitlab 8 and it seems no update plan in short time.
lizheming
(lizheming)
December 20, 2018, 3:14pm
2
OK, I find a environment DRONE_GITLAB_V3_API
which not mention in doc can set drone use v3 api in drone 0.8.
func setupGitlab(c *cli.Context) (remote.Remote, error) {
if c.Bool("gitlab-v3-api") {
return gitlab3.New(gitlab3.Opts{
URL: c.String("gitlab-server"),
Client: c.String("gitlab-client"),
Secret: c.String("gitlab-secret"),
Username: c.String("gitlab-git-username"),
Password: c.String("gitlab-git-password"),
PrivateMode: c.Bool("gitlab-private-mode"),
SkipVerify: c.Bool("gitlab-skip-verify"),
})
}
return gitlab.New(gitlab.Opts{
URL: c.String("gitlab-server"),
Client: c.String("gitlab-client"),
Secret: c.String("gitlab-secret"),
Username: c.String("gitlab-git-username"),
Password: c.String("gitlab-git-password"),
PrivateMode: c.Bool("gitlab-private-mode"),
SkipVerify: c.Bool("gitlab-skip-verify"),
This file has been truncated. show original
lizheming
(lizheming)
December 20, 2018, 3:24pm
3
so does the config still exist in drone 1.0 @bradrydzewski ? sorry I can’t see source code for 1.0 so I can’t check this question by myself. I have tried to use GITLAB_V3_API
and GITLAB_CLIENT_V3_API
, both doesn’t work.
lizheming
(lizheming)
December 22, 2018, 12:46am
4
It seems gitlab v3 api have removed from 1.0 version. And pluggable driver feature will support in the future. I’d like waiting for it.
opened 10:23PM - 02 Dec 18 UTC
closed 06:11PM - 27 Jun 19 UTC
It would be interesting to have an RPC driver that lets you implement your own s… cm client. This could be useful when you need to test / implement a driver that is not currently supported, or when you need to customize or override how an existing driver behaves.
I have started an example branch here:
https://github.com/drone/go-scm/tree/rpc
Some challenges:
1. the rpc client will need to pass oauth1/2 credentials from the client to server. How do we do this in a generic and customizable way?
2. some of the abstractions in this library currently leak. Specifically we need to know how to create a netrc file for cloning (in Drone) and we use the driver name to determine the exact format. We would need to work around this. Also we use the driver name to decide whether or not to ignore certain webhook types. For example, GitHub may use a `push` webhook for tags, and ignore `tag_create` webhooks because we get more information from the push.
3. we will need to split parsing the webhook and validating the signature into separate methods. Doing this in a single function with a callback is not conducive to this rpc proposal.
4. ideally we would do simple REST rpc (I'd prefer not to pull in a giant dependency like grpc). We would probably have to come up with some sort of convention for how we want to handle routing, passing input parameters, etc. Maybe just simple jsonrpc?