Use default devfile with golden image to create workspace if no devfile is present
Issue - Backend: Use default devfile with golden image ... (#474986 - closed)
What does this MR do and why?
As per the plan in Provide default devfile for projects if not pre... (&14644 - closed) , use default devfile with golden image to create workspace if no .devfile.yaml
is present in the root of the repository.
References
Epic here Provide default devfile for projects if not pre... (&14644 - closed)
MR acceptance checklist
-
DB migration to make devfile_path
nullable -
Update devfile_fetcher.rb
to take in default devfile is needed -
Rename devfile_ref
toproject_ref
in the DB and the GraphQL and the codebase. -
Add a new settings in the settings module for default_devfile
.
Screenshots or screen recordings
Below test scenarios are all with code changes
How to set up and validate locally
- Setup workspaces locally following this guide
- Navigate to
http://gdk.test:3000/-/graphql-explorer
- Also find your local correct project id and agent id for the use in the graphql query
- Execute queries in above screenshot, one example is provided below.
- Verify results as expected, and also try other different params.
mutation workspaceCreate {
workspaceCreate(
input: {
projectId: "gid://gitlab/Project/3",
clusterAgentId: "gid://gitlab/Clusters::Agent/10",
desiredState: "Running",
devfileRef: "main-invalid",
projectRef: "main",
devfilePath: null,
maxHoursBeforeTermination: 24,
variables: []}
) {
workspace {
id
projectRef
devfileRef
devfilePath
devfile
}
errors
}
}
Edited by Chad Woolley