Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow .devfile.yaml #61

Closed
maxandersen opened this issue Jun 2, 2020 · 16 comments · Fixed by devfile/library#73
Closed

allow .devfile.yaml #61

maxandersen opened this issue Jun 2, 2020 · 16 comments · Fixed by devfile/library#73
Assignees
Labels
area/documentation Improvements or additions to documentation kind/enhancement New feature or request severity/P1 Issues that have a critical impact
Milestone

Comments

@maxandersen
Copy link

(not sure if this is part of kubernets-api for devfile but it should for sure be part of the devfile spec - let me know if any better place this issue)

originally opened at redhat-developer/odo#3126 and redhat-developer/odo#3126

Simply asking that .devfile.yaml should be allowed for the name of the devfile to allow it to be hidden by default and not take up "visual space" in projects that create these files.

@sbose78
Copy link

sbose78 commented Jun 7, 2020

Ack.

@metacosm
Copy link
Contributor

metacosm commented Jun 8, 2020

@maxandersen you linked to the same 2 issues… 😄
That said, I'm ambivalent on this since I'm not sure the devfile should be hidden as it's potentially an integral part of the project.

@l0rd
Copy link
Contributor

l0rd commented Jun 8, 2020

That's not strictly speaking something that will be transled in a change in the OpenAPI spec. And Che at least already allow .devfile.yaml if the file is specified explicitely but it doesn't automatically discover it (it discovers devfil.yaml).

But I agree that we may formalize that in the spec somehow: tools that supports the spec should automatically discover devfile.yaml and .devfile.yaml when a git repo or a local folder is provided.

@l0rd l0rd added the area/documentation Improvements or additions to documentation label Jun 8, 2020
@kadel
Copy link
Member

kadel commented Jun 8, 2020

But I agree that we may formalize that in the spec somehow: tools that supports the spec should automatically discover devfile.yaml and .devfile.yaml when a git repo or a local folder is provided.

If we formalize that than we need to also define that tools need to error out when both .devfile.yaml and devfile.yaml are present.

@l0rd
Copy link
Contributor

l0rd commented Jun 8, 2020

if we formalize that than we need to also define that tools need to error out when both .devfile.yaml and devfile.yaml are present.

Right. Or define a precedence order.

@kadel
Copy link
Member

kadel commented Jun 8, 2020

Right. Or define a precedence order.

That will just lead to a lot of confusion

Let's say that I have a project that uses .devfile.yaml

  • Someone doesn't notice that there already is .devfile.yaml and adds new devfile.yaml
  • Now there are two devfiles and each might be different.
  • If tooling just priorities devfile.yaml over .devfile.yaml the users that are used to editing .devfile.yaml will get confused about why their changes are not being reflected or vice versa.

This won't create a good user experience.
I think that erroring out in case of both devfile naming styles is present is the only way to make sure that there is no ambiguity or confusion.

@l0rd
Copy link
Contributor

l0rd commented Jun 8, 2020

I think that erroring out in case of both devfile naming styles is present is the only way to make sure that there is no ambiguity or confusion.

You convinced me 👍

@maxandersen
Copy link
Author

I would just print a warning rather than blocking users and error out.

But I'm fine either way.

@elsony
Copy link
Contributor

elsony commented Jun 10, 2020

@kadel How do you see odo create nodejs mynodename work with the existence of the .devfile.yaml in a project? We currently error out when the user has an devfile.yaml already exists in the project root. Do we error out with the existence of .devfile.yaml as well? Given that .devfile.yaml are not listed by default, will the user get confused on why component create failed in that case? Also, how do we handle odo create nodejs mynodename --downloadSource if the sample project contains a .devfile.yaml, do we skip copying the devfile.yaml from the stack in that case and just use .devfile.yaml?

@maxandersen
Copy link
Author

Treat it the same as if you had a devfile.yml.

@l0rd l0rd added severity/P1 Issues that have a critical impact kind/enhancement New feature or request labels Jun 24, 2020
@l0rd l0rd added this to the 2.0 milestone Jun 24, 2020
@kadel kadel modified the milestones: 2.0, 2.1 Jul 28, 2020
@gorkem
Copy link

gorkem commented Aug 5, 2020

I see a new PR on Che eclipse-che/che#17537

@rkratky
Copy link
Collaborator

rkratky commented Oct 15, 2020

@l0rd, what is the documentation tasks here (I see you added the area/documentation label)?

@l0rd
Copy link
Contributor

l0rd commented Oct 19, 2020

@rkratky probably adding a paragraph about that in the devfile author guide

@elsony
Copy link
Contributor

elsony commented Jan 5, 2021

Based on the discussions, we'll support the .devfile.yaml. If both devfile.yaml and .devfile.yaml exists, then the tools will error out and let the user know that both files exist. We treat it as an error instead of a warning is to avoid any potential confusion on the user.

From the spec perspective, we'll:

  1. add to the doc to specify this behaviour
  2. check if the common library accepts a path (instead of including the devfile.yaml itself), then the parser will error out if both the devfile.yaml and .devfile.yaml exists at the specified path

@elsony
Copy link
Contributor

elsony commented Feb 19, 2021

@maysunfaisal pointed out that the existing devfile library does not currently have limitations on the devfile file name as long as it has the .yaml extension. I think it is fine to keep it that way to provide flexibility on the library code.

Having said that, we still need to make changes to support this on the registry library/registry build tools. We currently have to find the location of the devfile when building the index.jsp as part of scanning through the list of stacks. So the index.jsp build tools will need to look for either devfile.yaml or .devfile.yaml and flag as an error on the stack if both files are found in the registry as part of the index.jsp generation that is being run as part of the registry build tools.

@GeekArthur Can you make the change on the registry index generator code?

@GeekArthur
Copy link
Contributor

@elsony Sure, I can do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Improvements or additions to documentation kind/enhancement New feature or request severity/P1 Issues that have a critical impact
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants