1478 Commits

Author SHA1 Message Date
Gero Posmyk-Leinemann
9bde303c1e
ZedTokens: SpiceDBAuthorizer cleanup (#18898)
* [server] Extract RequextContext from EnhancedLogContext

* [spicedb] Cleanup SpiceDBAuthorizer

* [server] SpiceDB: Pass ZedToken to read requests as well
2023-10-11 10:20:19 +03:00
Sven Efftinge
55586b1ecd
[fga] bump version to redo migrations (#18907)
remove debugging code
2023-10-11 09:46:19 +03:00
Filip Troníček
3eb86ff8b7
Add cursor as an OAuth client (#18864)
* Add cursor as an OAuth client

* Template it
2023-10-10 20:22:18 +03:00
Sven Efftinge
1d3fe33e0c
[server] (re)move deprecated properties (#18894) 2023-10-10 14:12:18 +03:00
Sven Efftinge
b5d895f622
[fga] further debug sharing issue (#18903) 2023-10-10 13:13:18 +03:00
Gero Posmyk-Leinemann
7ce9553152
[server] SpiceDB: Add metric for consistency usage (#18901)
* [server] More tests for ZedTokenCache

* [server] Add metrics "incSpiceDBRequestsCheckTotal"
2023-10-10 13:02:18 +03:00
Gero Posmyk-Leinemann
e28a75620e
[server] SpiceDB: Add request-level caching based on AsyncLocalStorage+ZedTokens (#18893)
* [server] SpiceDB: Add request-level caching based on AsyncLocalStorage+ZedTokens

* [spicedb] Generate code for decoding DecodedZedToken (internal)
2023-10-10 09:55:18 +03:00
Jean Pierre
3b53a0ac4d
Update connect libraries (#18886)
* Update connect lib

* Update protoc-gen-connect-es

* Fix
2023-10-09 22:49:17 +03:00
Sven Efftinge
b9750dd110
[server] fix projcts-service (#18882) 2023-10-06 12:56:15 +03:00
Sven Efftinge
47ed26dbf3
[server] let me see the error (#18881) 2023-10-06 11:50:14 +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
Brad Harris
306061da1a
Load recent repos and not all repos for BBS (#18861)
* getting recent repos instead of all repos

* stale comment

* wrap recent repos w/ repo search flag check
2023-10-05 06:15:13 +03:00
Filip Troníček
07597d58fe
Implement searchRepos for GitLab Repository Provider (#18862)
Remove try/catch blocks

fix unused var
2023-10-05 00:22:13 +03:00
Anton Kosyakov
522dbfb050
[public-api] add request context (#18853)
* [public-api] add request context

* fix metrics and trace public api calls

* fix context

* simplify

* fix server side streams
2023-10-04 15:48:12 +03:00
Brad Harris
def4633256
Implement searchRepos for Bitbucket (#18856)
* implementing searchRepositories

* implement searchRepos for BBS

* limit fields

* remove fields

* adding gitlab searchRepos

* remove gitlab searchRepos - not working will do in a followup

* wrap calls w/ asyncBatch to limit concurrency
2023-10-03 17:25:12 +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
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
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
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