Commit Graph

66 Commits

Author SHA1 Message Date
Simone Gotti
5e21089baa *: remove unneeded logging
remove many log.Info entries that where old debugging entries and move some of
them to the Debug level.
2019-06-14 11:28:00 +02:00
Simone Gotti
6e8d467c80 util: add ErrInternal
ErrInternal is an internal error that should be provided to the user (http api
will return a 500 with the error message)

It'll be used for any kind of error that are not auth or bad requests (like
errors to communicate to another service)
2019-06-11 10:59:21 +02:00
Simone Gotti
22bd181fc8 datamanager: implement data files splitting
split data files in multiple files of a max size (default 10Mib)
In this way every data snapshot will change only the datafiles that have some
changes instead of the whole single file.
2019-06-03 16:17:27 +02:00
Simone Gotti
6d095cbe50 readdb: ensure that we apply only etcd committed wals
Ensure that we apply only etcd commited wals to avoid doing an unuseful insert
when the wal becomes committed storage.
2019-06-03 18:02:09 +02:00
Simone Gotti
4d7605a86b gateway: improve ErrFromRemote handling
Don't create an ErrFromRemote wrapping the returned error but
wrap the ErrFromRemote

Also use xerrors Is/As to get the underlying error to return to api clients
while maintaining context for logging
2019-05-23 12:59:11 +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
8f1225da76 *: implement remote source update 2019-05-23 10:29:03 +02:00
Simone Gotti
b3867fb7ca objectstorage: add posix standard storage
rename the previous posix storage to posixflat and make it currently not user
selectable (since I'm not sure it's really worth using it).

The new posix storage uses the filesystem without any escaping so it's not a
real flat namespace.

This isn't a real issue since also minio is not a flat namespace and we are so
forced to use it like a hierarchycal filesystem.
2019-05-21 15:17:53 +02:00
Simone Gotti
6c11ab0596 *: implement update projectgroup 2019-05-14 17:53:48 +02:00
Simone Gotti
21e706a150 configstore: add get org members api/action 2019-05-14 12:57:53 +02:00
Simone Gotti
aeda922a7d *: rename deleteOrgMember to removeOrgMember 2019-05-14 11:20:09 +02:00
Simone Gotti
c5cdf01332 *: add organizations visibility 2019-05-14 10:56:17 +02:00
Simone Gotti
d551dcb820 configstore: implement projectgroup delete 2019-05-13 00:23:57 +02:00
Simone Gotti
5c15eb4db7 configstore: move getvariables to action 2019-05-13 00:23:08 +02:00
Simone Gotti
295ed6e39a configstore: move get secret(s) to action 2019-05-13 00:22:23 +02:00
Simone Gotti
0f9445aabe configstore: move get projecgroup projects/subgroups to action 2019-05-13 00:21:10 +02:00
Simone Gotti
c9fb7258ec configstore: fix delete remote source action 2019-05-10 00:02:37 +02:00
Simone Gotti
b0fe7e4115 *: implement delete organization member 2019-05-09 17:05:13 +02:00
Simone Gotti
620bae68df *: implement add/update org member 2019-05-09 16:47:22 +02:00
Simone Gotti
e1d0318c9b configstore: add UpdateProject api 2019-05-09 15:33:57 +02:00
Simone Gotti
79c1a60a36 configstore: update CreateProject action
* move validation to ValidateProject function
* remove wrong project group check
2019-05-09 15:32:27 +02:00
Simone Gotti
44d5b0f25a *: rename ConfigStore to Configstore 2019-05-07 23:42:42 +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
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
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
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
9349728997 configstore: add update user 2019-05-03 09:53:38 +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
1820e7c477 types: rename user UserName field to Name 2019-04-30 12:56:43 +02:00
Simone Gotti
2fab8ad85b configstore: check token name is not empty 2019-04-29 16:59:09 +02:00
Simone Gotti
95e73e66a0 oauth2: correctly populate token expiry data
* Populate the field when needed
* Convert it to a time instead of a duration
2019-04-29 14:57:07 +02:00
Simone Gotti
a5d6ac85a6 configstore: namespace changegroups 2019-04-29 10:37:23 +02:00
Simone Gotti
159abffa06 configstore: fix changegroup names
changegroup names are based on names that will contain slashes and could be very
long. So calculate the sha256 sum of the starting name and use it as the
changegroup name.
2019-04-29 10:24:05 +02:00
Simone Gotti
19877e679c configstore readdb: also resync changegroups 2019-04-29 10:15:44 +02:00
Simone Gotti
2c3e6bf9e4 wal: update and rename to datamanager
* Rename to datamanager since it handles a complete "database" backed by an
objectstorage and etcd

* Don't write every single entry as a single file but group them in a single
file. In future improve this to split the data in multiple files of a max size.
2019-04-26 16:00:03 +02:00
Simone Gotti
41e333d7ec *: rename "lts" to "ost"
`lts` was choosen to reflect a "long term storage" but currently it's just an
object storage implementation. So use this term and "ost" as its abbreviation
(to not clash with "os").
2019-04-27 15:16:48 +02:00
Simone Gotti
3642be6f21 */api: Use helpers for error handling
* client: always parse the json error message field and return its contents
* Use ErrBadRequest and ErrNotFound in every handler and command
* Gateway: by default pass underlying service error (configstore, runservice) to
client keeping the status code and message. In future, if some errors must be
masked, we should change the specific parts that need special handling.
2019-04-09 14:53:00 +02:00
Simone Gotti
4fb250a668 configstore api: improve response handling
* Always return a json message also on error. For internal errors return a
generic "internal server error" message to not leak the real internal error to
clients
* Return 201 Created on resource creation
* Return 204 No Content on resource deletion and other action with no json
output
2019-04-08 12:29:25 +02:00
Simone Gotti
04f3905ea1 client: fix content type header case 2019-04-08 12:28:15 +02:00
Simone Gotti
f3781c9087 *: fix rest methods
* use POST instead of PUT for resource creation
* use PUT instead of POST for resource special actions
2019-04-08 08:54:45 +02:00