Closed isuftin closed 1 month ago
@isuftin could you please try replacing the projects
with starterProjects
in the parent devfile?
@ibuziuk - Unfortunately, an issue we're seeing with OpenShift DevSpaces is when we use starterProjects
instead of projects
, the parent's project under starterProjects
does not get checked out (good, I guess) but also none of the commands from the parent get inherited in the flattened devfile and they don't appear in the Terminal -> Tasks -> Devfile menu. It's an issue we're working through with RedHat but this also means that at least for the time being we're stuck using projects
in the parent.
@isuftin For Dev Spaces I would recommend opening JIRA for Red Hat https://issues.redhat.com/browse/ Eclipse Che tracker is used for upstream issues only.
But, to answer the question "Using parent devfile, only want one project checked out - Is it possible?". Have you considered having a parent without projects at all e.g. smth like https://registry.devfile.io/viewer/devfiles/community/udi ? after that you can do smth. like this in child - https://github.com/che-incubator/quarkus-api-example/pull/40/files
NOTE: it is not needed to specify projects
/ starter-projects
in general as long as devfile is part of the repository (which is the recommended aproach)
@ibuziuk - We do have a ticket open w/ RedHat and are poking around for a solution. I figured I'd ask here first.
But, to answer the question "Using parent devfile, only want one project checked out - Is it possible?". Have you considered having a parent without projects at all e.g. smth like https://registry.devfile.io/viewer/devfiles/community/udi ? after that you can do smth. like this in child - https://github.com/che-incubator/quarkus-api-example/pull/40/files
That's what we ended up doing. But because these devfiles are meant to be 'starter' workspaces, I was hoping I could get the projects that are checked out by default to be checked out from the development branch. But because the workspace starts from the dashboard sample grid link, the dashboard sample points to devfiles in the main
branch of the associated projects. Furthermore, we were hoping that developers, when they use the devfile as an example in their own projects, they could have just overridden the projects
portion in their own devfile.
So right now we have these workspaces opened up with the project checked out from the main
branch.
Not a big deal but was hoping there was a good solution to this.
Thanks for the back and forth!
Summary
We are trying to provide a sample workspace dashboard for our users. We want to have a workspace for the sample dashboard items with certain projects checked out using the development branch. We also want to use a parent devfile which defines a container component, a project and 1..n commands. In the child project we want to override the container component, add commands as well as specify a different project to check out.
The goal here is to give users enough of a head start so they can easily copy the devfile into their projects and change what they need.
Everything works great except in the resulting workspace, we have two projects checked out with the same code from two different branches.
Parent devfile:
Child devfile:
So what we end up with here is two projects checked out.
starter-workspace
checked out and on the development branch (good) and then alsoaws-developer-workspace
checked out to the main branch (bad). This is probably happening because by default, if a devfile doesn't specify a project, DevSpaces will check out the project/branch that includes the devfile the workspace was created from.If we also define
projects
in the child devfile and name itaws-developer-workspace
but specify the development branch, DevSpaces opens a workspace with two projects, both checked out to the development branch of theaws-developer-workspace
project. The names arestarter-workspace
andaws-developer-workspace
Great, but we really only want one project checked out in the workspace.I've also tried setting the
projects
parameter in the parent to an empty array with no luck.I wonder if there's actually a way to achieve what we're going for?
This is being done on RH OpenShift DevSpaces 3.16.1 using the DevWorkspace Operator 0.31.0
Relevant information
No response