Commit Graph

217 Commits

Author SHA1 Message Date
Simone Gotti
ce7924d7fd runservice: use the path escaped cache key
Use the path escaped cache key so we can also handle cache keys with slashes
inside.
2019-05-08 12:15:17 +02:00
Simone Gotti
bec9476d6c runservice: store related runid with logs and archives
Logs and archives can be shared by multiple runs. So removing a run doesn't
imply that we could also remote the logs and archives since they could be
"referenced" by another run.

Store also the runids as specific objects along with the logs and archives so,
we'll remove them only when no runids objects exist.
2019-05-08 12:11:46 +02:00
Simone Gotti
43341f2cba *: rename GitServer to Gitserver 2019-05-08 15:23:13 +02:00
Simone Gotti
1e34dca95d runservice: split and simplify scheduler and executor naming
Also if they are logically part of the runservice the names runserviceExecutor
and runserviceScheduler are long and quite confusing for an external user

Simplify them separating both the code parts and updating the names:

runserviceScheduler -> runservice
runserviceExecutor -> executor
2019-05-07 23:56:10 +02:00
Simone Gotti
44d5b0f25a *: rename ConfigStore to Configstore 2019-05-07 23:42:42 +02:00
Simone Gotti
e4e7de4ad2 runservice/gateway: return run on run action 2019-05-07 23:23:58 +02:00
Simone Gotti
83273489e0 jwt: unify token generation functions 2019-05-07 18:30:20 +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
2675aee333 configstore: generate User and Project secret 2019-05-07 17:16:42 +02:00
Simone Gotti
4154be3370 *: set sshhostkey and skip check on remote source 2019-05-07 15:59:08 +02:00
Simone Gotti
afae185e11 *: rework run approval and annotations
* runservice: use generic task annotations instead of approval annotations
* runservice: add method to set task annotations

* gateway: when an user call the run task approval action, it will set in the
task annotations the approval users ids. The task won't be approved.

* scheduler: when the number of approvers meets the required minimum number
(currently 1) call the runservice to approve the task

In this way we could easily implement some approval features like requiring a
minimum number of approvers (saved in the task annotations) before marking the
run as approved in the runservice.
2019-05-06 15:19:29 +02:00
Simone Gotti
a590c21127 runservice api: get run from readdb 2019-05-06 15:18:49 +02:00
Simone Gotti
3139ef38d9 runservice readdb: get run from ost db if it's not in run db 2019-05-06 14:55:10 +02:00
Simone Gotti
a04dd62e91 gateway: initial authorization 2019-05-03 23:19:23 +02:00
Simone Gotti
081ac8a44f gateway: move webhook genGroup to common as GenRunGroup 2019-05-05 23:58:40 +02:00
Simone Gotti
6ef5649b21 gateway: set user admin value in context 2019-05-05 17:30:38 +02:00
Simone Gotti
6dfb789e77 gateway: project(group) create: rename parentID to parentRef 2019-05-05 17:19:23 +02:00
Simone Gotti
05ae46a72d gateway: move run logic from api to actions 2019-05-06 00:00:45 +02:00
Simone Gotti
6b5bd40417 gateway: move remaining remotesource logic from api to actions 2019-05-05 14:54:16 +02:00
Simone Gotti
42184d0b5b gateway: move remaining user logic from api to actions 2019-05-05 14:45:19 +02:00
Simone Gotti
96918e9bad gateway: move remaining org logic from api to actions 2019-05-05 14:36:14 +02:00
Simone Gotti
c889c2c1c2 gateway: move remaining project(group) logic from api to actions 2019-05-05 14:27:22 +02:00
Simone Gotti
64044df94d gateway: move secret logic from api to actions 2019-05-05 14:11:29 +02:00
Simone Gotti
f73f0ba434 gateway: move variable logic from api to actions 2019-05-04 15:16:49 +02:00
Simone Gotti
cb78ea48bc runservice: rename command(handler) to action(handler)
Since we're going to migrate all actions (also queries that now are implemented
in the api handlers) there
2019-05-03 23:59:21 +02:00
Simone Gotti
3f7e554f04 gateway: rename command(handler) to action(handler)
Since we're going to migrate all actions (also queries that now are implemented
in the api handlers) there
2019-05-03 23:48:49 +02:00
Simone Gotti
ca5b5f3a7e configstore: rename command(handler) to action(handler)
Since we're going to migrate all actions (also queries that now are implemented
in the api handlers) there
2019-05-03 23:35:25 +02:00
Simone Gotti
5a50a2681d util/errors: add ErrForbidden 2019-05-03 23:18:51 +02:00
Simone Gotti
af67198dec configstore: report project/projectgroup owners
Return project and projectgroup owner type (user or org) and their id.
2019-05-03 23:17:07 +02:00
Simone Gotti
81d656b7a3 configstore: implement organization members 2019-05-03 17:40:07 +02:00
Simone Gotti
a269347c9d types: add Admin field to User 2019-05-03 17:38:12 +02:00
Simone Gotti
041e8867f8 *: add creatorUserID and cretedAt to organization 2019-05-03 14:24:18 +02:00
Simone Gotti
c30707528f configstore: split commands in multiple files 2019-05-03 12:47:22 +02:00
Simone Gotti
60feff5cef configstore: add more validations
All the validation must be done inside the configstore since it's the source of
truth.

