1924 Commits

Author SHA1 Message Date
Filip Troníček
810f5e9a01
[WS CLI] Make env --scope=user compatible with GitLab groups (#20279)
* [WS CLI] Make `env --scope=user` compatible with GitLab groups

* Allow updating `*/*` scoped vars for backwards compat

* Fix test races
2024-10-22 13:39:52 -04:00
Filip Troníček
33942e7179
[ws-gc] WS soft deletion improvements (#20271)
* [ws-gc] Additional logging

* typo fix

* test update

* Workspace is active now if it just stopped, started or just got created

* Don't ever GC currently running workspaces

* Fix tests

* Fix tests

* No more async filter predicates

* More prevention logging

* Log all timestamps and don't update `lastActive` when `activeNow === true`

* even cooler timestamps

* Add instance id to log context

* Remove filtering for only non-running workspaces
2024-10-15 08:25:12 -04:00
Filip Troníček
b1b2214bef
Provide a nicer image build failed message (#20281)
* Provide a nicer image build failed message

* an error message that actually shows up

* Tweak error message

* Make env retrieval consistent in supervisor config

* Fix broken docs link in dashboard
2024-10-15 05:53:11 -04:00
Filip Troníček
6f87a7a3d7
Repository finder & context parsing improvements (#20296) 2024-10-14 04:15:10 -04:00
mustard
b429e9373c
Disable JetBrains local ports forwarding with FF (#20274)
* Disable gitpod port forwarding

* Use FF and env to control port exposing

* Rename to `forwarding`

* disable local ports forwarding only
2024-10-11 10:18:26 -04:00
Filip Troníček
2a5da84ea8
Improve handling of missing files for BB and BBS (#20267)
* Fix repo names for Bitbucket (Server)

* remove unused project mutation

* Update tests

* Improve handling missing files for BB and BBS

* add tests
2024-10-07 08:51:22 -04:00
Filip Troníček
42a0293097
Fix repo names for Bitbucket (Server) (#20264)
* Fix repo names for Bitbucket (Server)

* remove unused project mutation

* Update tests

* Use `ContextService` again
2024-10-07 08:27:22 -04:00
Filip Troníček
9d42ec3ede
Follow-ups from #20269 (#20272)
* Follow-ups from #20269

* `matchesNewWorkspaceIdExactly` to handle `undefined`
2024-10-07 06:15:22 -04:00
Filip Troníček
3f0fc73f50
Fix spicedb throwing on invalid arguments (#20269) 2024-10-07 03:55:22 -04:00
Filip Troníček
7095780d3e
Non-project repository starting restrictions (#20234)
* add proto

* codegen

* impl

* WIP UI

* make it work

* Make it work

* Empty state

* Update copies (thx Fernando!)

* Fix tip flexbox

* fix newline for role restriction empty state

* When arbitrary repos are restricted, don't suggest them
2024-09-27 14:36:13 -04:00
mustard
41f47c80a7
Add Azure DevOps integration (#20202)
* Add node package

* first nit changes

* nit proto udpate

* fixup

* [server] add azure support

* fixup

* fixup

* server fixup

* [dashboard] changes

* fixup

* fixup

* Fix server bugs

* Fixup

* Fix dashboard

* Fix user integration

* Fix permission update modal

* tmp

* Add unit tests and fix get file content issue

* Add readme

* fix tag and branch parser

* Update README.md

* Remove API tests

* Disable azure devops support for PAYG

* Revert "Remove API tests"

This reverts commit a525cbd161e210d6e75bed0d62a339505f7c48df.

* Fix tests

* Rebase fixup

* nit fixing

* revert me

* Fix integration udpate

* Fix ENT-780

* Don't support azure devops on PAYG

* dashboard: add comments and remove new Azure DevOps supports on user settings page

* Fix push warning and make project a part of owner

* Proper handle errors

* Fix token can't refresh issue

* Fix api

* Add project context supports

* Update components/server/src/azure-devops/azure-context-parser.spec.ts

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

* Fix readablestream error

* Fix clone url

* Address feedback

- dashboard provider type update
- doc for checkWriteAccess
- Requirement.DEFAULT

* 1

* avatar

* Revert "revert me"

This reverts commit 189c431eca33b06812ae33beaf3f5c95a28604ee.

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-09-27 13:29:12 -04:00
Filip Troníček
91e9cb4b2d
[Bitbucket Server] better tag context handling (#20245) 2024-09-26 10:52:11 -04:00
Filip Troníček
d1e314b674
Proper webhook installation detection (#20240)
* Proper webhook installed detection

* fix webhook detection

* debug: enable webhook on newly enabled prebuilds

* Add a comment about the arbitrary last 50 events

* Remove unused `GetConfigurationWebhookActivityStatus`

* update fn comment

* Delete superflous log

* fix debugging webhooks

* remove unused webhook-hooks

* Revert "debug: enable webhook on newly enabled prebuilds"

This reverts commit 5cfebd8f1ef438565ee18202ecf6fca7f2df30ba.
2024-09-25 12:06:10 -04:00
Filip Troníček
cfe795c6ee
Prebuild trigger checks (#20228)
* Add `GetConfigurationWebhookActivityStatus` to proto

* codegen

* `GetConfigurationWebhookActivityStatus` impl

* give it a UI

* Revert trigger strategy on webhook event

* debug: enable webhooks again

* fix UI

* maybe fix build?

* Automatically convert to activity-based prebuilds

* 🤷‍♂️

* don't limit to a week when converting to activity-based

* Change copy

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

* Less cyclic deps

* removing warning and add informative trigger strategy field

* fix sizing of prebuild trigger strategy info

* Revert "debug: enable webhooks again"

This reverts commit 1c47067734b9f19bbe7e72522eab387fec6022b5.

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-09-23 09:00:08 -04:00
Filip Troníček
abb191fce0
Hashed user ID cookie improvements (#20232)
* refetch JWT cookie 20s after load

* set cookie on login

* make the cookie trigger at the right place
2024-09-18 21:57:04 -04:00
Siddhant Khare
92f3ec07d2
Implement hashed user ID cookie for analytics on Gitpod domains (#20231)
* Set hashed user ID cookie on JWT refresh for specific Gitpod domains

* refactor: Update setHashedUserIdCookie method in session handler for testing purposes

* attempt 2 to fix test

* refactor: Clear gitpod_hashed_user_id cookie after logout
2024-09-18 09:50:03 -04:00
Filip Troníček
fdbf605e80
Cell Disabled mode (#20222)
* wip

* Implement UI

* remove commented out code

* Cell disabled check for websockets
2024-09-18 04:06:03 -04:00
Siddhant Khare
d5208cbc7e
refactor: Update setHashedUserIdCookie method in analytics controller (#20229)
* refactor: Update setHashedUserIdCookie method in analytics controller

This commit updates the setHashedUserIdCookie method in the analytics controller. The changes include:
- Adding a server-side implementation to determine the appropriate domain for setting the cookie based on the request hostname

* nit fix :)

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

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-09-18 02:46:03 -04:00
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