Skip to content

Allow selection of devfile ref/path from workspace create/update Vue UI

MR: Allow selection of devfile ref/path from worksp... (!144376 - merged)

Description

As a Workspace user, I want be able to specify that my devfile is located in any ref or path of the project repo, so that I can:

  1. Use existing repos with the devfile at an arbitrary path
  2. Use monorepo projects which may have multiple devfiles at different paths
  3. Point to a devfile on a specified branch or tag (AKA ref), if the current version of the devfile on the default (main/master) branch is not usable by me for some reason.

Acceptance Criteria

  • UI allows specifying a project ref (branch OR tag) when creating a Workspace
  • UI lets users specify a devfile path when creating a workspace
  • UI shows error feedback if workspace creation fails due to missing or invalid devfile (so user can troubleshoot)
  • UI shows relative devfile path for each workspace on the Workspaces page
  • Specified ref should also be used when cloning the code into the workspace - see https://gitlab.com/gitlab-org/gitlab/blob/c35e385bbbb0052e8ff225d74e94eb2c6cf76c57/ee/lib/remote_development/workspaces/create/project_cloner_component_injector.rb#L28
  • Optional Stretch Goal Also allow a SHA to be specified as the ref. This will allow users with only read access to the repo (i.e. cannot create a branch or tag) to still point to a stable known-good version of a devfile if the default branch version doesn't work for some reason.
  • The workspace is created using the devfile from the specified path/ref
  • The repository is cloned from the specified ref
  • If not specified, the default devfile location will still remain .devfile.yaml in the root on the default branch.
  • Update create a workspace documentation

Technical Requirements

Ref

We need to specify the ref argument to the blobs field in the getProjectDetails query on the frontend and pass this to the backend.

There should be little or no backend changes needed, we've already thought ahead and the devfile_ref field exists in the workspaces table.

Path

Same for path, we just need to capture it on the frontend and pass it to the backend.

Design Requirements

See the design section for latest mockups. Full details in Figma design specs.

Proposed change summary:

  • Add ability to specify Devfile location. Reuses the branch/tag selector from the Find File component and a standard text input for the path (everything inline).
  • Reword termination field from Time before automatic termination to Workspace automatically terminates after to be obvious about what's being terminated.
  • Links to documentation in workspace description and devfile help icon.
  • Error states: Invalid devfile or can't find devfile.
    • Need to confirm if there's other error cases and if we can even determine the error cause.
    • Note: since the path is manually entered it could be frustrating to a user if the error is too generic and the error is caused by something else.
  • nice to have: in field validation when there's a problem with a devfile. I'm not sure if it's possible to validate this at the field level.

TODO: We will need to do some design on this issue, that should be all that is left for refinement. We just need to add a couple of fields for the ref and path. We can decide how complicated we want to make it - they could just be text fields which default to main and .devfile.yaml. That’s probably best for the first iteration.

Impact Assessment

Allows users more flexibility and options when using the Workspaces feature.

Edited by Chad Woolley