Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default image get to PAPI and improve Dashboard #18767

Merged
merged 13 commits into from
Sep 22, 2023
Merged

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Sep 21, 2023

Description

This PR improved:

  • Add warning when a customized org default image's workspace stopped with failed state
  • Use public API instead of env var to get default workspace image (will be used on gp validate and gp init)
  • Nit improvement of UX on org settings page
    • Always show Default Image label
    • Remove fixed width of image tag
👉 Warning on Start Workspace page
Img
image
Summary generated by Copilot

🤖 Generated by Copilot at 00ee208

Added a new RPC and public API endpoint to get the default workspace image from different sources. Refactored the dashboard and protocol components to use strings instead of objects for the image props. Removed unused dummy fields and methods from the public API. Added mock and proxy implementations for testing and connecting the services.

Related Issue(s)

Fixes EXP-631, EXP-633

How to test

SHOULD - Dashboard

  • Open preview env and set your org's default image to something not compatible with Gitpod like node:20-alpine3.17
  • Open a workspace, it should stopped with warning
  • Remove org setting image to default
  • Open a workspace, stop it, it should not show warning
  • Update org image setting to gitpod/workspace-base
  • Open a workspace, stop it, it should not show warning

SHOULD - GP-CLI

Check gp validate and gp init as #18723 's description, there should have no regression

❌ NOT

Open a workspace with .gitpod.yml image (like node:20-alpine3.17 that break workspaces) field configured on your org, it should not show org image setting warning

It's marked as NOT since we have no way to identify which image current workspace is using now.

Use org setting node:20-alpine3.17 to open workspace and failed, change org default to empty, back to failed workspace page, refresh should still show warning

It's marked as NOT since we have no way to identify which org image current workspace is using now.

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@roboquat roboquat added size/XL and removed size/L labels Sep 21, 2023
@mustard-mh mustard-mh marked this pull request as ready for review September 21, 2023 13:30
@mustard-mh mustard-mh requested a review from a team as a code owner September 21, 2023 13:30
@mustard-mh mustard-mh marked this pull request as draft September 21, 2023 13:31
@mustard-mh mustard-mh marked this pull request as ready for review September 21, 2023 14:27
@mustard-mh mustard-mh requested a review from gtsiolis September 21, 2023 14:27
<Alert className="w-96 mt-4" type="warning">
A custom <span className="font-medium">default workspace image</span> is set for this organization. Contact
an organization owner or specify a different image in <code>.gitpod.yml</code>.
</Alert>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to update this warning message since we can't identify if current workspace were started with org default workspace. See How to Test section Not part.

cc @gtsiolis @filiptronicek If you have good idea about it

@mustard-mh mustard-mh changed the title [WIP] Add default image get to PAPI and improve Dashboard Add default image get to PAPI and improve Dashboard Sep 21, 2023
@gtsiolis
Copy link
Contributor

Looking at this now! 👀

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mustard-mh. Left some comments below. Let me know what you think.

components/dashboard/src/teams/TeamSettings.tsx Outdated Show resolved Hide resolved
components/dashboard/src/teams/TeamSettings.tsx Outdated Show resolved Hide resolved
components/dashboard/src/teams/TeamSettings.tsx Outdated Show resolved Hide resolved
components/dashboard/src/start/StartPage.tsx Outdated Show resolved Hide resolved
@mustard-mh
Copy link
Contributor Author

@akosyakov Could you take a look at PublicAPI part? 🙏

workspaceId?: string;
}

export type DefaultImageSource =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do clients really need it?

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API changes look good, i did not review rest and did not try

/hold

@mustard-mh
Copy link
Contributor Author

mustard-mh commented Sep 22, 2023

@gtsiolis Good if I unhold this PR? (ask because addressed feedbacks are not marked as resolved yet)

@gtsiolis
Copy link
Contributor

@mustard-mh Yes, resolved any pending UX comments. Leaving this to you. 🏓

@roboquat roboquat merged commit 62c573a into main Sep 22, 2023
15 checks passed
@roboquat roboquat deleted the hw/image-get-api branch September 22, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants