1804 Commits

Author SHA1 Message Date
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
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
Sven Efftinge
e393546f52
[server] also log the actual request name (#18812) 2023-09-27 09:30:05 +03:00
Sven Efftinge
fd6589241e
[server] keep gitStatus on new instances (#18811) 2023-09-26 18:48:05 +03:00
Manuel Alejandro de Brito Fontes
96fd530cb6
Use yarn run to execute rimraf (#18806) 2023-09-26 16:01:05 +03:00
Sven Efftinge
2dd5fcded6
[fga] don't await spicedb calls when disabled (#18802) 2023-09-26 13:21:05 +03:00
Gero Posmyk-Leinemann
e06508bba3
[WorkspaceStarter] Don't call imageBuilder.needsImageBuild as we don't need it anymore (#18759)
Before, we used it to decide between handling the startWorkspace request sync or async. Now we are always async. And the check whether we actually need an image build is done in "build" anyway.
2023-09-26 10:15:05 +03:00
Sven Efftinge
e6ba18adb1
[fga] check workspace relationships (#18793) 2023-09-25 17:29:04 +02:00
Sven Efftinge
14a21a7657
[projects] lookup projects by id not cloneURL (#18774) 2023-09-25 11:13:04 +02:00
Anton Kosyakov
93004e3c84
add missing getDefaultWorkspaceImage scope for supervisor (#18790) 2023-09-25 10:09:06 +02:00
Anton Kosyakov
0a0044191a
[server] add google cloud profiler (#18727) 2023-09-22 17:29: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
Sven Efftinge
d88fe0513a
[fga] trying to understand the sharing issue (#18766) 2023-09-21 08:46:00 +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
Sven Efftinge
1f1d840a84
[fga] add more logging to track down sharing issue (#18756) 2023-09-20 12:23: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
Anton Kosyakov
c7c122125e
[public-api] improve error handling (#18739)
* [dashboard] add exponential backoff for streaming emulation

* [dashboard] add source map resolver

* [server] fix actual bug

* [public-api] compile to es6

to prevent duplicate @bufbuild modules in dashboard

* [public-api] export ESM modules
2023-09-20 08:32: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
Gero Posmyk-Leinemann
1c5087ba45
[ubp] Improve logging when checking hasPaidSubscription (#18741) 2023-09-19 11:48: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
6552fd5e86
[spicedb] Grant all org members project "editor" role (#18733) 2023-09-18 11:55:57 +02:00
Anton Kosyakov
3cf0cf23e9
[dashboard] unify error reporting (#18726)
* [dashboard] unify error reporting

move error boundary to general error reporting endpoint as well

* add user to common details

* fix common properties in metrics
2023-09-18 11:10:57 +02:00
Anton Kosyakov
352484b34d
node grpc spike dashboard to server (#18691)
* [public-api] add dummy service for testing

* [public-api] proxy dummy to server

* [public-api] hello service server impl

* [server] fix API contribution bindings

* [dashboard] emulate unary call

* only if actually called

* [dummy] auth

* fix tests

* [server] add interceptor to public api

* add server side observability

* fix port name

* change to unimplemented for unknown methods

* [public-api] client metrics

* fix metrics imports

* align server metrics

* actually fix metrics

* add feature flags

* fix server side streams

* [dashboard] hook error reporting

* rebase and fix imports

* feature flagged metrics from dashboard

* revert GRPC_TYPE

* address feedback
2023-09-15 13:46:54 +02:00
Gero Posmyk-Leinemann
7fa1b2db37
[server] Tone down non-error log messages during workspace start/reconcile (#18720) 2023-09-15 11:23: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
Alex Tugarev
33cd3cbf27
remove perm check on internal findTokensForIdentity (#18708) 2023-09-13 12:46:53 +02:00
Sven Efftinge
954401abfd
[fga] try any spicedb operation 3 times (#18704) 2023-09-12 17:39:52 +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
7bd00c670d
[fga] additional check (#18701) 2023-09-12 10:41:51 +02:00
Sven Efftinge
e2ae3e3267
[server] improved logging (#18697) 2023-09-12 10:33:51 +02:00
Sven Efftinge
2ae927a454
[fga] fix and log missing relationships (#18692) 2023-09-11 11:00:09 +02:00
Sven Efftinge
225040d289
[log] log contextId and userId (#18688) 2023-09-11 10:16:08 +02:00
Sven Efftinge
573f3cc9b4
[fga] fix workspace sharing (#18685) 2023-09-08 14:32:05 +02:00
Sven Efftinge
da018ad83c
[fga] retry write relationships (#18683) 2023-09-08 12:07:05 +02:00
Sven Efftinge
745457a213
[fga] enable all writes by feature flag (#18676) 2023-09-07 09:55:04 +02:00
Sven Efftinge
e5932aa319
[fga] run job more often with smaller chunks (#18675) 2023-09-07 09:05:04 +02:00
Sven Efftinge
3a07121763
[fga] add relationship update job (#18671) 2023-09-07 06:11:03 +02:00
Jean Pierre
b24ae9495d
Upgrade jsonwebtoken lib (#18634) 2023-09-06 19:16:03 +02:00
Jean Pierre
54205cf036
Update probot lib (#18596) 2023-09-06 18:39:03 +02:00
Alex Tugarev
9f63620adc
log errors with parsing (#18667) 2023-09-06 10:12:03 +02:00
Gero Posmyk-Leinemann
35a40f2c91
[server] Make PrebuildManager use WorkspaceService.startWorkspace (to remove code duplication) (#18653) 2023-09-05 09:36:02 +02:00
Huiwen
a05af0cc2e
[bbs] update REPO_WRITE permission check EXP-521 (#18610)
* [bbs] fallback REPO_WRITE permission check to bbs

* Use repos search api

* Add test cases
2023-09-04 12:58:01 +02:00
Sven Efftinge
71912f721b
Allow renaming project (#18630)
remove project#slug
2023-09-04 09:42:01 +02:00
Alex Tugarev
d6e1866704
undo limit to fetch the first 100 user repos for New Workspace – EXP-554 (#18644)
* undo limit to fetch the first 100 user repos for New Workspace

this reverts 2f2b1abbf1 effectively

* don't call getSuggestedContextURLs on each setUser call

* Always cap the respository search results to be rendered on New Workspace
2023-09-04 09:34:01 +02:00