Skip to content

[papi] List editor options #18530

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

Merged
merged 12 commits into from
Aug 18, 2023
Merged

[papi] List editor options #18530

merged 12 commits into from
Aug 18, 2023

Conversation

filiptronicek
Copy link
Member

@filiptronicek filiptronicek commented Aug 16, 2023

Description

Implements the server's getIDEOptions in a new EditorService named ListEditorOptions. It is a stripped down version of the original method, only exposing these fields:

  • id
  • title
  • type
  • logo
  • label
  • version

Sample response:

{
  "result": [
    {
      "id": "code",
      "title": "VS Code",
      "type": "TYPE_BROWSER",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/vscode.svg",
      "label": "Browser",
      "stable": {
        "version": "1.81.1"
      },
      "latest": {
        "version": "1.81.1"
      }
    },
    {
      "id": "code-desktop",
      "title": "VS Code",
      "type": "TYPE_DESKTOP",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/vscode.svg",
      "stable": {},
      "latest": {}
    },
    {
      "id": "intellij",
      "title": "IntelliJ IDEA",
      "type": "TYPE_DESKTOP",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/intellijIdeaLogo.svg",
      "label": "Ultimate",
      "stable": {
        "version": "2023.2"
      },
      "latest": {
        "version": "2023.2.1"
      }
    },
    {
      "id": "goland",
      "title": "GoLand",
      "type": "TYPE_DESKTOP",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/golandLogo.svg",
      "stable": {
        "version": "2023.2"
      },
      "latest": {
        "version": "2023.2"
      }
    },
    {
      "id": "pycharm",
      "title": "PyCharm",
      "type": "TYPE_DESKTOP",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/pycharmLogo.svg",
      "label": "Professional",
      "stable": {
        "version": "2023.2"
      },
      "latest": {
        "version": "2023.2.1"
      }
    },
    {
      "id": "phpstorm",
      "title": "PhpStorm",
      "type": "TYPE_DESKTOP",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/phpstormLogo.svg",
      "stable": {
        "version": "2023.2"
      },
      "latest": {
        "version": "2023.2.1"
      }
    },
    {
      "id": "rubymine",
      "title": "RubyMine",
      "type": "TYPE_DESKTOP",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/rubymineLogo.svg",
      "stable": {
        "version": "2023.2"
      },
      "latest": {
        "version": "2023.2.1"
      }
    },
    {
      "id": "webstorm",
      "title": "WebStorm",
      "type": "TYPE_DESKTOP",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/webstormLogo.svg",
      "stable": {
        "version": "2023.2"
      },
      "latest": {
        "version": "2023.2.1"
      }
    },
    {
      "id": "rider",
      "title": "Rider",
      "type": "TYPE_DESKTOP",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/riderLogo.svg",
      "stable": {
        "version": "2023.2"
      },
      "latest": {
        "version": "2023.2"
      }
    },
    {
      "id": "clion",
      "title": "CLion",
      "type": "TYPE_DESKTOP",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/clionLogo.svg",
      "stable": {
        "version": "2023.2"
      },
      "latest": {
        "version": "2023.2"
      }
    },
    {
      "id": "xterm",
      "title": "Terminal",
      "type": "TYPE_BROWSER",
      "logo": "https://ide.ft-list-editors.preview.gitpod-dev.com/image/ide-logo/terminal.svg",
      "label": "Insiders",
      "stable": {
        "version": "1.0.0"
      },
      "latest": {
        "version": "1.0.0"
      }
    }
  ]
}
Summary generated by Copilot

🤖 Generated by Copilot at f88fc14

This pull request adds a new editor service to the public API, which allows clients to query the available IDE options for the user. It also removes the obsolete workspaces service code from the public API TypeScript package. It involves changes to the gitpod service API, the public API server, the editor service protobuf definition, and the generated code for the editor service in Go and TypeScript.

Related Issue(s)

Fixes EXP-454

How to test

curl 'https://api.ft-list-editors.preview.gitpod-dev.com/gitpod.experimental.v1.EditorService/ListEditorOptions' \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer API_TOKEN' \
  --data '{}' | jq .

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

@filiptronicek filiptronicek marked this pull request as ready for review August 17, 2023 12:03
@filiptronicek filiptronicek requested a review from a team as a code owner August 17, 2023 12:03
repeated EditorOption options = 1;
}

message EditorOption {
Copy link
Member

Choose a reason for hiding this comment

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

fyi @svenefftinge @loujaybee we decided to call it Editor not IDE here to be aligned how we talk in our docs and on UI

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.

generally looks good but i did not test

/hold

if no-one objects when merge when you are ready.

@akosyakov
Copy link
Member

type does not look nice if someone will use it like REST, not sure whether we can make it simple browser or desktop

@filiptronicek
Copy link
Member Author

@akosyakov I'm not sure how to make pretty types. Protobuf enums look strict:

gitpod/experimental/v1/editor_service.proto:26:7:Enum value name "unspecified" should be prefixed with "EDITOR_TYPE_".
gitpod/experimental/v1/editor_service.proto:26:7:Enum value name "unspecified" should be UPPER_SNAKE_CASE, such as "UNSPECIFIED".
gitpod/experimental/v1/editor_service.proto:26:7:Enum zero value name "unspecified" should be suffixed with "_UNSPECIFIED".
gitpod/experimental/v1/editor_service.proto:27:7:Enum value name "browser" should be prefixed with "EDITOR_TYPE_".
gitpod/experimental/v1/editor_service.proto:27:7:Enum value name "browser" should be UPPER_SNAKE_CASE, such as "BROWSER".
gitpod/experimental/v1/editor_service.proto:28:7:Enum value name "desktop" should be prefixed with "EDITOR_TYPE_".
gitpod/experimental/v1/editor_service.proto:28:7:Enum value name "desktop" should be UPPER_SNAKE_CASE, such as "DESKTOP".

@roboquat roboquat merged commit 112eefc into main Aug 18, 2023
@roboquat roboquat deleted the ft/list-editors branch August 18, 2023 09:19
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.

3 participants