odo icon indicating copy to clipboard operation
odo copied to clipboard

Better default for component name (`odo init`/`odo dev`)

Open kadel opened this issue 3 years ago • 4 comments

/kind user-story

User Story

As an odo user working Java or NodeJS project I've already defined my project name in pom.xml or package.json file I want odo to suggest a default name that is based on the name that I already defined. So that I don't have to type it again.

This is about ? Enter component name: question in initial flow in odo init and odo dev

Acceptance Criteria

  • [ ] if package.json exists the suggested default component name should be value of the name field from package.json;
  • [ ] if pom.xml exists the suggested default component name should be value of the artifactId field from pom.xml
  • [ ] if non of the previous rules was applied use the name of the current directory as a default component name.
  • [ ] in all cases the name needs to be sanitized to make sure that it is always valid based on the allowed format for devfile's metadata.name

/priority medium

/kind user-story

kadel avatar Jun 20 '22 14:06 kadel

The logic for detecting the project name should be implemented in Alizer. Alizer should be the main place where we put all the logic to detect information from the projects source code

kadel avatar Jun 21 '22 11:06 kadel

/status blocked https://github.com/redhat-developer/alizer/issues/96

kadel avatar Jun 21 '22 11:06 kadel

redhat-developer/alizer#96

Issue resolved.

valaparthvi avatar Jul 14 '22 10:07 valaparthvi

For unsupported projects, alizer will return the directory name.

valaparthvi avatar Jul 14 '22 12:07 valaparthvi