Skip to content

Support .yml extension #1265

Closed
@feloy

Description

@feloy

/kind user-story

Which area this user story is related to?

/area library

User Story

As a library consumer, I want the Devfile parser to support Devfile with .yml extension for a Devfile, So that my users can provide a devfile.yml, which is also commonly used for YAML files (even if .yaml is preferred and recommended).

Ideally, the Devfile parser should not make any assumptions about the file name it is provided. It should be able to parse any file path provided.
Currently, trying to parse a devfile.yml file returns the error below. It looks like the parser interprets /path/to/devfile.yml as a folder, as it looks for a /path/to/devfile.yml/devfile.yaml file, which does not exist:

☸ in ~/w/p/d/library on  main [$] via 🐹 v1.19.6 
$ ./main /path/to/devfile.yml
parsing devfile from /path/to/devfile.yml
failed to populateAndParseDevfile: failed to read devfile from path '/path/to/devfile.yml/devfile.yaml': open /path/to/devfile.yml/devfile.yaml: not a directory

Acceptance Criteria

  • It should support any file name - Clarify devfile placement and filename #1035 (comment)
    • If passed a path to a file, the library should not make any assumption about the file names. It should be able to parse any file provided and return an error if it is not a valid Devfile.
    • If variants of them are present in the same directory, the .yaml one has priority (in places where library is discovering a Devfile)
  • After this item is done, we'll need other tools, e.g. odo, ODC, and RHTAP, to start supporting .yml extensions. => check that the change does not break current clients
  • It should update any relevant documentation to reflect the changes
  • Demo required

Notes

#1035 (comment)

Links

Metadata

Metadata

Assignees

Labels

area/libraryCommon devfile library for interacting with devfilesdemoIssue or PR candidate for a demo at the end of the Sprintkind/user-storyUser story for new enhancement

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions