BE: Add mutation APIs for workspace ports
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
MR: Pending
Description
As a pre-requisite to enable management of ports through a VSCode extension from within a workspace we want to introduce the following mutations:
- Mutation for creating a new
workspace_ports
record - Mutation for removing an existing record
Acceptance Criteria
-
Add new create/remove APIs for workspace ports -
Add a new field in the WorkspaceCreate mutation to return workspace ports -
New mutations mounted in ee/app/graphql/ee/types/mutation_type.rb
-
Add remote development domain logic modules to handle mutation requests -
Add new policy for workspace ports to allow create/delete with workspace level authorization rules -
GraphQL docs updated -
Add unit tests for each new class -
Update remote_development integration_spec.rb
to test the new mutations
Technical Requirement
GraphQL changes
-
Mutation.workspaceCreate
name type field workspacePorts
[WorkspacePort!]
-
Mutation.workspaceAddPort
:name type argument portNumber
Int
argument workspaceId
GlobalIDType[::RemoteDevelopment::Workspace]
field workspacePort
WorkspacePort
All ports added with this mutation should have
port_type
set asuser_defined
-
Mutation.workspaceRemovePort
:name type argument portNumber
Int
argument workspaceId
GlobalIDType[::RemoteDevelopment::Workspace]
Only
user_defined
ports should be removed with this mutation
Authorization Policy
- Policy should have workspace level authorization rules
Edited by 🤖 GitLab Bot 🤖