The gateway could also do some validation to avoid bad requests to the
configstore when needed or when the logic resides outside the configstore (like
project setup or user registration)
2019-05-03 12:41:49 +02:00
Simone Gotti
1f09eea949 project: add remote repository config type
RemoteRepositoryConfigType defines how a remote repository is configured and
managed. Currently only "remotesource" is supported.

In future other config types (like a fully manual config) could be supported.
2019-05-03 12:21:44 +02:00
Simone Gotti
ea02eed2d9 * api: accept both ids or names in the same endpoint
Simplify api to accept both ids or names in the same endpoint
2019-05-03 11:07:53 +02:00
Simone Gotti
6943c10dc9 types: add RemoteSourceID to Project
In future we may support specifying a remote source for a project without a
linked account and thus use a user provided token (saved in the project) or
other ways to define a remote repo (like standard git repos over ssh).
2019-05-03 09:55:37 +02:00
Simone Gotti
b9db3137ad gateway api: return user linked accounts 2019-05-03 09:54:47 +02:00
Simone Gotti
9349728997 configstore: add update user 2019-05-03 09:53:38 +02:00
Simone Gotti
ab7e4b8a4b gateway: add user remote repos API 2019-05-03 00:11:11 +02:00
Simone Gotti
0471bf0c30 validation: make uuid like names not valid
names that are valid uuids are not valid. This is needed to accept both names or
uuid in rest APIs without using a special syntax to distinguish them
2019-05-02 23:40:28 +02:00
Simone Gotti
bad18bf814 *: report objects size for objectstorage.WriteObject 2019-05-02 09:49:55 +02:00
Simone Gotti
34cfdfeb3b objectstorage: add size option to WriteObject
On s3 limit the max object size to 1GiB when the size is not provided (-1) or
the minio client will calculate a big part size since it tries to use the
maximum object size (5TiB) and will allocate a very big buffer in ram. Also
leave as commented out the previous hack that was firstly creating the file
locally to calculate the size and then put it (for future reference).
2019-05-02 09:47:38 +02:00
Simone Gotti
e964aa3537 objectstorage: add persist option to WriteObject
This options is a noop on s3 but on the posix implementation it becomes useful
when there isn't the need to have a persistent file, thus avoiding some fsync
calls.
2019-05-01 15:06:47 +02:00
Simone Gotti
68e6bd5bdf configstore: add project/projectgroup visibility 2019-04-30 17:09:26 +02:00
Simone Gotti
b1c9892378 configstore: report project/projectgroup path
and also parent path
2019-04-30 17:09:26 +02:00
Simone Gotti
c7585a6152 configstore: resolve also org and user paths 2019-05-03 13:48:19 +02:00
Simone Gotti
2215aaebfa configstore: rename GetParentPath to GetPath
and rename file from parent.go to resolve.go
2019-04-30 17:06:44 +02:00
Simone Gotti
984efb539e configstore: use augmented types for vars/secrets dynamic values 2019-04-30 16:28:01 +02:00
Simone Gotti
da2ac0ab38 util: add path functions
add IsParentPath and IsSameOrParent path functions and related tests
2019-04-30 16:24:04 +02:00