Filip Troníček 3af824e603
Implement ListOrganizationPrebuilds (#19326)
* Define `ListOrganizationPrebuilds`

* Fix because of name changes

* Add unimplemented `listOrganizationPrebuilds`

* Crazy stuff right here

* Address huiwen's comments

* Fix more types

* sad™

* trrr

* WIP API changes

* Add configuration id and search term filtering

* Filtering

* Offload prebuild listing to prebuild manager

* unused thingy delete

* Add filtering by status

* `listPrebuilds` -> `listOrganizationPrebuilds`

* Configuration filtering could be done with a branch

... what do you say?

* Implement branch filtering

* Update pagination rules

* Fix pagination limit validation error

* Migrate one more

* Fix org id for prebuild listing

* Update components/gitpod-db/src/typeorm/workspace-db-impl.ts

Co-authored-by: Siddhant Khare <siddhant@gitpod.io>

* Apply code suggestions

* Align pagination with config service

* Status filter validation

* Align org id usage

* Revert back to `listPrebuilds`

* Update components/gitpod-db/src/typeorm/workspace-db-impl.ts

Co-authored-by: Siddhant Khare <siddhant@gitpod.io>

* Bring in search

* Fix proj id instead of org id

* Fix search query‽‽‽

* nit 💄

---------

Co-authored-by: Siddhant Khare <siddhant@gitpod.io>
Co-authored-by: Huiwen Huang <huiwen@gitpod.io>
2024-01-24 11:59:01 +02:00
..
2022-12-08 13:05:19 -03:00
2022-12-08 13:05:19 -03:00
2022-12-08 13:05:19 -03:00
2020-08-25 09:25:15 +00:00
2022-12-08 13:05:19 -03:00
2022-12-08 13:05:19 -03:00

Gitpod-db

Contains all the database related functionality, implemented using typeorm.

Working on gitpod-protocol component

When you are making changes to gitpod-protocol component, make sure to run yarn build in gitpod-protocol folder to make sure your changes will be rebuild. Also consider running yarn watch so that any changes are rebuilt in realtime.

Adding a new table

  1. Create a migration - use the baseline as an exemplar
  2. Create a new entity that implements the requisite interface or extend an existing entity as required - see db-user.ts
  3. If it is a new table, create the matching injectable ORM implementation and interface (if required) - see user-db-impl.ts and user-db.ts. Otherwise extend the existing interface and implementation as required.
  4. Add the injectable implementation to the DB container module, binding the interface and implementation as appropriate, otherwise it will not be instantiated correctly e.g.
    bind(TypeORMUserDBImpl).toSelf().inSingletonScope();
    bind(UserDB).toService(TypeORMUserDBImpl);
  1. Add the new ORM as an injected component where required e.g. in user-controller.ts
    @inject(UserDB) protected readonly userDb: UserDB;