68 Commits

Author SHA1 Message Date
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
aeaec3405f
Fix public API test on main (#20352) 2024-11-07 23:04:04 -05:00
Aminur Rahman
812b946526
fix: avoid accessing null value (#20305) 2024-10-17 03:51:13 -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
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
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
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
Huiwen
c4b53f9320
Support validate claims with CEL expr for SSO (#20083)
* [papi] proto update

* [dashboard] nit TODO

* [papi] implement cel expression verify

* drop me: Add debug logs

* 1

* tidy

* export cel error message

* 💄 dashboard

* improve error

* nit doc
2024-08-07 02:33:45 -04: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
Filip Troníček
1b72b6839c
Update activity-based prebuilds tests (#20038) 2024-07-14 22:23: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
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
Sven Efftinge
9fa6f885dc
[server] audit log service (#19917) 2024-06-25 10:10:20 +02:00
Filip Troníček
f24a6101ee
Enable displaying JB warmup tasks in the Prebuilds UI (#19945)
* Enable displaying JB warmup tasks in the Prebuilds UI

* a hacky comment

* shorten jb warmup task id prefix

* update converter tests

* Capitalize product names

* Fix IDE order

* update golden test results
2024-06-24 15:59:19 +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
Sven Efftinge
e30a12fda1
[server] increase pagesize and fail when too much is requested. (#19817) 2024-05-31 16:03:11 +08:00
Huiwen
63858c2ac6
Fix main build golden tests (#19815)
* Fix main build golden tests

* fixup
2024-05-31 14:07:11 +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
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
Manuel Alejandro de Brito Fontes
236d7cf1f8
Rebuild dev-image for go v1.22 (#19572)
* Rebuild dev-image for go v1.22

* Update dev-image

* Update openssh to 9.7p1

* Refactor extraction of docker layer
2024-03-25 12:18:34 +01:00
Huiwen
f9d6077523
Add repo-level editor restriction (#19564)
* Implement repo-level editor restriction relates APIs

* hack

* address feedback

* Reset option load after context changed

* Address feedback

* 💄

---------

Co-authored-by: Jean Pierre <jeanpierre@gitpod.io>
2024-03-22 06:05:31 +01: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
Huiwen
1ab9a58c1d
Fix papi failed to convert with wsi.conditions undefined (#19546) 2024-03-18 11:29:27 +01:00
Jean Pierre
9e6419c3f4
Add pin editor version (#19479)
* Add pin editor version

* Put it behind feature flag

* Fix tests

* 💄

* 💄

* Add pin icon

* 💄

* Put version pinning behind feature flag
2024-03-15 18:35:25 +01:00
Huiwen
7decb17370
[papi] add proto of restricted editors on org-level and repo-level (#19488)
* [papi] add proto of restricted editors on org-level and repo-level

* address
2024-02-29 15:47:10 +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
Huiwen
718353ef90
[papi] add restricted_workspace_classes in repository settings (#19480)
* [papi] add `restricted_workspace_classes` in repository settings

* Update components/public-api/gitpod/v1/configuration.proto

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

* generate

* Fix build

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
2024-02-28 13:23:09 +02:00
Huiwen
b1da197018
[dashboard] reduce API call in prebuild pages (#19463)
* [papi] add repository_name a field of prebuild

* Remove unnecessary fetch of configuration in prebuilds
2024-02-23 17:21:04 +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
Filip Troníček
6e8cd3ed89
Configuration coachmark (#19413)
* Add repo migrate coachmark

* Public API: `coachmarksDismissals`

* Early exit for new signups

* Try to inject dismissal to link

* Dismiss on path visit

* Align to the left

* Dismiss on trigger

* Simplify show logic

Co-authored-by: Siddhant Khare <siddhant@gitpod.io>

* Consider `showPrebuildsMenuItem` when hiding projects

* update tests

* Adjust date for testing

* fix projects hide condition

* Fix repo link id ref

* Do not dismiss accidentally

* up-date

* move prebuild detail to correct folder

* Make sure errors are displayed properly for prebuilds list

* don't throw

* Report dismiss

---------

Co-authored-by: Siddhant Khare <siddhant@gitpod.io>
2024-02-19 23:47:01 +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
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
Huiwen
a91caf1e04
[papi] better grpc code for application unimplemented (#19351) 2024-01-24 15:27:01 +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
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
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
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