From dc89f7201de0d0284d204687922c7269d4d83d4c Mon Sep 17 00:00:00 2001 From: Daniyal Arshad Date: Mon, 30 Sep 2024 14:35:41 -0400 Subject: [PATCH 1/3] Remove references for editor field on workspaces - Remove model validations - Remove references in WorkspaceCreator - Remove graphql references - Remove frontend references - Remove specs and factories Changelog: changed EE: true --- .../20241001163638_add_default_valueto_editor_column.rb | 9 +++++++++ db/schema_migrations/20241001163638 | 1 + db/structure.sql | 2 +- doc/api/graphql/reference/index.md | 2 -- ee/app/assets/javascripts/workspaces/user/constants.js | 1 - .../assets/javascripts/workspaces/user/pages/create.vue | 2 -- .../remote_development/workspace_operations/create.rb | 5 ----- .../graphql/types/remote_development/workspace_type.rb | 3 --- ee/app/models/remote_development/workspace.rb | 3 +-- .../workspace_operations/create/workspace_creator.rb | 2 -- ee/spec/factories/remote_development/workspaces.rb | 1 - ee/spec/frontend/workspaces/user/pages/create_spec.js | 2 -- .../types/remote_development/workspace_type_spec.rb | 2 +- .../workspace_operations/create/devfile_fetcher_spec.rb | 2 -- .../workspace_operations/create/main_integration_spec.rb | 3 --- .../create/workspace_creator_spec.rb | 2 -- ee/spec/models/remote_development/workspace_spec.rb | 7 ------- .../workspace_operations/create_spec.rb | 1 - .../workspace_operations/update_spec.rb | 3 +-- ee/spec/requests/remote_development/integration_spec.rb | 3 --- 20 files changed, 14 insertions(+), 42 deletions(-) create mode 100644 db/migrate/20241001163638_add_default_valueto_editor_column.rb create mode 100644 db/schema_migrations/20241001163638 diff --git a/db/migrate/20241001163638_add_default_valueto_editor_column.rb b/db/migrate/20241001163638_add_default_valueto_editor_column.rb new file mode 100644 index 00000000000000..e0a7cd7e2c7c13 --- /dev/null +++ b/db/migrate/20241001163638_add_default_valueto_editor_column.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddDefaultValuetoEditorColumn < Gitlab::Database::Migration[2.2] + milestone '17.5' + + def change + change_column_default :workspaces, :editor, from: nil, to: 'webide' + end +end diff --git a/db/schema_migrations/20241001163638 b/db/schema_migrations/20241001163638 new file mode 100644 index 00000000000000..bf9532c2ea53de --- /dev/null +++ b/db/schema_migrations/20241001163638 @@ -0,0 +1 @@ +8200c0f506522b56aea29d87eb62bda7c259947232c1740ec073488aa8eac9d0 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 139449b331637a..21e76cbffb76e5 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -21250,7 +21250,7 @@ CREATE TABLE workspaces ( namespace text NOT NULL, desired_state text NOT NULL, actual_state text NOT NULL, - editor text NOT NULL, + editor text DEFAULT 'webide'::text NOT NULL, devfile_ref text NOT NULL, devfile_path text NOT NULL, devfile text, diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 347219459f7c2d..2fc8af2deec90d 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -10974,7 +10974,6 @@ Input type: `WorkspaceCreateInput` | `desiredState` | [`String!`](#string) | Desired state of the created workspace. | | `devfilePath` | [`String!`](#string) | Project repo git path containing the devfile used to configure the workspace. | | `devfileRef` | [`String!`](#string) | Project repo git ref containing the devfile used to configure the workspace. | -| `editor` | [`String!`](#string) | Editor to inject into the created workspace. Must match a configured template. | | `maxHoursBeforeTermination` | [`Int!`](#int) | Maximum hours the workspace can exist before it is automatically terminated. | | `projectId` | [`ProjectID!`](#projectid) | ID of the project that will provide the Devfile for the created workspace. | | `variables` | [`[WorkspaceVariableInput!]`](#workspacevariableinput) | Variables to inject into the workspace. | @@ -36036,7 +36035,6 @@ Represents a remote development workspace. | `devfilePath` | [`String!`](#string) | Path to the devfile used to configure the workspace. | | `devfileRef` | [`String!`](#string) | Git reference that contains the devfile used to configure the workspace. | | `devfileWebUrl` | [`String!`](#string) | Web URL of the devfile used to configure the workspace. | -| `editor` | [`String!`](#string) | Editor used to configure the workspace. Must match a configured template. | | `id` | [`RemoteDevelopmentWorkspaceID!`](#remotedevelopmentworkspaceid) | Global ID of the workspace. | | `maxHoursBeforeTermination` | [`Int!`](#int) | Number of hours until the workspace automatically terminates. | | `name` | [`String!`](#string) | Name of the workspace in Kubernetes. | diff --git a/ee/app/assets/javascripts/workspaces/user/constants.js b/ee/app/assets/javascripts/workspaces/user/constants.js index 7142590034e734..f5365bdbf4b224 100644 --- a/ee/app/assets/javascripts/workspaces/user/constants.js +++ b/ee/app/assets/javascripts/workspaces/user/constants.js @@ -19,7 +19,6 @@ export const PROJECT_VISIBILITY = { export const DEFAULT_DESIRED_STATE = WORKSPACE_STATES.running; export const DEFAULT_DEVFILE_PATH = '.devfile.yaml'; -export const DEFAULT_EDITOR = 'webide'; export const WORKSPACE_VARIABLE_INPUT_TYPE_ENUM = { env: 'ENVIRONMENT', diff --git a/ee/app/assets/javascripts/workspaces/user/pages/create.vue b/ee/app/assets/javascripts/workspaces/user/pages/create.vue index e4bd6d515b901c..4f569125d62971 100644 --- a/ee/app/assets/javascripts/workspaces/user/pages/create.vue +++ b/ee/app/assets/javascripts/workspaces/user/pages/create.vue @@ -29,7 +29,6 @@ import { addWorkspace } from '../services/apollo_cache_mutators'; import { DEFAULT_DESIRED_STATE, DEFAULT_DEVFILE_PATH, - DEFAULT_EDITOR, ROUTES, PROJECT_VISIBILITY, } from '../constants'; @@ -218,7 +217,6 @@ export default { input: { projectId: this.projectId, clusterAgentId: this.selectedAgent, - editor: DEFAULT_EDITOR, desiredState: DEFAULT_DESIRED_STATE, devfileRef: this.devfileRef, devfilePath: this.devfilePath, diff --git a/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb b/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb index 9cbb05da36abf6..68571b2a33d7e5 100644 --- a/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb +++ b/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb @@ -26,11 +26,6 @@ class Create < BaseMutation required: true, description: 'Desired state of the created workspace.' - argument :editor, - GraphQL::Types::String, - required: true, - description: 'Editor to inject into the created workspace. Must match a configured template.' - argument :max_hours_before_termination, GraphQL::Types::Int, required: true, diff --git a/ee/app/graphql/types/remote_development/workspace_type.rb b/ee/app/graphql/types/remote_development/workspace_type.rb index 3789b2ba26f11f..c865eb93b069e2 100644 --- a/ee/app/graphql/types/remote_development/workspace_type.rb +++ b/ee/app/graphql/types/remote_development/workspace_type.rb @@ -46,9 +46,6 @@ class WorkspaceType < ::Types::BaseObject field :url, GraphQL::Types::String, null: false, description: 'URL of the workspace.' - field :editor, GraphQL::Types::String, - null: false, description: 'Editor used to configure the workspace. Must match a configured template.' - field :max_hours_before_termination, GraphQL::Types::Int, null: false, description: 'Number of hours until the workspace automatically terminates.' diff --git a/ee/app/models/remote_development/workspace.rb b/ee/app/models/remote_development/workspace.rb index 675c8477946389..56dedcb7976810 100644 --- a/ee/app/models/remote_development/workspace.rb +++ b/ee/app/models/remote_development/workspace.rb @@ -11,6 +11,7 @@ class Workspace < ApplicationRecord ignore_column :dns_zone, remove_with: '17.5', remove_after: '2024-10-11' ignore_column :config_version, remove_with: '17.6', remove_after: '2024-10-18' + ignore_column :editor, remove_with: '17.7', remove_after: '2024-11-21' belongs_to :user, inverse_of: :workspaces belongs_to :project, inverse_of: :workspaces @@ -24,7 +25,6 @@ class Workspace < ApplicationRecord validates :user, presence: true validates :agent, presence: true - validates :editor, presence: true validates :personal_access_token, presence: true # TODO: uncomment this line with below issue in 17.6 # https://gitlab.com/gitlab-org/gitlab/-/issues/493992 @@ -34,7 +34,6 @@ class Workspace < ApplicationRecord # for state validation rules validates :desired_state, inclusion: { in: VALID_DESIRED_STATES } validates :actual_state, inclusion: { in: VALID_ACTUAL_STATES } - validates :editor, inclusion: { in: ['webide'], message: "'webide' is currently the only supported editor" } validate :validate_workspaces_agent_config_present, if: -> { agent } validate :validate_workspaces_agent_config_version_is_within_range, if: -> do diff --git a/ee/lib/remote_development/workspace_operations/create/workspace_creator.rb b/ee/lib/remote_development/workspace_operations/create/workspace_creator.rb index 197923472016af..417f7007cd9385 100644 --- a/ee/lib/remote_development/workspace_operations/create/workspace_creator.rb +++ b/ee/lib/remote_development/workspace_operations/create/workspace_creator.rb @@ -27,7 +27,6 @@ def self.create(context) } params => { desired_state: String => desired_state, - editor: String => editor, max_hours_before_termination: Integer => max_hours_before_termination, devfile_ref: String => devfile_ref, devfile_path: String => devfile_path, @@ -44,7 +43,6 @@ def self.create(context) workspace.actual_state = CREATION_REQUESTED workspace.desired_config_generator_version = RemoteDevelopment::WorkspaceOperations::DesiredConfigGeneratorVersion::LATEST_VERSION - workspace.editor = editor workspace.max_hours_before_termination = max_hours_before_termination workspace.devfile_ref = devfile_ref workspace.devfile_path = devfile_path diff --git a/ee/spec/factories/remote_development/workspaces.rb b/ee/spec/factories/remote_development/workspaces.rb index 00c14d0c0b205f..dfe61a3989679b 100644 --- a/ee/spec/factories/remote_development/workspaces.rb +++ b/ee/spec/factories/remote_development/workspaces.rb @@ -19,7 +19,6 @@ desired_state { RemoteDevelopment::WorkspaceOperations::States::STOPPED } actual_state { RemoteDevelopment::WorkspaceOperations::States::STOPPED } deployment_resource_version { 2 } - editor { 'webide' } max_hours_before_termination { 24 } devfile_ref { 'main' } diff --git a/ee/spec/frontend/workspaces/user/pages/create_spec.js b/ee/spec/frontend/workspaces/user/pages/create_spec.js index ed442fdb1ac156..c4a1a973cda328 100644 --- a/ee/spec/frontend/workspaces/user/pages/create_spec.js +++ b/ee/spec/frontend/workspaces/user/pages/create_spec.js @@ -22,7 +22,6 @@ import createMockApollo from 'helpers/mock_apollo_helper'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { DEFAULT_DESIRED_STATE, - DEFAULT_EDITOR, ROUTES, WORKSPACE_VARIABLE_INPUT_TYPE_ENUM, WORKSPACES_LIST_PAGE_SIZE, @@ -428,7 +427,6 @@ describe('workspaces/user/pages/create.vue', () => { input: { clusterAgentId: selectedClusterAgentOneIDFixture, projectId: projectGid, - editor: DEFAULT_EDITOR, desiredState: DEFAULT_DESIRED_STATE, devfilePath, maxHoursBeforeTermination, diff --git a/ee/spec/graphql/types/remote_development/workspace_type_spec.rb b/ee/spec/graphql/types/remote_development/workspace_type_spec.rb index 9faa5fe07aefb7..15e0e63acda029 100644 --- a/ee/spec/graphql/types/remote_development/workspace_type_spec.rb +++ b/ee/spec/graphql/types/remote_development/workspace_type_spec.rb @@ -7,7 +7,7 @@ %i[ id cluster_agent project_id user name namespace max_hours_before_termination desired_state desired_state_updated_at actual_state responded_to_agent_at - url editor devfile_ref devfile_path devfile_web_url devfile processed_devfile + url devfile_ref devfile_path devfile_web_url devfile processed_devfile deployment_resource_version created_at updated_at ] end diff --git a/ee/spec/lib/remote_development/workspace_operations/create/devfile_fetcher_spec.rb b/ee/spec/lib/remote_development/workspace_operations/create/devfile_fetcher_spec.rb index 8b30acd81d3a0f..e2a87db435bbae 100644 --- a/ee/spec/lib/remote_development/workspace_operations/create/devfile_fetcher_spec.rb +++ b/ee/spec/lib/remote_development/workspace_operations/create/devfile_fetcher_spec.rb @@ -19,14 +19,12 @@ let(:devfile_path) { '.devfile.yaml' } let(:devfile_fixture_name) { 'example.devfile.yaml' } let(:devfile_yaml) { read_devfile(devfile_fixture_name) } - let(:editor) { 'webide' } let(:workspace_root) { '/projects' } let(:params) do { agent: agent, user: user, project: project, - editor: editor, max_hours_before_termination: 24, desired_state: RemoteDevelopment::WorkspaceOperations::States::RUNNING, devfile_ref: devfile_ref, diff --git a/ee/spec/lib/remote_development/workspace_operations/create/main_integration_spec.rb b/ee/spec/lib/remote_development/workspace_operations/create/main_integration_spec.rb index ebcacc7e885034..566ab811e50050 100644 --- a/ee/spec/lib/remote_development/workspace_operations/create/main_integration_spec.rb +++ b/ee/spec/lib/remote_development/workspace_operations/create/main_integration_spec.rb @@ -19,7 +19,6 @@ let(:devfile_fixture_name) { 'example.devfile.yaml' } let(:devfile_yaml) { read_devfile(devfile_fixture_name) } let(:expected_processed_devfile) { YAML.safe_load(example_processed_devfile).to_h } - let(:editor) { 'webide' } let(:workspace_root) { '/projects' } let(:dns_zone) { 'dns.zone.me' } let(:variables) do @@ -45,7 +44,6 @@ agent: agent, user: user, project: project, - editor: editor, max_hours_before_termination: 24, desired_state: RemoteDevelopment::WorkspaceOperations::States::RUNNING, devfile_ref: devfile_ref, @@ -116,7 +114,6 @@ expect(workspace.actual_state).to eq(RemoteDevelopment::WorkspaceOperations::States::CREATION_REQUESTED) expect(workspace.name).to eq("workspace-#{agent.id}-#{user.id}-#{random_string}") expect(workspace.namespace).to eq("gl-rd-ns-#{agent.id}-#{user.id}-#{random_string}") - expect(workspace.editor).to eq('webide') expect(workspace.workspaces_agent_config_version).to eq(expected_workspaces_agent_config_version) expect(workspace.url).to eq(URI::HTTPS.build({ host: "60001-#{workspace.name}.#{dns_zone}", diff --git a/ee/spec/lib/remote_development/workspace_operations/create/workspace_creator_spec.rb b/ee/spec/lib/remote_development/workspace_operations/create/workspace_creator_spec.rb index 0052fdcdddc896..2794bfdbc135b4 100644 --- a/ee/spec/lib/remote_development/workspace_operations/create/workspace_creator_spec.rb +++ b/ee/spec/lib/remote_development/workspace_operations/create/workspace_creator_spec.rb @@ -18,14 +18,12 @@ let(:desired_state) { RemoteDevelopment::WorkspaceOperations::States::RUNNING } let(:processed_devfile_yaml) { YAML.safe_load(example_processed_devfile) } - let(:editor) { 'webide' } let(:workspace_root) { '/projects' } let(:params) do { agent: agent, user: user, project: project, - editor: editor, max_hours_before_termination: 24, desired_state: desired_state, devfile_ref: 'main', diff --git a/ee/spec/models/remote_development/workspace_spec.rb b/ee/spec/models/remote_development/workspace_spec.rb index 436bc43bd7b999..e161410caa1f41 100644 --- a/ee/spec/models/remote_development/workspace_spec.rb +++ b/ee/spec/models/remote_development/workspace_spec.rb @@ -359,13 +359,6 @@ end end - context "on editor" do - it 'validates editor is webide' do - workspace.editor = 'not-webide' - expect(workspace).not_to be_valid - end - end - context 'on max_hours_before_termination' do context 'when max_hours_before_termination is greater than the agent max_hours_before_termination limit' do context 'when it is created' do diff --git a/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/create_spec.rb b/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/create_spec.rb index d1a7750708427f..d2857c40a76e2c 100644 --- a/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/create_spec.rb +++ b/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/create_spec.rb @@ -40,7 +40,6 @@ let(:all_mutation_args) do { desired_state: desired_state, - editor: 'webide', max_hours_before_termination: 24, cluster_agent_id: agent.to_global_id.to_s, project_id: workspace_project.to_global_id.to_s, diff --git a/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/update_spec.rb b/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/update_spec.rb index cf9fa134ed9b0b..9da1cc0c0de214 100644 --- a/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/update_spec.rb +++ b/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/update_spec.rb @@ -22,8 +22,7 @@ agent: agent, project: project, user: user, - desired_state: RemoteDevelopment::WorkspaceOperations::States::RUNNING, - editor: 'webide' + desired_state: RemoteDevelopment::WorkspaceOperations::States::RUNNING ) end diff --git a/ee/spec/requests/remote_development/integration_spec.rb b/ee/spec/requests/remote_development/integration_spec.rb index 2b51b3bc3edfc8..140e3f7b6be7b0 100644 --- a/ee/spec/requests/remote_development/integration_spec.rb +++ b/ee/spec/requests/remote_development/integration_spec.rb @@ -97,7 +97,6 @@ end let(:expected_processed_devfile) { YAML.safe_load(expected_processed_devfile_yaml).to_h } - let(:editor) { "webide" } let(:workspace_root) { "/projects" } let(:user_provided_variables) do [ @@ -217,7 +216,6 @@ def do_create_workspace(cluster_agent_id) expect(workspace.desired_state_updated_at).to eq(Time.current) expect(workspace.name).to eq("workspace-#{agent.id}-#{user.id}-#{random_string}") expect(workspace.namespace).to eq("gl-rd-ns-#{agent.id}-#{user.id}-#{random_string}") - expect(workspace.editor).to eq("webide") expect(workspace.url).to eq(URI::HTTPS.build({ host: "60001-#{workspace.name}.#{dns_zone}", query: { @@ -260,7 +258,6 @@ def do_create_workspace(cluster_agent_id) def workspace_create_mutation_args(cluster_agent_id) { desired_state: RemoteDevelopment::WorkspaceOperations::States::RUNNING, - editor: "webide", max_hours_before_termination: 24, cluster_agent_id: cluster_agent_id, project_id: workspace_project.to_global_id.to_s, -- GitLab From 3d8a41e2f2df254d79667c49715f31d8d4d2fa41 Mon Sep 17 00:00:00 2001 From: Daniyal Arshad Date: Tue, 8 Oct 2024 18:56:37 -0400 Subject: [PATCH 2/3] Add deprecation warnings for editor field --- doc/api/graphql/reference/index.md | 2 ++ .../remote_development/workspace_operations/create.rb | 7 +++++++ ee/app/graphql/types/remote_development/workspace_type.rb | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 2fc8af2deec90d..ffaeca3d94533a 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -10974,6 +10974,7 @@ Input type: `WorkspaceCreateInput` | `desiredState` | [`String!`](#string) | Desired state of the created workspace. | | `devfilePath` | [`String!`](#string) | Project repo git path containing the devfile used to configure the workspace. | | `devfileRef` | [`String!`](#string) | Project repo git ref containing the devfile used to configure the workspace. | +| `editor` **{warning-solid}** | [`String`](#string) | **Deprecated:** Argument is not used. Deprecated in GitLab 17.5. | | `maxHoursBeforeTermination` | [`Int!`](#int) | Maximum hours the workspace can exist before it is automatically terminated. | | `projectId` | [`ProjectID!`](#projectid) | ID of the project that will provide the Devfile for the created workspace. | | `variables` | [`[WorkspaceVariableInput!]`](#workspacevariableinput) | Variables to inject into the workspace. | @@ -36035,6 +36036,7 @@ Represents a remote development workspace. | `devfilePath` | [`String!`](#string) | Path to the devfile used to configure the workspace. | | `devfileRef` | [`String!`](#string) | Git reference that contains the devfile used to configure the workspace. | | `devfileWebUrl` | [`String!`](#string) | Web URL of the devfile used to configure the workspace. | +| `editor` **{warning-solid}** | [`String!`](#string) | **Deprecated** in GitLab 17.5. Field is not used. | | `id` | [`RemoteDevelopmentWorkspaceID!`](#remotedevelopmentworkspaceid) | Global ID of the workspace. | | `maxHoursBeforeTermination` | [`Int!`](#int) | Number of hours until the workspace automatically terminates. | | `name` | [`String!`](#string) | Name of the workspace in Kubernetes. | diff --git a/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb b/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb index 68571b2a33d7e5..215f9fa596786b 100644 --- a/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb +++ b/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb @@ -26,6 +26,13 @@ class Create < BaseMutation required: true, description: 'Desired state of the created workspace.' + # TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/498322 - Remove in 18.0 + argument :editor, + GraphQL::Types::String, + required: false, + description: 'Editor to inject into the created workspace. Must match a configured template.', + deprecated: { reason: 'Argument is not used', milestone: '17.5' } + argument :max_hours_before_termination, GraphQL::Types::Int, required: true, diff --git a/ee/app/graphql/types/remote_development/workspace_type.rb b/ee/app/graphql/types/remote_development/workspace_type.rb index c865eb93b069e2..6dd2846f7d12b3 100644 --- a/ee/app/graphql/types/remote_development/workspace_type.rb +++ b/ee/app/graphql/types/remote_development/workspace_type.rb @@ -46,6 +46,12 @@ class WorkspaceType < ::Types::BaseObject field :url, GraphQL::Types::String, null: false, description: 'URL of the workspace.' + # TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/498322 - Remove in 18.0 + field :editor, GraphQL::Types::String, + null: false, + description: 'Editor used to configure the workspace. Must match a configured template.', + deprecated: { reason: 'Field is not used', milestone: '17.5' } + field :max_hours_before_termination, GraphQL::Types::Int, null: false, description: 'Number of hours until the workspace automatically terminates.' -- GitLab From 890622dafd88c108be78f447864d4bd96c531306 Mon Sep 17 00:00:00 2001 From: Daniyal Arshad Date: Wed, 9 Oct 2024 15:47:33 -0400 Subject: [PATCH 3/3] Add editor back to graphql specs --- ee/app/graphql/types/remote_development/workspace_type.rb | 4 ++++ .../graphql/types/remote_development/workspace_type_spec.rb | 2 +- .../remote_development/workspace_operations/create_spec.rb | 1 + ee/spec/requests/remote_development/integration_spec.rb | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ee/app/graphql/types/remote_development/workspace_type.rb b/ee/app/graphql/types/remote_development/workspace_type.rb index 6dd2846f7d12b3..c1f0ca5356fa53 100644 --- a/ee/app/graphql/types/remote_development/workspace_type.rb +++ b/ee/app/graphql/types/remote_development/workspace_type.rb @@ -82,6 +82,10 @@ class WorkspaceType < ::Types::BaseObject def project_id "gid://gitlab/Project/#{object.project_id}" end + + def editor + 'webide' + end end end end diff --git a/ee/spec/graphql/types/remote_development/workspace_type_spec.rb b/ee/spec/graphql/types/remote_development/workspace_type_spec.rb index 15e0e63acda029..9faa5fe07aefb7 100644 --- a/ee/spec/graphql/types/remote_development/workspace_type_spec.rb +++ b/ee/spec/graphql/types/remote_development/workspace_type_spec.rb @@ -7,7 +7,7 @@ %i[ id cluster_agent project_id user name namespace max_hours_before_termination desired_state desired_state_updated_at actual_state responded_to_agent_at - url devfile_ref devfile_path devfile_web_url devfile processed_devfile + url editor devfile_ref devfile_path devfile_web_url devfile processed_devfile deployment_resource_version created_at updated_at ] end diff --git a/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/create_spec.rb b/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/create_spec.rb index d2857c40a76e2c..d1a7750708427f 100644 --- a/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/create_spec.rb +++ b/ee/spec/requests/api/graphql/mutations/remote_development/workspace_operations/create_spec.rb @@ -40,6 +40,7 @@ let(:all_mutation_args) do { desired_state: desired_state, + editor: 'webide', max_hours_before_termination: 24, cluster_agent_id: agent.to_global_id.to_s, project_id: workspace_project.to_global_id.to_s, diff --git a/ee/spec/requests/remote_development/integration_spec.rb b/ee/spec/requests/remote_development/integration_spec.rb index 140e3f7b6be7b0..8bc6bbecf64d46 100644 --- a/ee/spec/requests/remote_development/integration_spec.rb +++ b/ee/spec/requests/remote_development/integration_spec.rb @@ -258,6 +258,7 @@ def do_create_workspace(cluster_agent_id) def workspace_create_mutation_args(cluster_agent_id) { desired_state: RemoteDevelopment::WorkspaceOperations::States::RUNNING, + editor: "webide", max_hours_before_termination: 24, cluster_agent_id: cluster_agent_id, project_id: workspace_project.to_global_id.to_s, -- GitLab