Commit Graph

20 Commits

Author SHA1 Message Date
Simone Gotti fe9e3e8317 configstore: implement project move 2019-09-27 11:07:49 +02:00
Simone Gotti c1ff28ef9f *: export clients and related types
Export clients and related packages.

The main rule is to not import internal packages from exported packages.

The gateway client and related types are totally decoupled from the gateway
service (not shared types between the client and the server).

Instead the configstore and the runservice client currently share many types
that are now exported (decoupling them will require that a lot of types must be
duplicated and the need of functions to convert between them, this will be done
in future when the APIs will be declared as stable).
2019-08-02 12:02:01 +02:00
Simone Gotti fd26e617b3 configstore: move configstore types inside configstore package
Since they're not types common to all the services but belongs to the
configstore.

Next step will be to make them local to the configstore and not directly used by
other services since these types are also stored.
2019-08-02 10:05:47 +02:00
Simone Gotti b8c2b4020a db: use context functions
Use the go sql context functions (ExecContext, QueryContext etc...)

The context is saved inside Tx so the library users should only pass it one time
to the db.Do function.
2019-07-25 14:49:53 +02:00
Simone Gotti 8d67844cc4 *: use vanity url
use agola.io domain
2019-07-01 11:40: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 c5cdf01332 *: add organizations visibility 2019-05-14 10:56:17 +02:00
Simone Gotti e1d0318c9b configstore: add UpdateProject api 2019-05-09 15:33:57 +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 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 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 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 595590e611 api: use httpError helper everywhere 2019-04-05 16:33:00 +02:00
Simone Gotti 8b92b6f55c initial project group impl
and related api updated
2019-03-14 14:36:18 +01:00
Simone Gotti 3b8a1d684b configstore: use httpError everywhere 2019-03-14 09:34:05 +01:00
Simone Gotti 41002efbff *: add organizations 2019-02-28 15:52:35 +01:00
Simone Gotti 57c756a5a4 configstore: initial implementation 2019-02-21 16:08:30 +01:00