1894 Commits

Author SHA1 Message Date
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
Gero Posmyk-Leinemann
f925da3c31
[server] Remove CapGitStatus job, increase limit for CapStatus job (#19890)
* [server] Remove job CapGitSTatus

* [server] CapStatus job: Increase chunk size 100 -> 500 to speed up processing
2024-06-13 16:41:09 +08:00
Filip Troníček
b94aec1263
Integrate reading from log files into Supervisor's terminal.Listen (#19863)
* Integrate reading from log files into Supervisor's `terminal.Listen`

* Try with GetOutput

* do not bubble down and fail

* remove debug stuff

* definitions and impl of `task.proto`

* codegen

* update endpoint

* Implement `ListenToOutput`

* Try with one API (🤞)

* stream beginning from where we left off

* Do not watch closed tasks

* move closing of worker channel

* simplify one-off reading

* codegen

* consolidate for loops, optimize watching

* remove extra line

It makes sense to group the offset definition with the function below it

* Gpl/ft/supervisor-listen-files (#19878)

* commit step 1

* 2nd

* Changes from joint code review

---------

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

* Remove year bumps

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-06-12 21:37:08 +08:00
Filip Troníček
8c7805c4b5
Improve dashboard and readme copy (#19876) 2024-06-12 00:24:07 +08:00
Gero Posmyk-Leinemann
c4c24fbbaa
[server] Drop feature flag workspace_start_new and related code (#19874) 2024-06-11 17:13:07 +08:00
Gero Posmyk-Leinemann
2f5a28f3f6
[server] CapGitStatus: Split work on 'status' into separate job called CapStatus (#19873)
* [server] CapGitStatus: Split work on 'status' into separate job called CapStatus

* Fix comments

* bind it as well
2024-06-10 21:29:06 +08:00
Gero Posmyk-Leinemann
6adf240e83
[server] CapGitStatus: Log instanceIds of capped instances (#19870) 2024-06-10 17:30:06 +08:00
Gero Posmyk-Leinemann
876783a2df
[server] Fix CapGitStatus job (again) (#19861) 2024-06-07 15:06:18 +08:00
Filip Troníček
96be13b46e
Automatically cancel org's subscription upon its deletion (#19856)
* Stripe stuff

* Cancel org's subscriptions after deletion

* Correctly bind services for tests

* fix stripe-related typos

* Remove todo comment
2024-06-06 22:40:18 +08:00
Sven Efftinge
6433865363
[server] run deletion time updates async (#19844) 2024-06-06 20:28:18 +08:00
Gero Posmyk-Leinemann
d78575ed35
[server] Fix CapGitStatus job (#19855) 2024-06-06 18:05:18 +08:00
Gero Posmyk-Leinemann
2686bc2f47
[server, bridge] Bump grpc-js and authzed clients (#19849)
* [yarn] Bump @grpc/grpc-js to 1.10.8 and @authzed/authzed-node to 0.15.0

* [server] SpiceDB: explicit re-try on UNAVAILABLE

We tried to configured this inside the SpiceDBClientProvider already, but somehow it still surfaced.

* [server, bridge] Configure "grpc.dns_min_time_between_resolutions_ms" to be 2s instead of 30s
2024-06-06 13:57:19 +08:00
Sven Efftinge
80f793d145
[server] update job for eligableDeletionTime (#19838) 2024-06-05 14:35:16 +08:00