585 Commits

Author SHA1 Message Date
Gero Posmyk-Leinemann
26f7f5d742
Add more initializer-related info to /insights API (#20572)
* [ws-manager, ws-daemon] Store initializer metrics in workspace.Status.InitializerMetrics

Tool: gitpod/catfood.gitpod.cloud

* [ws-mananger-api, -mk2] Emit new field .Status.InitializerMetrics

Tool: gitpod/catfood.gitpod.cloud

* [db] Introduce DBWorkspaceInstanceMetrics and persist all metrics from ws-manager-api into it

Tool: gitpod/catfood.gitpod.cloud

* [api] Expose session.Metrics.InitializerMetrics

Tool: gitpod/catfood.gitpod.cloud

* [dashboard] Export metrics into CSV

Tool: gitpod/catfood.gitpod.cloud

* [content-service] Fix: emit fromBackup stats

Tool: gitpod/catfood.gitpod.cloud

* Update components/ws-manager-api/core.proto

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

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2025-02-26 14:34:12 -05:00
Gero Posmyk-Leinemann
dd50c2aee8
[api, server, dashboard] Cleanup UpdateOrganizationSettings API (#20603)
* [api, server, dashboard] Cleanup UpdateOrganizationSettings API

Tool: gitpod/catfood.gitpod.cloud

* Org settings partial updates improvements (#20626)

Tool: gitpod/catfood.gitpod.cloud

* review comment

Tool: gitpod/catfood.gitpod.cloud
2025-02-25 08:58:11 -05:00
Filip Troníček
04f590de85
Organization onboarding welcome message (#20577)
* squashed (- oidc/newUser)

Tool: gitpod/catfood.gitpod.cloud

* [server, db] Cleanup UpdateOrgSettings API handling

Tool: gitpod/catfood.gitpod.cloud

* [dashboard] Render WelcomeMessage based on a) user.createdAt and b) localStorage

Tool: gitpod/catfood.gitpod.cloud

* [api, server] Add missing update_allowed_workspace_classes field

Tool: gitpod/catfood.gitpod.cloud

* [dashboard] Fix updateOrgSettings API usage

Tool: gitpod/catfood.gitpod.cloud

* [dashboard, server] Fix duration handling/conversion

Tool: gitpod/catfood.gitpod.cloud

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2025-02-14 08:14:50 -05:00
Filip Troníček
9b574a9022
[server] make gRPC clients viable in non-HTTP/2-compatible environments (#20565)
* [server] make gRPC clients viable in non-HTTP/2-compatible environments

Tool: gitpod/catfood.gitpod.cloud

* Address review comments

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
Tool: gitpod/catfood.gitpod.cloud

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2025-01-30 07:00:19 -05:00
Filip Troníček
c24b8f4aed
Add optional, org-wide Gitpod commit annotation (#20525)
* [supervisor] Add Gitpod commit annotation

* server and API changes

* [dashboard] add org setting for commit annotation

* Fix things

* Fix label for annotation switch

* Revert accidental rename

* minor docs fixes

* Add a feature flag for the setting: `commit_annotation_setting_enabled`

* Register hook in the cloned repo instead of under /etc/

* don't override existing hooks

* `gp git-commit-message-helper` to use `git interpret-trailers`

* Test it!

* 🧹 indeed

* Update timestamp of DB migration
2025-01-24 08:11:14 -05:00
Gero Posmyk-Leinemann
ad4b7a8f4a
Introduce org-level GITPOD_IMAGE_AUTH (#20538)
* [db, protocol] Introduce DBOrgEnvVar

* [server, spicedb] Introduce and integrate org env vars into internal services

* [server, public-api] Added API for org-level environment variables

* [dashboard] Add UI for setting/removing GITPOD_IMAGE_AUTH to "Organization Settings"

* [db, server] Fix DB queries, mapping to image-build args and fixed tests

* [dashboard] Review comment "icon spacing"

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

* [dashboard] Review comment superfluous key

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

* [dashboard] more spacing

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

* [dashboard] Copyright year

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

* [public-api] Add converter test case

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2025-01-24 03:43:14 -05:00
Filip Troníček
d54bd04999
Enteprise onboarding settings (#20508)
* UI reorg

* generated stuffs

* Make it woooooooork

* Classier placeholder

* Remove unneeded fragment

* Introduce `enterprise_onboarding_enabled` flag

* move things properly

* add ipv6 localhost
2025-01-08 11:05:23 -05:00
Filip Troníček
55b486ee5f
Introduce max_parallel_running_workspaces for orgs (#20448)
* Introduce `max_parallel_running_workspaces` for orgs

* Add migration

* Add UI and org settings server changes

* Rough edges

* Number inputs (:trollface:)

* Move LazyOrganizationService to UBP entitlement service to get rid of circ. dep. errs

* Fix tests

* Update components/gitpod-db/src/typeorm/entity/db-team-settings.ts

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

* Rename `isPaidPlan` to `isPaidOrDedicated` and get rid of `update_max_parallel_running_workspaces`

* Update components/server/src/workspace/workspace-service.ts

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

* Deduplicate instance counting logic

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-12-16 09:06:02 -05:00
Filip Troníček
a303660a5f
Add insights page (#20437)
* Add WS image metrics to workspace instances

* Update tests

* fix ws-manager-api field description

* [dashboard] Org Insights page

* Pagination, date filters and downloads

* Safety limits for pagination and prettier icons

* UI improvements

* Enhance `from` date to capture whole day

* some more props for the CSVs

* Include git context with workspace responses

* Context url segments in CSV

* ide => editor to align with papi convention

* Remove duplicate fc

* revert route deletion

* Update papi converter tests and revert unecessary changes

* fix error rendering

* partly revert ws api svc changes

* Remove debug lines

* fix proto typo

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

* Remove org member listing from frontend

* Shorter == better 😎

* Move workspace.metadata.context onto a top-level `WorkspaceSession` property

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-12-12 08:55:33 -05:00
Gero Posmyk-Leinemann
7f43d48115
[server, dashboard] Introduce multi-org (behind feature flag) (#20431)
* [server config] Introduce isDedicatedInstallation, and use it to replace isSIngleOrgInstallation

incl. further cleanup around getConfiguration and server config

* [server, dashboard] Remove enableDedicatedOnboardingFlow feature flag and replace is with getInstallationConfiguration.IsDedicatedInstallation

* [dashboard, server] Remove "sinlgeOrgMode"

* [server] OrganizationService: block createTeam consistently for org-owned users

* [server, dashboard] Introduce "enable_multi_org" feature flag to allow admin-user to create organizations

* [dashboard] introduce "/?orgSlug=", which allows to pre-select an org in a "create workspace" URL (e.g. "/?orgSlug=org1#github.com/my/repo")

* [db] Auto-delete container "test-mysql" if it's already present

* fix tests

* [dashboard] Check if localStorage is available before using it

* [dashboard] SSOLogin: fix orgSlug source precedence to: path/search/localStorage

* [server] Deny "joinOrganization" for org-owned users

* Gpl/970-multi-org-tests (#20436)

* fix tests for real

* [server] Create OrgService.createOrgOwnedUser, and use that across tests to fix the "can't join org" permission issues

* Update components/server/src/orgs/organization-service.ts

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

---------

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

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-12-09 08:00:16 -05:00
Filip Troníček
5bb738a530
Add WS image metrics to workspace instances (#20426)
* Add WS image metrics to workspace instances

* Update tests

* fix ws-manager-api field description

* Prefer existing DB values for metrics

* Copy proto comments over to protocol type
2024-12-09 05:01:16 -05: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
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
Filip Troníček
35f53b9386
Enforce minimum scopes in the UI (#20217) 2024-09-16 03:56:02 -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
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
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
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
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
9fa6f885dc
[server] audit log service (#19917) 2024-06-25 10:10:20 +02:00
Sven Efftinge
a3caec67fa
[server] remove old workspace gc logic (#19931) 2024-06-19 13:26:14 +02:00
Sven Efftinge
80f793d145
[server] update job for eligableDeletionTime (#19838) 2024-06-05 14:35:16 +08:00
Sven Efftinge
e7d79c355e
[server] add workspace.deletionEligabilityTime (#19831) 2024-06-04 16:51:15 +08:00
Gero Posmyk-Leinemann
7328214685
[server] Introduce job CapGitStatus (#19814)
* [server} Introduce job CapGitStatus

* [server] Have runners report unitsOfWork

* fix query
2024-05-31 22:43:12 +08:00
Sven Efftinge
c80ce4852b
[server] allow fetching task specific prebuild-logs (#19812)
* [server] allow fetching task specific prebuild-logs

* [dashboard] prebuild details shows tabs per task
2024-05-30 22:53:11 +08:00
Sven Efftinge
2a397c31f6
[server] listWorkspaceSessions API (#19733) 2024-05-13 21:00:51 +08:00
Gero Posmyk-Leinemann
435fa5e729
Opportunistic token refresh (for BitBucket Server) (#19715)
* [server] Introduce and use "reservedUntilDate" in TokenService

* Fix for extending reservations, and a bit of cleanup

* review comments
2024-05-13 18:15:51 +08:00
Sven Efftinge
0743fe4a76
[server] delete project env vars (#19707) 2024-05-07 16:28:45 +08:00
Sven Efftinge
30d5e2fa08
Configure default role for new joiners (#19701) 2024-05-06 17:05:44 +08:00
Alex Tugarev
13d7bdbcb2
[admin] add "Block Free Usage" (#19633) 2024-04-17 11:31:55 +02:00
Huiwen
ae09aca59a
Add editor restriction on organization-level (#19542)
* [server] allow to update org settings

* [dashboard] allow org-level editor restriction

* Org owned user's editor settings should be restricted too

* Never pass empty array

* Fix user onboarding editors always loading

* Fix incorrect loading state of ide versions

* Show available editors for org owned users

* Update components/dashboard/src/user-settings/SelectIDE.tsx

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

* Address feedback

* Revert version pin on user settings page

* Add json rpc checking

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-03-20 14:07:29 +01:00
Filip Troníček
bff27b6e00
Ensure valid repository tie when listing prebuilds (#19558)
* Ensure valid repository tie when listing prebuilds

* Make sure tests have a valid project

* Prettier display of not found entries

* Fix toasters

* Test non-existent configuration

* Refactor error components
2024-03-19 14:53:28 +01:00
Jean Pierre
475be1259b
Add db migration (#19510) 2024-03-07 17:51:17 +02:00
Huiwen
49b24097d6
Add db migration for org-level default editor (#19509) 2024-03-06 16:54:16 +02:00
Huiwen
01d7e420aa
Add db migration for org-level editor restriction (#19489) 2024-02-29 13:56:10 +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
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
b655c99b20
Add admin role to builtin admin back (#19337) 2024-01-19 09:25:55 +02:00
Sven Efftinge
0a3e22ba3d
[usage] track email for free allowance (#19303)
* [usage] track email for free allowance

* [db] d_b_free_credits: Add indexes for userId and email

---------

Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
2024-01-04 10:49:41 +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
671f1c6f04
[gitpod-db] AddOrgSettingWorkspaceClass1701725025283 (#19273) 2023-12-15 13:14: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
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
Filip Troníček
46ff2d0121
Scope config lookup to org (#19217) 2023-12-08 08:50:15 +02:00
Alex Tugarev
cf2facc944
Fix team-db spec (#19207) 2023-12-07 08:48:14 +02:00
Alex Tugarev
e4ccbf0b4d
GetAuthenticatedUser in Dashboard (#19142)
* [dashboard] remove unused service mock

* [dashboard] use `GetAuthenticatedUser` instead of `getLoggedInUser`

* fixup: override workspaceAutostartOptions

also fix toDurationString call

* fixup: move `isOnboardingUser` to dashboard

* fixup: move getProfile from protocol to common

* fixup fromWorkspaceAutostartOption

* move getPrimaryEmail to common and clean up

* rm getProfile from protocol, use ProfileDetails

* fixup missing leeway dependencies

* fix getPrimaryEmail

* fix resetting workspace timeout

* [gitpod-db] remove dependency to `@gitpod/public-api-common`

* cleanup BUILD.yaml
2023-12-06 17:42:14 +02:00
Sven Efftinge
ad2a077973
[db] fix the query for non-fga migrated users (#19194) 2023-12-05 15:03:12 +02:00