1804 Commits

Author SHA1 Message Date
Filip Troníček
e59d1bda25
Allow running prebuilds on a specific branch (#19507)
* Allow running prebuilds on a specific branch

* log arrow and narrow the gap
2024-03-06 17:31:16 +02:00
Gero Posmyk-Leinemann
22bd295d2d
[server] Remove feature flags and cleanup dead code in TokenService (#19506) 2024-03-06 09:58:15 +02:00
Huiwen
d1464868ba
Fix prebuild logs race condition (#19504) 2024-03-05 14:01:15 +02:00
Huiwen
394dcae20f
[papi,server] implement restricted_workspace_classes in server (#19481)
* [papi,server] implement `restricted_workspace_classes` in server

* Fix test case input

* nit
2024-02-28 22:37:09 +02:00
Gero Posmyk-Leinemann
a05f84ef2a
[server] Improve behavior and reporting around "refreshToken" (#19482)
* [server] Check token even in case of timeout

* [server] Metrics: Request counter and histogram for token refreshes

* review comments
2024-02-28 12:01:09 +02:00
Gero Posmyk-Leinemann
af0213b6e6
[server] Sync token refresh (#19470)
* [server] Sync token refresh

* [proxy] api.: Handle /auth/*/callback
2024-02-27 09:20:08 +02:00
Gero Posmyk-Leinemann
bdad590b09
[server] Missing SCM access: Filter out user error on workspace start (#19469)
* [server] Missing SCM access: Filter out user error on workspace start

to prevent false alerts (EXP-1434)

* [proxy] api.: Handle /auth/*/callback
2024-02-27 09:13:08 +02:00
Filip Troníček
aec9746ef8
Add guidance for debugging failed prebuilds (#19460)
* Add guidance for debugging failed prebuilds

* prevent double rendering

* Do not render multiple times

* Use state to determine whether to show the error

* Negation is harder than it looks

* Set to true only once

Should maybe make the hook re-render only after it has been set to `true`, avoiding the rewrite-

* Try an overlay

* Simplify check and messaging

* Use standard tw width

* Link to docs for gp validate

* fix effect deps
2024-02-26 20:14:07 +02:00
Filip Troníček
5686eb5595
Manually rerun prebuilds (#19449)
* Imported repositories -> Repository settings

* unify org settings title

* Move the repo settings up

* Rerun prebuild WIP

* Fix suggested repo shape

* Only allow to select repos with enabled prebuilds

* Underline prebuilds settings link

* Run prebuild on empty state

* Clean up and use `refetch` instead of invalidating

* Correctly surface errors
2024-02-22 20:20:04 +02:00
Milan Pavlik
cf7e24b78b
[auth] Attempt to refresh token 3 times EXP-1413 (#19452)
* [auth] Attempt to refresh token 3 times

* Fix

* Fix

* backoff

* Fix

* Fix
2024-02-22 12:01:03 +02:00
Gero Posmyk-Leinemann
96df901870
[server] Fix handling of multiple session cookies with the same name (#19456)
* [server] Fix handling of multiple session cookies with the same name

* [public-api-server] Fix handling of multiple session cookies with the same name

* Ensure exact same behavior as before in jwtSessionConvertor
2024-02-22 11:48:03 +02:00
Huiwen
bcd2e9360b
[server, dashboard] improve single prebuild view (#19445)
* [server] proper handle prebuild log stream response

* Write error message to body

* Check read_prebuild permission on organization level when get workspace

* fixup

* Update regex and add unit tests

* Add persist error toast for prebuild errors

* 💄

* Fix stopped workspace log

* fix rerun

* Ensure fga enabled like papi

* Update components/dashboard/src/prebuilds/detail/PrebuildDetailPage.tsx

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

* Address feedback

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-02-22 08:31:03 +02:00
Gero Posmyk-Leinemann
1a93ac2f5b
[api] Fix /api/logout (#19450) 2024-02-21 10:54:02 +02:00
Gero Posmyk-Leinemann
4e718d9b2a
[proxy, server] api. subdomain for Github login callback (#19448) 2024-02-21 09:56:02 +02:00
Siddhant Khare
36bd741948
fix: Workspace Timeout Bug: Correctly Apply disabledClosedTimeout Flag for Enhanced User Control (#19426)
* fix: workspace timeout bug

* set it to `false` if user has put the empty string (reset timeout)
2024-02-15 20:53:57 +02:00
Milan Pavlik
000f2fd1df
[auth] Make error from SCM trusted (#19423) 2024-02-15 10:11:57 +02:00
Filip Troníček
c89d2de376
Prebuilds List UI (#19354)
* Init prebuilds list

* Text size and color tweaks

* Dropdown filtering UI

* wip changes

* File renames and such

* Filter by state

* fix path

* Add configuration ID filtering

* Prebuild list error state

* Protobuf sorting definition

* API-level sorting

* Simplify pagination

* Fix undefined inference

* Dashboard adopt sort behavior

* make sorting required

* Move ordering 🤷‍♂️

This will most definetely not solve anything, but...

* Hopefully fix sorting 🤷‍♂️

* less `as`

* Simplify state check

* Repeated sorting

* Sort out sorting

Sorry :/

* Configuration dropdown WIP

* Make configuration filter disableable

* Use in in SQL

* Minor styling adjustements

* Nav item

* Rename menu item

* Const 🤷‍♂️

* Always display filter reset opt

* Add prebuild link to prebuild settings

* Simplify

* Don't throw errors

All my homies hate throwing in `server`

* FF hook

* Name failed to load state

* typo

* Better unknown inference

* Add ConfigurationField component to display repository name and link

* Do not retry configuration load

* Move prebuild utils

* Unify sort types

* Refactor PrebuildTable to use arrow function syntax for mapping prebuilds

* fix imports

* Widen triggered column

* Widen even more

* Shorten status labels

* Init ws db tests

* Rename list item comp accordingly

T'was an oopsie doopsie

* Test configuration ids and branches filtering
2024-02-08 10:21:50 +02:00
Gero Posmyk-Leinemann
9c254b4f23
[workspace-starter] Fix re-start issue in case ws-manager emits ALREADY_EXISTS (#19393) 2024-02-07 10:27:49 +02:00
Huiwen
b7d39c0cd4
[papi] add prebuild log url to prebuild message (#19353)
* [papi] GetPrebuildLogUrl proto implement

* Remove seperated API

* fix incorrect URL module
2024-01-29 19:38:05 +02:00
Jean Pierre
d0b5b873ec
Add invalid billing address notification (#19349)
* Add webhook events

* Properly set AutomaticTax

* Use address element

* 💄

* Update susbcription on address update

* Try scroll modal

* Fix

* try fix modal scroll

* Add toast notification

* Add invalidBillingAddress column to d_b_stripe_customer

* 💄

* 💄

* Fix

* Try fix update

* Address feedback
2024-01-29 11:12:05 +02:00
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
Huiwen
f869669c1e
[papi] log ctx time if request took too much time (#19343) 2024-01-23 10:37:00 +02:00
Filip Troníček
723d57a684
Define ListOrganizationPrebuilds (#19316)
* Define `ListOrganizationPrebuilds`

* Fix because of name changes

* Add unimplemented `listOrganizationPrebuilds`

* Crazy stuff right here

* Address huiwen's comments

* Fix more types

* sad™

* Add configuration id and search term filtering
2024-01-22 19:44:59 +02:00
Huiwen
b07323e156
[server] fix BBS metadata latest-commit-metadata not defined cause prebuild trigger failed (#19331) 2024-01-19 10:44:56 +02:00
Huiwen
230c190f35
[papi] add api to allow organization owner to create a temporary token (#19324)
* [papi] add token service to gitpod.v1

* Address feedback

* Fix spice test cases

* fix db tests
2024-01-19 10:21:55 +02:00
Huiwen
1d44c43b48
Add track event team_joined back (#19334) 2024-01-18 09:06:55 +02:00
Huiwen
7d2c34efc6
[server] fix db tests with test ctx wrap (#19319) 2024-01-12 13:10:49 +02:00
Huiwen
22a8ca0f99
[server] fix can not join org (#19318) 2024-01-12 12:06:49 +02:00
Huiwen
7094f19ee8
Add collaborator role to organization (#19311)
* Update spicedb schema

* SpiceDB gen code

* [server] add collaborator

* Update papi

* Dashboard

* nit

* Complete TODOs

* server dataops pass teamId

* Add test cases for collaborator's PAT and cookie API fetch

* Add test case description

* remove unnecessary export

* Redirect to dashboard after join an org

* Hide settings for collaborator

* dataops join via oidc should be collaborator

* Fix test

* Goes back to /workspaces
2024-01-12 10:53:49 +02:00
Brad Harris
bd1b55187e
Improving prebuild related auth errors (#19247)
* Setting up saving and error state on prebuild settings

* cherry picking in backend work that updates some of the scm errors when installing webhooks for prebuilds

* updating tests

* adding placeholders for prebuild error cases

* adding isMissingScopes to error

* updating error messaging

* update tests

* adding toasts to projects settings for prebuild errors

* updating generic message styles

* Update components/dashboard/src/projects/ProjectSettings.tsx

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

* Apply suggestions from code review

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

* adjusting enabled state lookup

* updating again

* adding missing deps

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2023-12-19 17:37:26 +02:00
Huiwen
b3825f9e6f
[server] fix unit test (#19280)
* [server] fix unit test

* Add unbind and fix org workspace class tests
2023-12-19 10:02:26 +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
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
Jean Pierre
db3a8a9f42
[server] Ensure env var id when doing update in old api (#19263)
* Ensure env var id when doing update

* normalize repositoryPattern
2023-12-14 23:03:21 +02:00
Sven Efftinge
e453e77d35
Delete owned user on member removal (#19215) 2023-12-14 18:31:21 +02:00
Alex Tugarev
298dbe39da
[papi] Add RPCs for Admin pages (#19243) 2023-12-13 09:19:20 +02:00
Anton Kosyakov
521e6a5aab
[dashboard] use HTTP endpoint for telemetry (#19223)
* [dashboard] use HTTP endpoint for telemetry

* 💄

---------

Co-authored-by: Jean Pierre <jeanpierre@gitpod.io>
2023-12-12 14:56:19 +02:00
Huiwen
6bc27b8d98
Migrate resolve context url (#19222)
* Implement and migrate resolve context url

* Migrate dashboard

* Update golden

* Fix bugs

* Rebase fixup
2023-12-12 10:16:19 +02:00
Alex Tugarev
b03a753163
[server] remove unused code (#19242) 2023-12-12 09:58:19 +02:00
Huiwen
0b1e5d43cb
Migrate workspaceService updatePort method (#19234)
* Migrate workspaceService updatePort method

* fix build

* fixbuild
2023-12-11 16:28:18 +02:00
Gero Posmyk-Leinemann
6f64417644
[auth] RequestContext: add missing runWithSubjectId (#19235) 2023-12-11 14:46:18 +02:00
Alex Tugarev
eedcf89bbb
[papi] Update UserService proto (#19231)
* [papi] Add UserService.DeleteUser

* [public-api] add missing `UpdateUserRequest.dotfile_repo` attribute

* fix: add unimplemented methods
2023-12-11 13:18:18 +02:00
Gero Posmyk-Leinemann
c183ec89ba
[auth] Authorizer: log ctx-user-id-missing as well (#19229) 2023-12-11 11:33:18 +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
Anton Kosyakov
bfa7c6e070
[public-api] complete installation service (#19200) 2023-12-08 14:05:15 +02:00
Gero Posmyk-Leinemann
1113e3cd8c
[authorization] Align HTTP handlers before RequestContext rollout (#19214)
* [middleware] RequestContext: don't error on nested contexts + ctxOnAbort

* [auth] HTTP handlers: Add FGA guards and runWithSubjectId where missing

* [code-sync] Guard with FGA
2023-12-08 13:31:15 +02:00
Alex Tugarev
682878ad0c
[server] implement getAuthenticatedUser RPC (#19187) 2023-12-08 13:16:15 +02:00
Huiwen
da125ed40b
Migrate InstallationService GetInstallationWorkspaceDefaultImage method (#19221) 2023-12-08 13:15:15 +02:00