647 Commits

Author SHA1 Message Date
Sven Efftinge
0a3e22ba3d
[usage] track email for free allowance (#19303)
* [usage] track email for free allowance

* [db] d_b_free_credits: Add indexes for userId and email

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-01-04 10:49:41 +02:00
Huiwen
6c0a978eee
Revert "Revert "Add org-level workspace class restrictions"" - Server (#19275)
* Revert "Revert "Add org-level workspace class restrictions (#19191)" (#19272)"

This reverts commit 2c805ad0fcad05aa3c3983c08302ad4f16dc1e69.

* Fix build
2023-12-15 15:24:22 +02:00
Alex Tugarev
671f1c6f04
[gitpod-db] AddOrgSettingWorkspaceClass1701725025283 (#19273) 2023-12-15 13:14:22 +02:00
Alex Tugarev
2c805ad0fc
Revert "Add org-level workspace class restrictions (#19191)" (#19272)
This reverts commit 653d858fa8d5edef1717a2319bc02cf356a10fc9.
2023-12-15 12:43:22 +02:00
Huiwen
653d858fa8
Add org-level workspace class restrictions (#19191)
* Add org-level maxmium workspace class limit

* [papi] add ListOrganizationWorkspaceClasses method

* Use papi in dashboard

* Validate when updating

* Fix bug

* Make it select default

* Align figma

* Option checking

* fixup

* Use switch button

* Add feature flag

* `invaldiator2` => `invalidateWorkspaceClasses`

* Don't allow to all if selected ones are removed from installation

* Update respond error msg

* dashboard show error msg

* fixup

* update proto doc

* Apply suggestions from code review

Updated error wording.

* update order

* Fix edge case

* Hide delete scope if not owner

* Update error msg

* Not cache org ws cls

* Force update org info

* Rename query file

* Add todos

* Remove refetch

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
Co-authored-by: Laurie T. Malau <laurie@gitpod.io>
2023-12-15 08:48:22 +02:00
Filip Troníček
aa4fc129be
Conditionally apply org id filter to project lookup (#19224)
* Conditionally apply org id filter to project lookup

* Add DB test
2023-12-11 11:17:18 +02:00
Brad Harris
85fb744996
Adding prebuild status filter to repo configs list ui (#19205)
* Adding prebuildsEnabled filter to projects search query

* adding prebuilds_enabled param

* stubbing out UI for prebuild status filter

* mark prebuilds_enabled as optional so we have an undefined state

* ui stuff

* whoopsie

* drop animations for now

* comments

* cleanup

* convert to string

* consider prebuild filter in showing table

* add prebuilds query param

* fix issue w/ fragment around routes preventing 404 handler
2023-12-08 20:57:15 +02:00
Filip Troníček
46ff2d0121
Scope config lookup to org (#19217) 2023-12-08 08:50:15 +02:00
Alex Tugarev
cf2facc944
Fix team-db spec (#19207) 2023-12-07 08:48:14 +02:00
Alex Tugarev
e4ccbf0b4d
GetAuthenticatedUser in Dashboard (#19142)
* [dashboard] remove unused service mock

* [dashboard] use `GetAuthenticatedUser` instead of `getLoggedInUser`

* fixup: override workspaceAutostartOptions

also fix toDurationString call

* fixup: move `isOnboardingUser` to dashboard

* fixup: move getProfile from protocol to common

* fixup fromWorkspaceAutostartOption

* move getPrimaryEmail to common and clean up

* rm getProfile from protocol, use ProfileDetails

* fixup missing leeway dependencies

* fix getPrimaryEmail

* fix resetting workspace timeout

* [gitpod-db] remove dependency to `@gitpod/public-api-common`

* cleanup BUILD.yaml
2023-12-06 17:42:14 +02:00
Sven Efftinge
ad2a077973
[db] fix the query for non-fga migrated users (#19194) 2023-12-05 15:03:12 +02:00
Jean Pierre
a997229da8
[public-api] Add installation service (#19150)
* Add installation service

* Fix dashboard

* Fix

* Fix

---------

Co-authored-by: Huiwen <mhqnwt@gmail.com>
2023-11-30 01:12:07 +02:00
Sven Efftinge
6ff405b964
[build] make build incremental (#19106) 2023-11-22 08:17:00 +02:00
Filip Troníček
6f7ff4f7f4
updateConfiguration (#19080)
* `updateConfiguration`

* typdate

* Try with no deeply nested property

* JKADFkosaNcISADFuisabnfhjl hjkafb ashjdbjbhj

* Constrain even further

* Return the configuration

* Fix update mutation

* Only update necessary properties

* Implement name changes

* typastuff

* 🙄

* Mutation update

* 🤷‍♂️

* Type fixes

* Conditionally pass in name

* Partials

* Fix type mishap

* Update mutation name

* Tweak types

* Reduce abstractions

* Only supply name if applicable

* Better partial assignment

* Deepmerge with originals

* Only update fully when necessary

* Fix name conversion in papi converter

Co-authored-by: Gero Posmyk-Leinemann <32448529+geropl@users.noreply.github.com>

* Assert some converted properties to not exist

* Disallow empty configuration names

* Add cache update todo

* fix type vs class

* Error toasts

* Be less strict about value of name

* Toast the actual updated name

* Fix tests :-)

---------

Co-authored-by: Gero Posmyk-Leinemann <32448529+geropl@users.noreply.github.com>
2023-11-21 22:42:00 +02:00
Alex Tugarev
3b85bf13e1
[server] remove unused getFeaturedRepositories (#19100) 2023-11-21 16:42:59 +02:00
Milan Pavlik
f0c8a858c9
[baseserver] Emit metrics for logs produced by level ENG-349 (#19063)
* [baseserver] Emit metrics for logs produced by level

* fix

* fix

* fix

* fix

* Fix

* Fix

* fix

* retest

* fix
2023-11-21 12:26:58 +02:00
Jean Pierre
4ac04ee19e
[public-api] Migrate envvarService (#19067)
* Migrate envvarService

* update

* fix tests

* nit

* Fix

* Fix

* 💄

---------

Co-authored-by: Huiwen <mhqnwt@gmail.com>
2023-11-20 17:27:57 +02:00
Brad Harris
eaae6cc6f4
Repository Config list page (#19039)
* fixing pagination logic

* wip

* flushing out rows

* adding missing creationTime

* adjusting result count copy

* fix offset... again

* Flushing out table UI a bit more

* Flushing out table UI a bit more

* comment for remembering to use search params

* more comments

* fix pages count

* copy/responsive adjustments

* updating search project query & service

* pass org id along and check permission in service

* Extracting table components

* cleanup

* fix menu copy
2023-11-14 18:49:52 +02:00
Anton Kosyakov
0ec003754e
[public-api] align with API guidelines (#19038) 2023-11-14 13:09:51 +02:00
Wouter Verlaek
185c0428c2
[scrubber] Improve KeyValue performance (#19052)
* [scrubber] Improve KeyValue performance

* Update benchmark comment

* update go mod

* Add metaID to hashed fields

---------

Co-authored-by: Pudong Zheng <pudong@gitpod.io>
2023-11-10 16:17:48 +02:00
Christian Weichel
bb51f07988
Collect workspace classes from workspace cluster (#19003)
* Extend ws-manager API to support workspace class descriptions

fixes ENG-1065

* Extend  DescribeCluster in ws-manager-mk2

to acurately report the available workspace classes

fixes ENG-1066

* Add workspace classes to cluster in DB

* Intergrate workspace cluster collection in ws-manager-bridge

* Feature flag off discovered workspace class usage

* Fix build

* Add unittest for getSupportedWorkspaceClasses

* Fix workspace class storage

* Adress review feedback
2023-11-10 13:13:48 +02:00
Alex Tugarev
b2d501842f
[server] move FGA calls into AuthProviderService (#19017)
* [server] move FGA calls into AuthProviderService

* split internal upsert method `updateAuthProvider` into create and update
* refactor: move `getAuthProviders` logic from gitpod-server-impl to auth-provider-service
* adding db tests for auth provider server
* use redacted results in service

* Fix typos

* extract helper functions for scopes

* add more tests

* as regular member, should find org-level providers if no built-in providers present
* as regular member, should find only built-in providers if present

---------

Co-authored-by: Huiwen <mhqnwt@gmail.com>
2023-11-10 10:25:47 +02:00
Sven Efftinge
4de380534b
[usage] export creation and stopped time (#19047) 2023-11-09 14:59:47 +02:00
Brad Harris
df7929ce8a
Adding ConfigurationServiceAPI (#19020)
* adding ConfigurationServiceAPI

* binding config service api to server

* use getConfiguration in dashboard

* adding missing binding

* use ApplicationError's

* add protobuf classes to query client hydration

* fixing pagination param & query

* changing to import statements for consistency and clarity on what the imports are for

* cleanup

* dropping config settings for create for now

* use protobuf field names in error messages

* removing optional on fields

* fixing converters to account for non-optional (undefined) fields

* update test

* adding more tests for findProjectsBySearchTerm

* fixing test to use offset correctly

* convert pagination args correctly
2023-11-08 22:42:46 +02:00
Sven Efftinge
ae38d86476
[linting] Enable eslint/no-unsafe-argument (#18965) 2023-10-23 12:20:31 +03:00
Sven Efftinge
8ac11b1b36
[db] userById fails on undefined (#18962) 2023-10-20 15:48:28 +03:00
Gero Posmyk-Leinemann
5bf82cd20d
Move towards sync deletion (away from PeriodicDeleter) - step II/II (#18866)
* [db] DBTeam: drop deleted column (unused)

* [db] DBProject: drop deleted column (unused)

* [db] Drop table d_b_user_storage_resource

* [db] DBTokenEntry: drop deleted column (unused)

* [db] DBAuthProviderEntry: drop deleted column (unused)

* [db] DBGitpodToken: drop deleted column (unused)

* [db] DBTeamMembership: drop deleted column (unused)

* [db] DBProjectUsage: drop deleted column (unused)

* [db] DBUserSshPublicKey: drop deleted column (unused)

* [server] Fix flaky test

* [db] Make backwards-compatible to mysql 5.7
2023-10-06 09:59:14 +03:00
Alex Tugarev
b2260d021e
Migrate Prebuild settings – EXP-672 (#18842)
* [protocol] Add PrebuildSettings to ProjectSettings

* add migration function

* add migration function and test

* update protocol helper functions

* update prebuild manager

* use new prebuild setting in frontend

* update papi

* fix papi test

* rename var

* fix papi mapping

* deprecation note

* update migration function

* fix prebuild-manager

* fixup server

* fix Enable Prebuilds on Project Settings

* Use Project.getPrebuildSettings
and

* fix countUnabortedPrebuildsSince

* improve usage of default settings

* fix Build Branches select

* fix papi conversion 🤯

* don't save empty pattern strings

* fix papi-server conversion and align naming of prebuild settings

* fix getPrebuildSettings

* [prebuilds] changed prebuild semantics

- no more incremental prebuilds
- always incremental workspace
- never wait for running prebuilds

---------

Co-authored-by: svenefftinge <sven@gitpod.io>
2023-10-05 17:37:13 +03:00
Gero Posmyk-Leinemann
8d94dd8d01
Use User.fgaRelationshipsVersion instead of User.additionalAttributes.fgaRelationshipsVersion (#18838)
* [db] Add User.fgaRelationshipsVersion

* [server] Use User.fgaRelationshipsVersion
2023-09-29 09:34:07 +03:00
Gero Posmyk-Leinemann
d00f9c0df2
[db] Move towards sync deletion (away from PeriodicDeleter) - step I/II (#18833)
* [db] Tables: remove entries without deletionColumn (not used anymore)

* [db] DBAuthProviderEntry: Switch to sync deletion

* [db] DBTokenEntry: Switch to sync deletion

* [db] DBTeamMembership: Switch to sync deletion

* [db] DBUserStorageResource: remove from periodic deleter

* [db] DBGitpodToken: Switch to sync deletion

* [db] DBProjectUsage: Switch to sync deletion

* [db] DBUserSSHPublicKey: Switch to sync deletion
2023-09-29 09:15:07 +03:00
Gero Posmyk-Leinemann
83493bdb86
[db] Add index for user.verificationPhoneNumber (#18836) 2023-09-28 15:17:08 +03:00
Gero Posmyk-Leinemann
11fa2f3d84
[db] DBWorkspace: add ind_basedOnPrebuildId (#18832) 2023-09-28 15:13:07 +03:00
Pudong
d18ee26dd1
Fix compatibility issues with db-migration (#18831) 2023-09-28 08:39:06 +03:00
Gero Posmyk-Leinemann
91f76d0b76
[db] UserEnvVar: add index ind_userID (#18821) 2023-09-27 14:31:06 +03:00
Gero Posmyk-Leinemann
b21828b7eb
[usage] Add index for usage.draft (#18820) 2023-09-27 13:28:06 +03:00
Gero Posmyk-Leinemann
f617ea2a0c
[db] DBPrebuiltWorkspace: Add index ind_creationTime (#18818) 2023-09-27 13:26:06 +03:00
Gero Posmyk-Leinemann
6fce846355
[db] Optimize WorkspaceDB.findWorkspacesForGarbageCollection to avoid full table scan (#18817) 2023-09-27 10:31:06 +03:00
Gero Posmyk-Leinemann
3e552a3752
[db] DBCodeSyncResource/-Collection: Drop deleted column (#18808) 2023-09-27 10:06:05 +03:00
Gero Posmyk-Leinemann
2c7c770061
[server, usage, db] Drop CostCenter.deleted (not used) (#18809) 2023-09-27 10:05:06 +03:00
Gero Posmyk-Leinemann
ec8ca77143
[usage] FindRunningWorkspaceInstances: Make sure we use an index (#18807)
qcler
2023-09-27 09:16:06 +03:00
Sven Efftinge
c6e90d48cc
[stripe] reconcile missing invoices (#18810) 2023-09-26 18:39:05 +03:00
Manuel Alejandro de Brito Fontes
8ef82ff356
Update go modules to 1.21 (#18805) 2023-09-26 17:52:05 +03:00
Sven Efftinge
14a21a7657
[projects] lookup projects by id not cloneURL (#18774) 2023-09-25 11:13:04 +02:00
Huiwen
a2b5b00db1
[server,dashboard] improve org default image input placeholder (#18746)
* [server,dashboard] improve org default image input placeholder

* fix build failed

* Use null instead of `NULL_TO_UNDEFINED`

* fixup

* fixup toast not shown
2023-09-20 10:03:59 +02:00
Huiwen
04e576fbe0
Add default workspace image to org setting (#18723)
* Add default workspace image to org setting

* [db] add migration

* fixup

* [dashboard] add org default image settings

* fixup

* dashboard fixup

* Add server image test TODO

* [server] assign global workspace default image

* [dashboard] allow to submit empty string (will fallback to global default)

* [gp-cli] support gp validate with default image

* [dashboard] save default image

* fixup

* fixup

* [gp-cli] improve output

* [gp-cli] improve gp init

* [gp-cli] gp validate compatibility

* Update components/dashboard/src/teams/TeamSettings.tsx

Co-authored-by: Filip Troníček <filip@gitpod.io>

* Remove org id / get org settings in supervisor

* Remove `WorkspaceConfigContext`

* Add unit tests

* Rename to `DefaultWorkspaceImage`

* Update components/dashboard/src/teams/TeamSettings.tsx

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>

* Add empty image fallback to supervisor

* Fix default workspace image setup

* Update org settings fields

* fixup

* Allow empty image to set to default one

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
2023-09-19 14:51:58 +02:00
Alex Tugarev
0189623c4b
🧹 Update mocha and remove resolutions (#18736)
* remove resolutions in root package.json

update mocha to avoid pulling in minimatch@3.0.4

* adjust mocha config

* also consider *.spec.db.*

* re-add missing exclude of node_modules

* remove recursive

* fix mocha execution
2023-09-19 09:22:58 +02:00
Gero Posmyk-Leinemann
5cb145e57f
Reconcile startWorkspace (#18673)
* [server] Reconcile workspace starts using redlock

* [server] Check abortSignal before updating the DB state

* [server] Add feature flag workspace_start_controller

review comments
2023-09-14 08:40:53 +02:00
Gero Posmyk-Leinemann
64080312e7
[db] Run test against the same (bitnami/)mysql:8.0.33 version (#18373) 2023-09-06 15:28:03 +02:00
Sven Efftinge
71912f721b
Allow renaming project (#18630)
remove project#slug
2023-09-04 09:42:01 +02:00
Gero Posmyk-Leinemann
86fa3ba709
[server] Separate instance creation from instance starting (again) (#18642)
* [server] Separate instance creation from instance starting (again)

* [server] Set instance.configuration.fromBackup
2023-09-04 09:33:01 +02:00