853 Commits

Author SHA1 Message Date
Brad Harris
0f926eb721
adding missing fields to CreateAndStartWorkspace (#18874)
* adding some missing fields to CreateAndStartWorkspace

* updated mocks
2023-10-06 02:27: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
Brad Harris
89af3c0871
Adding searchRepositories jsonrpc method (#18827)
* adding searchRepositories method w/ github impl

* fix a few things and add bbs impl for searchRepos

* integrate searchRepositories in RepositoryFinder

* adjusting loading indicators

* cleanup

* wrap repository search behind feature flag

* Changing queries for github repo search

* fix enabled to use debounced value

* fix org filters

* drop variables for query

* fixing encoding
2023-09-29 22:28:08 +03:00
Alex Tugarev
d897a6c57b
Add deprecation note to github node in .gitpod.yml (#18788) 2023-09-29 17:08:08 +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
Kyle Brennan
3c4818f017
[ci] wait 5m on publish to yarn register before timing out (#18830)
This times out in 100 seconds, and is causing failures for builds in main.

Maybe it needs more time.
2023-09-28 01:23:06 +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
Anton Kosyakov
34443431b1
add ws client metrics (#18773) 2023-09-22 16:56:01 +02:00
Alex Tugarev
df155ad0e9
Match branch names by pattern – EXP-575 (#18734)
* turn text input into select input

* mimic old behavior for pre-existing projects

* explicit settings under the project should have precedence

* add PrebuildBranchPattern to project settings

* add branch name pattern to project settings page

* fixup c&p error

* match branch names by glob pattern

* fix pattern matching

* fix project settings form

* fix initial value for prebuildBranchPattern

* adding more tests

* add globstar tes

* fixup rebase error

* Apply suggestions from code review

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

* fine tune debounce wait

---------

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
2023-09-22 13:57:01 +02:00
Alex Tugarev
252992223d
Add prebuildDefaultBranchOnly setting – EXP-574 (#18716)
* add `prebuildDefaultBranchOnly` to `Project.settings`

* evaluate prebuildDefaultBranchOnly in PrebuildManager

* add "Prebuild the default branch only" checkbox

* fix missin PAPI mapping 🤯

* fix PrebuildDefaultBranchOnly in gitpod-service.go

* turn text input into select input

* update styles on project settings page

* mimic old behavior for pre-existing projects

* use getPrebuildBranchStrategy in PrebuildManager

* add tests for PrebuildManager.prebuildPrecondition

* fix getPrebuildEvents

* explicit settings under the project should have precedence

* render changes to project settings immediately
2023-09-22 11:59:01 +02:00
Huiwen
62c573a453
Add default image get to PAPI and improve Dashboard (#18767)
* [server] update getDefaultWorkspaceImage api

* [dashboard] api usage update

* [protocol] add go definition

* [papi] add getDefaultWorkspaceImage method

* fixup

* [dashboard] add org image warning to start workspace page

* fix error wrap

* Update supervisor to use publicApi

* [dashboard] always show default image and remove tag width limit

* fixup

* move new warning to StartPage

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

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

* Address feedback

---------

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
2023-09-22 11:58:01 +02:00
Gero Posmyk-Leinemann
af88bed373
[server, dashboard] Remove api.maySetTimeout (+ code cleanup in User- + EntitlementService) (#18769)
* [dashbaord, server] Remove api.maySetTimeout

* [server] Remove dead code in Entitlement- and UserService

* review comments
2023-09-22 11:03:01 +02:00
Huiwen
181c983405
[server,dashboard] verify image accessibility when updating org workspace image setting (#18747)
* [server] verify image accessibility before update settings

* [dashboard] update org settings page

* fixup disable button for members

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

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

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

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

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

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

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

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

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

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

* hid change button for members

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

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

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

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

* update image hint

* Add description to WorkspaceImageButton

* Lighter description

* render desc list

---------

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
Co-authored-by: Filip Troníček <filip@gitpod.io>
2023-09-20 23:01:59 +02:00
Gero Posmyk-Leinemann
e5d03e12c5
[WorkspaceStarter] Fail instance on all errors (#18745)
* [server] Tone down EntitlementService logs: error to warn

* [server] Make sure to fail a WorkspaceInstance on any error

* [WorspaceStarter] Don't fail on temporary gRPC errors
2023-09-20 14:02:59 +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
Brad Harris
0bc9cb3c6e
Add projects to repository finder (#18706)
* adding repository name

* updating options a bit

* add repositoryName to the response

* update styling

* updating sorting for getSuggestedRepositories and adding tests

* update sorting logic

* tweaking sorting more

* don't show middot when no name is available

* rename type for consistency

* adding aria label

* prioritize projects above user repos

* handle selected projects better

* fix gray icon color
2023-09-19 16:38:58 +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
Alex Tugarev
8d4128b132
fix PAPI conversion (#18722) 2023-09-15 13:28:54 +02:00
Alex Tugarev
cb3a7f00c6
Add "Enable Prebuilds" to Project Settings – EXP-573 (#18698)
* cleanup: remove obsolete remainings of /prebuild prefix

* Add Project.settings.enablePrebuilds

* PrebuildManager.shouldPrebuild to consider Project.settings.enablePrebuilds

* Don't install webhooks on project creation

* foreseeable change: don't prefetch project details

* fix: unused imports

* redirect to project settings on project created

* don't trigger prebuilds on project created

* fix: get rid of many ListProjects requests on Settings page

* Project Settings: add checkbox for "enable prebuilds"

* handle "enable prebuilds" in server

* updating PAPI

* fixup

* fixup

* make PrebuildManager require a Project to work on

* also SCM webhook handlers
* move project usage registration to PrebuildManager

* address feedback on useListProjectsQuery and  useCurrentProject

* remove empty class name attributes

* make use of <InputField> as wrapper for <SelectWorkspaceClassComponent>

* fixup <SelectWorkspaceClassComponent> width

* update hint on "Enable Prebuilds" action

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

* fix "enablePrebuild" handling

* add [Enable Prebuilds] button to "Project Created" page

* show detailed prebuild setting only if prebuilds are enabled

* drive-by: fix max width on "Remove Project"

* fix: re-add `loading` state to `useCurrentProject` hook

this caused an issue with loading components as `useListProjectsQuery.isLoading` is false initially.

* add "Enable Prebuilds" to project card

* fixup project-context.tsx

state should only be updated if `useListProjectsQuery` is loaded.

* fixup button type

* add hint to create a .gitpod.yml

* Apply suggestions from code review

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

* remove unnecessary !

* extract Project.isPrebuildsEnabled

* fixup: add missing await

* render "Learn more" if not enabled, too.

* fix getCloneUrl for BBS

* fix getCloneUrl for GitLab

---------

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
2023-09-15 09:07:54 +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
Brad Harris
fa3010a305
Adding getSuggestedRepositories method (#18681)
* Adding getSuggestedRepositories method

* accounting for lastUse better

* limit to org

* remove repoName for now

* add checks

* cleanup

* remove repositoryName for now

* cleanup

* removing repo name for now

* adding tracing
2023-09-12 17:11:52 +02:00
Sven Efftinge
225040d289
[log] log contextId and userId (#18688) 2023-09-11 10:16:08 +02:00
Jean Pierre
b24ae9495d
Upgrade jsonwebtoken lib (#18634) 2023-09-06 19:16:03 +02:00
Alex Tugarev
9f63620adc
log errors with parsing (#18667) 2023-09-06 10:12: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
Sven Efftinge
841b616c34
[spicedb] fix stale connection handling (#18631) 2023-09-01 12:53:58 +02:00
Sven Efftinge
edca0d50f1
[dashboard] unique project links (#18618) 2023-08-29 21:34:55 +02:00
Alex Tugarev
c7e492b6ef
update node to 18.17.1 (#18525)
* update node to 18.17.1

* use new dev image

* fix webpack in supervisor-frontend

* bump webpack to 5.88.2 in dashboard

* streamline webpack versions

* Fix craco config

* streamline eslint versions

* Update eslint config and disable for now

* Enable eslint again

* Update vscode-jsonrpc for browser implementation

* Polyfill setimmeadiate

* Remove NODE_OPTIONS env var from supervisor front end scripts

* Fix css

* Fix css 2

* Fix checkboxchecked

* Add comment

* Fix yarn.lock

---------

Co-authored-by: Jean Pierre <jeanp413@hotmail.com>
2023-08-24 13:41:50 +02:00
Brad Harris
25c949e976
Incremental repo searching (#18566)
* Wiring up api repo searching for bitbucket server

* adding lodash.debounce dep

* add lodash.debounce types

* Hiding account for bitbucket server

* print host only

* adjust loading state to not be totally blocking

* adjust filtering and query key

* support fetching recent repos

* use search params instead of strings

* adjusting loading component

* cleanup

* wrap incremental search code w/ feature flag

* yarn lock updates

* adding a limit to grab only the first 100 repos

* rename for clarity

* change to call in series to reduce rate limit chances

* renaming cap => maxPages

* fixing some stuttering widths changing as things load

* add alert message for bbs searching
2023-08-24 00:36:49 +02:00
Brad Harris
adf4e66cf6
Add CreateAndStartWorkspace to public-api (#18515)
* setting up CreateAndStartWorkspace handler

* adjust args

* adding createWorkspace scope for desktop app

* add getToken scope to desktop app oauth client

* remove for now

* adding region

* adding getToken while in here
2023-08-23 16:06:49 +02:00
Gero Posmyk-Leinemann
2419f896f6
[fga] Devx improvements (#18574)
* [server] Inject process.env.HOST_URL into feature flag attributes

* [dev] unblock-user + make-user-admin: Restart server+redis after DB changes
2023-08-23 08:33:49 +02:00
Manuel Alejandro de Brito Fontes
64994160d9
Remove FUSE support (#18536)
* Remove FUSE support

* Update docs

* Remove fuse-overlayfs

* Fix installer validation
2023-08-18 16:13:44 +02:00
Sven Efftinge
820ca180ff
[fga] project visibility and prebuild perms (#18540) 2023-08-18 14:41:44 +02:00
Filip Troníček
112eefcc56
[papi] List editor options (#18530)
* options.init

* Respond with options

* Move to editor service

* Unused imports

* Mount ot the correct service

* Sort by orderkey

* Simplify enum name

* Add tests

* Options -> `result` for consistency

* fix result field
2023-08-18 11:19:44 +02:00
Alex Tugarev
3ba583c710
[server] add searchString to getRepositoriesForAutomatedPrebuilds – EXP-461 (#18533)
* [server] add `searchString` to `getRepositoriesForAutomatedPrebuilds`

* reintroduce and fix paginated requests

* using a default cap at 10 requests per paginated request

* make getProviderRepositoriesForUser cancellable
2023-08-17 15:04:43 +02:00
Jean Pierre
b95a4687bf
[fga] Introduce EnvVarService (#18503) 2023-08-16 22:12:42 +02:00
Anton Kosyakov
e69acdf556
remove definetly-gp support (#18492)
compare to previous attempts it does not remove anything related to ExternalImageConfigFile
2023-08-15 17:40:42 +02:00
Filip Troníček
614007dde5
[papi]: Add GetSuggestedRepoURLs (#18514)
* [papi]: Add `GetSuggestedRepos`

* Rename method

* req to be consistent

* Move to SCMService

* Remove usr impl

* Add tests

* Revert billing test change

* Revert user changes

* --
2023-08-15 13:55:41 +02:00
Alex Tugarev
9e5a2be333
[new-workspace] Fix recent repositories for BBS – EXP-411 (#18497)
* [new-workspace] Fix recent repositories for BBS

* fixup remove log

* fixup test
2023-08-14 11:34:40 +02:00
Sven Efftinge
667bd2f005
[usage] add optional UserID to filter usage (#18449) 2023-08-08 07:46:33 +02:00
Gero Posmyk-Leinemann
9acc185fe5
[server] Merge WorkspaceDeletionService into WorkspaceGC (#18410)
* [server] Merge WorkspaceDeletionService into WorkspaceGC

* [server] WorkspaceService.getOwnerToken + .getIDECredentials

* review comments

* [server] Cleanup around EntitlementService and BillingMode
2023-08-07 13:38:32 +08:00
Gero Posmyk-Leinemann
0d36c68390
[fga] Workspace: create, get, stop and delete (#18403)
* [server] Cleanup to make tests pass

* [server] Introduce WorkspaceService with:
 - createWorkspace
 - getWorkspace
- stopWorkspace
- deleteWorkspace
- hardDeleteWorkspace

* add log info

* fix after rebase

* review comments

* address review comment: system user
2023-08-04 21:48:29 +08:00
Anton Kosyakov
b3ae12f956
git real time (#18323) 2023-08-03 20:51:28 +08:00
Alex Tugarev
436130bf26
Fix listeners leaks – EXP-206 (#18321)
* [server] fix leaking prebuild update listeners

- check for client be defined in gitpod-server-impl
- add prebuild subscribers only if the thing is not disposed yet
   - this might have happened frequently on very short living workspacePageClose events

* [server] fix metric registration

don't override default registry, which breaks other metrics.

* fixup for getMetricsAsArray

* [server] bump prom-client
2023-08-02 18:28:27 +08:00
Filip Troníček
c5059f2dc3
Filter by organizationId in ListWorkspaces (#18402)
Remove `IncludeWithoutProject`
2023-08-02 05:20:27 +08:00
Sven Efftinge
ded77f3a44
[server] don't error on project not_found (#18400) 2023-08-01 21:51:26 +08:00
Alex Tugarev
29ace4982b
[server] Remove obsolete (Theia) User Storage Resource (#18377)
* [server] Remove obsolete (Theia) User Storage Resource

* more cleanup
2023-08-01 15:48:26 +08:00