Commit Graph

25 Commits

Author SHA1 Message Date
Simone Gotti 2a95c93f0d gateway: add UserCreateRun api and related action
add an api to execute a user direct run. This method will replace the current
custom webhook way to create a direct run.
2019-06-11 15:09:41 +02:00
Simone Gotti fafcf3a623 gitsource: add new methods to handle refs and commits
Add new methods to handle refs and commits and related urls
2019-06-11 11:07:39 +02:00
Simone Gotti 47b7c5040f gitsource: add repoinfo HTMLURL 2019-06-11 11:07:12 +02:00
Simone Gotti 580746d7f1 gitsource: update gitea client 2019-06-11 10:29:06 +02:00
Luigi Leoni 51a5594c89 gitlab: check getFile exists before content encoding 2019-05-29 15:51:34 +02:00
Simone Gotti 51945513bf gitsources: list only repo with enough permissions
ListUserRepos will return only repos where the user has enough permissions to
create webhooks and deploy keys
2019-05-23 16:58:20 +02:00
Simone Gotti 9b2ce717c7 *: migrate to "golang.org/x/xerrors"
Just a raw replace of "github.com/pkg/errors".

Next steps will improve errors (like remote errors, api errors, not exist errors
etc...) to leverage its functionalities
2019-05-23 11:23:14 +02:00
Simone Gotti b8bdd096fe gitea: don't check webhook signature if not sent
old versions of gitea doesn't provide a webhook signature but just the secret in
the payload

TODO(sgotti) check the payload secret in this case
2019-05-22 11:39:27 +02:00
Simone Gotti b22c197fef gitsources: add github gitsource 2019-05-15 23:46:21 +02:00
Simone Gotti 2d6ddd0e74 gitsources: add commit status of type `error` 2019-05-15 11:26:50 +02:00
Simone Gotti a7ecfee795 gitea: use custom http request for get tokens
Since the get tokens gitea api is used to do auth by username password we need
to know the api status code to detect if it's an unauthorized error (wrong
username/password) or another error.

Since the gitea client doesn't return the http response to inspect the status
code we'll use our own api call.
2019-05-13 14:21:41 +02:00
Simone Gotti 92de7591da gitsources: implement gitea oauth2 auth
As from https://github.com/go-gitea/gitea/pull/5378 gitea is an oauth2 provider.
2019-05-09 14:14:13 +02:00
Simone Gotti 649c42f75b gitsources: create secret and webhook secret
Use the webhook secret on webhook creation and check it and webhook receive
2019-05-07 18:29:31 +02:00
Simone Gotti fefa2819c9 gateway: use agola ID in gitsource tokenname 2019-04-30 12:13:12 +02:00
Simone Gotti 559a389b59 gitsources: add ListUserRepos method 2019-04-29 17:36:29 +02:00
Simone Gotti 507a9edb87 gitsources: add CreateCommitStatus method 2019-04-29 17:35:07 +02:00
Simone Gotti 9393830207 gitsource: add RefreshOauth2Token method to Oauth2Source 2019-04-29 15:39:59 +02:00
Simone Gotti 52bcf096c7 gitea source: add custom http transport 2019-04-29 11:24:03 +02:00
Simone Gotti ca1d837ecd webhook: use hook provided ssh url for cloning
Additionally don't save a CloneURL field inside the project type.

If in future some git source doesn't provide a clone url we could just calculate
it from project.RepoPath or call the remote api to retrieve it.
2019-04-11 16:49:07 +02:00
Simone Gotti 0a32b78359 gitsources: implement gitlab hooks
* Generalize to use repopath instead of (owner, reponame)
2019-04-03 15:01:21 +02:00
Simone Gotti 4cf72748b4 gitsources: update api
* Generalize to use repopath instead of (owner, reponame)
2019-04-03 15:01:21 +02:00
Simone Gotti 3d39553189 project create: user project path
Use project path for project creation and get the project clone url directly
from the remote source
2019-04-03 11:07:54 +02:00
Simone Gotti f383a0056d gateway gitsources: use owner id for deploy keys and webhook urls
In this way we could have multiple projects pointing to the same remote
repository and every projects will have its own deploy key and webhook url
2019-02-28 17:19:53 +01:00
Simone Gotti cae68c6971 Add our own git gitsource 2019-02-21 18:08:09 +01:00
Simone Gotti ba00398009 Add initial git sources implementations
* gitea
* gitlab
2019-02-21 16:06:34 +01:00