-
Notifications
You must be signed in to change notification settings - Fork 17
odo/alizer reports wrong devfile #105
Comments
List of NodeJS stacks supported by the registry:
|
Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
* feat: add detection for multiple js frameworks (#105) Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * add vue detection Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * add tests for angular Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * add tests for nextjs Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * add tests for nuxtjs Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * add tests for svelte Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * extend port detection for dev script for next and nuxt frameworks Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * add tests for vue Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * rename method Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * fix test in java Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * fix java test Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * add detection from config file for nuxt and vue Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * fix copyright dates Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * update port detection doc Signed-off-by: Luca Stocchi <lstocchi@redhat.com> * add js frameworks to alizer-spec doc Signed-off-by: Luca Stocchi <lstocchi@redhat.com> Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
We ( I wanted to see if I could close the original issue in odo (redhat-developer/odo#6210), but noticed that the output was different this time. With
Am I missing something? I tried using the Alizer Go CLI and I have the same output:
And below is the output of alizer analyze .[
{
"Name": "TypeScript",
"Aliases": [
"ts"
],
"Weight": 81.25,
"Frameworks": [
"Express"
],
"Tools": [
"NodeJs",
"Node.js"
],
"CanBeComponent": true
},
{
"Name": "Shell",
"Aliases": [
"sh",
"shell-script",
"bash",
"zsh"
],
"Weight": 6.25,
"Frameworks": [],
"Tools": [],
"CanBeComponent": false
},
{
"Name": "JavaScript",
"Aliases": [
"js",
"node",
"nodejs"
],
"Weight": 6.25,
"Frameworks": [
"Express"
],
"Tools": [
"NodeJs",
"Node.js"
],
"CanBeComponent": true
},
{
"Name": "Batchfile",
"Aliases": [
"bat",
"batch",
"dosbatch",
"winbatch"
],
"Weight": 3.1199999999999997,
"Frameworks": [],
"Tools": [],
"CanBeComponent": false
},
{
"Name": "Java",
"Aliases": null,
"Weight": 3.1199999999999997,
"Frameworks": [],
"Tools": [
"Maven"
],
"CanBeComponent": true
}
] |
They change a few metadata on the registry so maybe alizer needs an update as well |
Hey @rm3l , When you asks for a devfile to alizer, it takes the path to start the search from (in your case the project root), if a component is detected there, it uses those infos to pick a devfile. Did you expect something different? What would you like to see as an output? |
The origin issue was running on the sub folder that was an Angular app if I remember correctly |
in this case it has a |
Thanks for the explanations, @lstocchi ! Yes, I was trying to reproduce the original issue reported by @jeffmaury by running |
Don't know why they have an (almost empty) pom.xml but code analysis should lead us to nodejs |
@rm3l when alizer finds multiple languages/frameworks it tries to give priority to the devfile that has a higher weight calculated in terms of frameworks/tools supported. e.g if it finds that the app is a golang (no framework)/nodejs (express), it picks nodejs express devfile if available as it is considered more valuable (in simple words Alizer gives points based on the feature detected... a framework is detected -> +10 points, a tool is detected -> +5 and so on, the devfile with the higher points at the end, wins). Thinking about what i wrote above, in this case, typescript should be returned as it has a framework (express) and a tool (nodejs) while java only a tool (maven). Should i detect a framework in the cc @kadel to hear his opinion |
Thanks again for the clarifications. I better understand how Alizer works now.
I currently have my odo configured to use the staging Devfile registry at https://registry.stage.devfile.io/, and I see the Node.JS Devfile has at least the "Express" tag.
So is the Weight field in the alizer analyze output supposed to take into account what you mentioned above? Because even without considering devDependencies, it should have picked nodejs (like before the update) because it seems to have a higher Weight (6.25) than maven (3.11999...), no? |
Ok then there is an issue in alizer. It should have picked this one. Just opened this issue #114 to investigate more about it . I'll let you know asap
No that |
Okay, I see. Thanks, @lstocchi ! |
I think that Alizer should look into |
When using odo 3.0.0-rc2 against https://github.com/quarkusio/quarkus-super-heroes/tree/main/ui-super-heroes,
odo init
proposes theNodeJS
devfile where it should report theAngular
devfile.Please note that odo uses
SelectDevFileFromTypes
and that the Alizer go cli reports corrects info with theanalyze
command but nodejs with thedevfile
commandThe text was updated successfully, but these errors were encountered: