Azure / draft-classic

A tool for developers to create cloud-native applications on Kubernetes.
https://draft.sh
MIT License
3.92k stars 395 forks source link

ASP.NET 2.0 doesn't work #484

Closed rspaulino closed 6 years ago

rspaulino commented 6 years ago

Hi,

I'm a lil confuse because when I see the changelog of v0.9.0 it mention "bumps the ASP.NET pack to 2.0" so I'm assuming that draft would work with asp.net core 2.0 but when I ran a simple new projects.

dotnet new mvc

and then ran

draft create --debug

I get the following result:

Error: <nil> 
DEBU[0000] JSON:    90.361723 ()                           
DEBU[0000] SVG: 6.544119 ()                             
DEBU[0000] C#:  2.343193 (#178600)                       
DEBU[0000] XML: 0.613372 ()                             
DEBU[0000] CSS: 0.109026 (#563d7c)                      
DEBU[0000] JavaScript:  0.028566 (#f1e05a)               
--> Draft detected the primary language as JSON with 90.361723% certainty.
Error: Could not find a pack Q_Q

is there any flag I can pass to force the language detection to just take my word that it's asp.net? I try playing around with the linguist's .gitattributes support but didn't have much luck, even try *.csproj linguist-language=csharp so this in one of the issues.

but anyways if anyone could help me on how to get this going, right now I run the command manually to compile and deploy but was looking to simplify the process like it show in the tutorial videos.

Thanks in advance.

bacongobbler commented 6 years ago

Hey! Gitattributes support was only recently merged so you’ll have to try one of the canary builds in order for that to work. :)

There’s a similar ticket via https://github.com/Azure/draft/issues/476 that poses an interesting solution. How does that idea sound to you as a feature?

rspaulino commented 6 years ago

@bacongobbler Thanks for you rapid response.

Is asp.net 2.0 supported in draft v0.9.0? and just so I'm clear, in the latest release:

v0.9.0 adds a Swift pack, bumps the ASP.NET pack to 2.0 and added .gitattributes support to draft create to override the language detection handled with github linguist.

Do you mean this particular attribute is in canary "*.csproj linguist-language=csharp" or all .gitattributes were not release with v0.9.0

as for #476 the only issue I can see if that for example in .net you can have SPA project which have .js & .cs technically .js is more popular but creating chart for .js from actually run the project correctly.

jstrachan commented 6 years ago

I wonder if we need a weighting on languages too; e.g. the presence of a pom.xml for Java should outweigh however much .js and .java. I don't know ASP.NET terribly well but I wonder if a .csproj file could be weighted higher than .js and .cs in the same way?

i.e. treat language specific build configuration tools (maven / gradle / .net / npm et al) as higher priority to general purpose language files?

bacongobbler commented 6 years ago

I wonder if we need a weighting on languages too

That would be a good feature request. Right now pkg/linguist trains the bayesian classifier against sample projects. It might also be good to supply feature weights to the naive bayesian classifier. If anyone's interested in getting involved with naive bayesian classifiers, that would be a great starter project.

rspaulino commented 6 years ago

@jstrachan I agree with you. In ASP.NET or .NET we use solutions (.sln) or projects(C# .csproj), the only time I see .cs individual file is for script purposes.

I find a way around this and it's using --pack

draft create --pack=csharp

In my case draft was looking for the pack in /usr/local/etc/draft/packs/

so I have to go to /usr/local/etc/draft/packs/github.com/Azure/draft/packs and move the csharp in the location above now it work perfect or at least more than the default, I haven't test it with complex apps but it should work.

bacongobbler commented 6 years ago

this issue was fixed by proxy via #499. Give v0.14.1 a go and see how it works! Thanks. :)