BE: Add new query API to list workspace ports
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Work on this issue](https://contributors.gitlab.com/manage-issue?action=work&projectId=278964&issueIid=509820) - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=509820) </details> <!--IssueSummary end--> MR: Pending <!-- The first line of this issue description must be one of the following: 1. `MR: Pending` 2. `MR: <MR link with trailing +>`, 3. If there are multiple MRs: ``` MRs: - <MR 1 link with trailing +>` - <MR 2 link with trailing +>` - ... ``` 4. `MR: No MR` ...and the first description line of the MR should be `Issue: <Issue link with trailing +>` For more context, see: https://about.gitlab.com/handbook/engineering/development/dev/create/ide/index.html#relationship-of-issues-to-mrs --> <!-- The following sections should be filled out as part of the refinement process before the issue is prioritized. For more context, see: https://about.gitlab.com/handbook/engineering/development/dev/create/ide/#2-pre-iteration-planning-meeting --> ## Description We want to introduce a new graphQL type for workspace ports that contains all the fields introduced in the `workspaces_ports` table and add the relevant resolvers and connections to query the fields for this new type. ## Acceptance Criteria - [ ] New graphQL type for workspace_ports - [ ] Method to return access_url with the format `#{port_number}-#{workspace_name}.#{agent_dns_zone}` - [ ] New field for workspace_ports in the workspace type - [ ] New finder/resolver for workspace_ports field - [ ] GraphQL docs updated - [ ] Check [README](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/spec/requests/api/graphql/remote_development/README.md) for info on writing resolvers and specs - [ ] Add relevant request specs to the `ee/spec/requests/api/graphql/remote_development/workspace` folder - [ ] Add unit tests for finder - [ ] Update `tests.yml` and `scripts/verify-tff-mapping` - [ ] Read and update `ee/spec/requests/api/graphql/remote_development/README.md` - [ ] Update remote_development `integration_spec.rb` to test the new fields ## Technical Requirement **GraphQL changes** - `Type.workspace` | | name | type | |----- | ------ | ------ | | field | `workspacePorts` | `[WorkspacePort!]` | - `Type.workspacePort` | | name | type | | ------- | ------ | ------ | | field | `id` | `GlobalIDType[::RemoteDevelopment::WorkspacePort]` | | field | `portNumber` | `Int` | | field | `portType` | `Enum` [`default`,`user_defined`] | | field | `accessUrl` | `String` | | field | `createdAt` | `TimeType` | | field | `updatedAt` | `TimeType` | - Fields for the new Type should be marked `experimental` according to [mark-schema-items-as-experiments](https://docs.gitlab.com/ee/development/api_graphql_styleguide.html#mark-schema-items-as-experiments) <!-- Replace with other type, e.g. bug or maintenance, if appropriate --> <!-- Replace with other subtype if appropriate --> <!-- By default, all issues start in the unprioritized status. See https://handbook.gitlab.com/handbook/engineering/development/dev/create/remote-development/#-planning-process --> <!-- For simplicity and to avoid triage bot warnings about missing workflow labels, we will default to issues starting at the refinement phase -->
issue