1906 Commits

Author SHA1 Message Date
Siddhant Khare
b0596ee60b
chore: Add hashed user ID cookie in analytics controller service (#20226) 2024-09-17 07:58:02 -04:00
Filip Troníček
35f53b9386
Enforce minimum scopes in the UI (#20217) 2024-09-16 03:56:02 -04:00
Filip Troníček
c79f478362
Reduce required Bitbucket scopes (#20195) 2024-09-13 03:16:59 -04:00
mustard
02b49524eb
Add full clone setting for prebuilds (#20177)
* proto update

Co-authored-by: Filip Troníček <filip@gitpod.io>
Co-authored-by: Gero Posmyk-Leinemann <32448529+geropl@users.noreply.github.com>

* dashboard + server

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
Co-authored-by: Gero Posmyk-Leinemann <32448529+geropl@users.noreply.github.com>
2024-09-11 04:44:57 -04:00
Gero Posmyk-Leinemann
d3eccd0169
[gp] Allow update of existing user-scoped env vars (#20193)
* [gp, protocol, server] Remove references to long-deprecated "getEnvVars" API method

* [gp, server] Allow users to update user-scopes env vars
2024-09-11 02:57:56 -04:00
Filip Troníček
8e8a5db974
[PAPI] Retry steams upon not receiving data for 10 seconds (#20172)
* [PAPI] Retry steams upon not receiving data for 10 seconds

* [PAPI] Retry steams upon not receiving data for 10 seconds (#20176)

* debug message

* Do not listen for ws updates globally and do not timeout for those calls

* Timeout signal as a getter

* use ff for disablement

* accesor fn => getter

* send empty initial data in papi for global ws watch requests

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-09-06 04:31:49 -04:00
Filip Troníček
b68fdec640
Verify new organization joinees (#20161) 2024-09-02 04:26:45 -04:00
Filip Troníček
a1ec400db4
Improve frontend handling of many projects (#20151)
* Remove project context fetching

* limit projects returned from `ListSuggestedRepositories`

* Get rid of all projects query

* A WIP state

* Enhance search and normalize links

* Revert find project DB changes

* Make repo finder responsible for current selection

* remove debug

* Comments

* Re-use pagination flattening

* Query improvements

* limit pagination

* Add test about keeping length

* Fix test

* Fix repo ordering

* add normalize comment
2024-08-29 16:38:42 -04:00
mustard
b6c2db780b
Validate redirect url (#20152)
* Validate redirect url

* Address feedback

* feedback 2
2024-08-27 12:45:40 -04:00
Filip Troníček
1963a8e685
Feature flag for disabling listening for all prebuild updates (#20150) 2024-08-26 04:55:38 -04:00
Huiwen
4f6e2cb986
[TB] limit oauth scopes (#20131) 2024-08-16 12:07:18 -04:00
Filip Troníček
f5acd61fcd
Organization timeout defaults (#20099)
* Organization timeout defaults proto

* Generated code

* Implement TimeoutSettings on the API layer

* Add timeout setting UI

* Actually change default workspace timeout based on org settings

workspace starter fixes

* Add alert for free plans

* denyUserTimeouts

* [dashboard] Fix check for "timeout config eligibility" by using BillingMode

* [server] Drop FF "disable_set_timeout"

* fix

* Move to team policies

* don't include `timeoutSettings` if not set

* [dashboard] TeamPolicies: Disable "save" if workspace timeouts are disabled

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-08-13 03:51:15 -04:00
Gero Posmyk-Leinemann
d8831628b6
[server] Add some tests (#20100)
* [server] First tests for WorkspaceFactory

* more tests

* [server] Add a bit more logging on workspace start

* [bbs] Update and add tests for BitBucketServerContextParser

* fix scrubbing

* Review suggestions (cleanup)

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

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-08-12 05:21:14 -04:00
Gero Posmyk-Leinemann
b43c97ed9a
[dashboard, server] Fix streaming of image build logs (#20095)
* [json-rpc] Fix encoding of watchImageBuildLogs data to number[]

Because json-rpc can't handle complex objects like UInt8Array properly.
Conversion is done using "Array.from(UInt8Array)" and "new UInt8Array(data)"

* [dashboard] Fix "workspaceId is required" errors

* Review suggestions

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

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-08-08 08:13:46 -04:00
Gero Posmyk-Leinemann
e7a47d9791
[prebuilds, workspace-gc] Fix and add tests for not showing soft-dele… (#20093)
* [prebuilds, workspace-gc] Fix and add tests for not showing soft-deleted prebuilds anymore

* [workspace-gc] Add more explanatory comments

* Apply suggestions from code review

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

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-08-08 04:08:46 -04:00
Gero Posmyk-Leinemann
994b6ec5d4
[supervisor] Make sure we read the last chunk of message when task is closed (#20062)
* [supervisor] Make sure we read the last chunk of message when task is closed

* [server, dashboard] Prebuild logs: stream as UInt8Array instead of string, and make sure we send the last chunk before closing the response

* Make log buffer more efficient

Merging done with `TypedArray.prototype.set()` as suggested here:
https://stackoverflow.com/a/73074813/10199319

* [dashboard] PrebuildTaskTab: use hash(err.message) as toastId

* [server] prebuild logs: Only call res.end after a timeout, so clients can continue reading from the stream

* [dashboard] prebuild logs emitter: If we receive code "200", forward prefixChunk, and stop streaming

* fixup! [dashboard] PrebuildTaskTab: use hash(err.message) as toastId

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-07-26 23:52:48 +02:00
Filip Troníček
10810cee50
Various prebuild fixes (#20057)
* log it all

* fix failing image logs prebuild updates

* make sure we dispose of requests properly

* minor cleanup

* handle aborts gracefully

* Try using a tailing library for reading supervisor task logs

* Fix caching requests on Firefox

* Revert "Try using a tailing library for reading supervisor task logs"

This reverts commit fdc3183aa76cab7ac4976fb633d148482054722b.

* Change log order

Make sure we wait for the line to be written first

* Tweak abortion error message

* Remove extra log line
2024-07-24 15:48:33 +02:00
Gero Posmyk-Leinemann
a03a28ef63
[audit log] Fix audit log persistence (#20054)
* [audit] Catch + log errors properly

* [audit] Properly serialize BigInts

* [public-api] Fix PublicApiConverter toAuditLog by re-using the BigIntToJson.replacer
2024-07-22 10:13:30 +02:00
Huiwen
8192444477
[TB] allow to config launcher from Dashboard (#20051)
* [TB] allow to config launcher from dashboard

* Control by FF

* nit follow up

* LImit oauth entry with FF

* 💄
2024-07-19 15:12:57 +02:00
Huiwen
910b13302c
[TB] add oauth entry (#20049) 2024-07-19 08:11:57 +02:00
Filip Troníček
a43054a57a
Fix permissions checks for stopping prebuilds (#20043) 2024-07-17 14:08:56 +02:00
Filip Troníček
33ce03c3dc
Track used prebuild strategy with started repositories (#20040)
* Track used prebuild strategy with started repositories

* Undefined trigger strategies are the same as `webhook-based`
2024-07-16 09:36:54 +02:00
Sven Efftinge
a3b04e433f
[server] allow configure timeouts via featureflag (#20035) 2024-07-15 13:53:54 +02:00
Huiwen
e37bd00805
Fix not able to open workspace with nightly code (#20029)
* Build latest image

* debug

* Fix restart workspace editor version

* revert nightly job

* fixup

* Revert "debug"

This reverts commit be496bc04a55152b0e29cbc3ea36d3ab0b374195.
2024-07-15 10:02:53 +02:00
Filip Troníček
6b2187ae23
Activity-based prebuilds (#20006)
* Start prebuilds on started workspaces

* Fix circl dep

* move out to workspace creation

* Do it in the workspace service

* remove webhook tests

* remove webhook handling code

* Revert "remove webhook handling code"

This reverts commit d7c4550ec6b16091344607bfeee234b1f0e5705b.

* Anotate new setups with an `activity-based` activation strategy

* Update tests

* Alert banner

* add correct changelog path

* fix tests

* Remove code for registering prebuilds

* Still pass prebuild preconditions in order to run

* Re-add link to prebuild history of a repo

* Rename to trigger strategy and change project activity indicator
2024-07-12 17:49:51 +02:00
Huiwen
2b13aea5f9
Filter out not available editors before update org and repository settings (#20030)
* Filter request args with available IDE keys

* validate on client side
2024-07-12 16:15:57 +02:00
Filip Troníček
d8e6426f29
Add support for opening bitbucket server tags (#20028) 2024-07-12 10:29:56 +02:00
Filip Troníček
ecd52dc533
Fix permission errors for watching prebuild logs (#20026)
* Revert "Prebuild issues roundup (#20000)"

This reverts commit fbc0d76554c68d82c438c2c7a989b0ec7ef91dc1.

* Reapply "Prebuild issues roundup (#20000)"

This reverts commit bb45446c3a9c09826a3bba7943703309bca75a55.

* Fix permission check for watching prebuild logs
2024-07-11 12:12:56 +02:00
Gero Posmyk-Leinemann
fbc0d76554
Prebuild issues roundup (#20000)
* redirect in the offline case

* [public-api] generate noise

* [server] Refactor Prebuild resolution to happen in a single place

* [dashboard, api] Show Prebuild details

* fixup! [server] Refactor Prebuild resolution to happen in a single place

* [bridge] Revive Prebuild QUEUED state: it's everything before running

* [server] Fix dead-end for streaming logs when starting too early

* [dashboard] Adds SHA + duration, fix re-rendering when prebuildId changes, and uses the new/old streaming logic

WIP because still has the "duplicate (sometimes triple!) logs" react re-rendering issue

* Prevent unnecessary re-renders of task output

* remove double-comment

* Duration display improvements

* Properly dismiss toasts and render durations

* Remove SHA from prebuild list

* Clean up and implement the `reset` event for workspace logs

* fix comment

* Tiny cleanup

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-07-10 04:50:55 -04:00
Sven Efftinge
024f71a6fb
[github] throw up error message from GH (#19993) 2024-07-04 08:29:18 -04:00
Gero Posmyk-Leinemann
ebe64b5ae9
[server] Drop old cookie migration path (#19997) 2024-07-04 05:14:17 -04:00
Huiwen
4dc8b36f51
[server] don't allow blocked users to create workspaces (#19990)
* [server] don't allow blocked users to create workspaces

* Check if user's blocked on a better place
2024-07-02 11:49:15 +02:00
Moritz Eysholdt
bcc0b834e2
Log query if repo is not found (#19989) 2024-07-02 09:00:15 +02:00
Huiwen
db5af8934d
Get java feature flags from server (#19984)
* Get java feature flags from server

* fix build
2024-07-01 19:01:14 +02:00
Filip Troníček
da1053e101
Make auth cookie stricter (#19973)
* Use `__Host-` prefix for cookie

* Fix tests

* Remove domain from cookie

* Fix logout

* remove unused fn

* fix user logout properly

* [server] Make domain-only cookie work for GitHub oauth login

... by adding additional step so we can set the cookie for the base domain only

* test: fix by redirecting before callbacl/authorize

* [server] SessionHandler: Allow to login with both primary and secondary cookies

* [server] Clear 2ndary cookie on logout

* Fix filtering cookie values when primary cookie is empty

* Fix logouts

* Fix tests

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-07-01 08:53:14 +02:00
Filip Troníček
b06f86135f
Do not send initial queued prebuild phase from workspace starter (#19971) 2024-06-26 16:36:22 +02:00
Filip Troníček
aa8f8c4412
Fix dropped errors on available prebuilds (#19967)
* Fix dropped errors on available prebuilds

* Fix spacing

* Improve if statement readability

* Add a suite for `ws_manager_bridge_stopped_prebuild_statuses=true`

* comments
2024-06-25 17:22:20 +02:00
Sven Efftinge
375b026ba7
[audit logs] scrub values (#19966) 2024-06-25 12:56:20 +02:00
Sven Efftinge
9fa6f885dc
[server] audit log service (#19917) 2024-06-25 10:10:20 +02:00
Huiwen
76504135d5
Deprecate intelliJ 2022.3.3 (#19828)
* Deprecate intelliJ 2022.3.3

* fix unit tests

* update warning msg

* Remove expiration date

* Remove entire warning

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-06-21 17:26:16 +02:00
Gero Posmyk-Leinemann
940f234205
[server] Move ff google_cloud_profiler into env var/installer config (#19912) 2024-06-20 13:19:15 +02:00
Gero Posmyk-Leinemann
dfb6b6d6cb
[usage, server, dashboard] Remove ff usage_update_scheduler_duration (#19914)
* [usage, server, dashboard] Remove ff usage_update_scheduler_duration

* spelling improvement

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

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-06-20 12:29:15 +02:00
Gero Posmyk-Leinemann
f2d34b061e
[server] Remove job CapStatus (#19943) 2024-06-20 12:16:15 +02:00
Filip Troníček
31ef19ecf2
Introduce prebuild task tab component (#19916)
* Image builds in prebuilds UI

* update java gitignore

* Introduce a public API `watchWorkspaceImageBuildLogs`

* Use papi impl in prebuild logs

* Special case for missing prebuild tasks

* Add route handler for image build logs

* remove the papi method

* 404 if nothing was written

* remove unused converter changes

* update golden files

* Remove unused hook

* reset backoff when imagebuild logs are not ready

* Handle unavailable logs better

* Prebuild task tab component

* Fix tracking same URL

* conflict fixes

* Remove unused dep

* Update comment

* Clean up

* Simplify image build handling

It is no longer a special case

* Gracefully stop supervisor to fix abrupt connection termination for tasks (#19942)

* supervisor graceful stop

* Context consistency and server.shutdown

* Use a dedicated waitgroup for proper cleanup

* use the correct context

* Remove extra context wait

* remove terminal mux ctx changes

* remove debug logs

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-06-20 11:47:15 +02:00
Sven Efftinge
a3caec67fa
[server] remove old workspace gc logic (#19931) 2024-06-19 13:26:14 +02:00
Filip Troníček
de5030ab54
Image builds in prebuilds UI (#19887)
* Image builds in prebuilds UI

* update java gitignore

* Introduce a public API `watchWorkspaceImageBuildLogs`

* Use papi impl in prebuild logs

* Special case for missing prebuild tasks

* Add route handler for image build logs

* remove the papi method

* 404 if nothing was written

* remove unused converter changes

* update golden files

* Remove unused hook

* reset backoff when imagebuild logs are not ready

* Handle unavailable logs better

* revert adding unused dep

* Fix test

* Do not use `null`s and refactor disposables

* revert disposable changes

* Add gero's comments

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-06-18 17:23:13 +08:00
Gero Posmyk-Leinemann
518f23b3b8
[cleanup] Drop more feature flags (#19899)
* [server] Drop ff api_validate_git_status_length

* [server] Drop ff guessWorkspaceRegion

* [server] Drop ff isPhoneVerificationEnabled

* [dashboard] Drop ff linkedinConnectionForOnboarding
2024-06-14 16:25:10 +08:00
Gero Posmyk-Leinemann
db552f5afc
[server] Remove old FGA feature flags: (#19881)
- centralizedPermissions
- spicedb_relationship_updates
2024-06-13 21:26:09 +08:00
Gero Posmyk-Leinemann
6dcbc99e49
[cleanup] Remove various feature flags I (#19884)
* [dashboard] Drop newProjectIncrementalRepoSearchBBS

* [dashboard] Remove doRetryUserLoader feature flag

* [server, dashboard] Drop feature flag phoneVerificationByCall

* [public-api, dashboard] Remove personalAccessTokensEnabled feature flag

* [papi] Fix more tests
2024-06-13 17:18:09 +08:00
Moritz Eysholdt
22e92f40f3
Increase OAuth isHostReachable timeout from 2 to 15 seconds (#19891) 2024-06-13 17:10:09 +08:00