gojp / goreportcard

A report card for your Go application
https://goreportcard.com
Apache License 2.0
2.01k stars 249 forks source link

There was an error processing your request: Could not analyze the repository: no .go files found #359

Closed AchoArnold closed 3 years ago

AchoArnold commented 3 years ago

The repository has .go files all over. https://github.com/NdoleStudio/flutterwave-go

What am I doing wrongly?

image

kozgot commented 3 years ago

I have the same error for my repository. image

For me, the report card was working originally without a problem as you can see on the screenshot (Last refresh: 1 week ago), but last Wednesday (17/11/2021) I could not refresh it because of this error, and it has not been fixed since. I have not changed anything in my repo or code that would cause this behaviour. The cli tool works just fine for me: image

YashdalfTheGray commented 3 years ago

This could potentially be related to #357, have you switched your branch name recently? I think that's the problem that I'm having.

https://goreportcard.com/report/github.com/YashdalfTheGray/colorcode

kozgot commented 3 years ago

No, I have not switched my branch name.

shawnps commented 3 years ago

@kozgot I believe your issue may be because there's no go.mod in the root of your repo.

The other issues are likely due to a case-sensitivity bug (try https://proxy.golang.org/github.com/YashdalfTheGray/colorcode/@latest vs https://proxy.golang.org/github.com/yashdalfthegray/colorcode/@latest and you can see it) I'm investigating but unfortunately can't guarantee when it will be fixed.

shawnps commented 3 years ago

@AchoArnold @YashdalfTheGray your repos seem to be working now, let me know if you notice any more issues 👍

kozgot commented 3 years ago

@shawnps, yes because this repository contains the code of 3 individual microservices, so the go.mod files are in subdirectories, however as I wrote before, the issue only occured about a week ago, before that everything worked fine. And the cli tool also works fine currently, and I have not changed the project structure, so I do not see any reason as to why this error appeared out of nowhere.

shawnps commented 3 years ago

@kozgot we're now using proxy.golang.org to download the latest module (as of about a week ago) rather than git cloning, which likely explains it.

kozgot commented 3 years ago

@shawnps Can you recommend a way to make it work again? This is a university project for me, and the due date is very close now, so I really do not want to split the code into multiple repos.

shawnps commented 3 years ago

@kozgot would go mod init github.com/kozgot/go-log-processing in the root not work?

YashdalfTheGray commented 3 years ago

@AchoArnold @YashdalfTheGray your repos seem to be working now, let me know if you notice any more issues 👍

Yay! Thanks! Out of curiosity, what was the issue? No worries if you don't have time to get into it and sorry for interrupting the conversation flow.

shawnps commented 3 years ago

@YashdalfTheGray no worries!

The issue was: we used to use git to pull down repositories and run the checks. But we recently switched to downloading .zip files containing the module contents from proxy.golang.org.

proxy.golang.org rejects module names with uppercase letters (see the links I posted in https://github.com/gojp/goreportcard/issues/359#issuecomment-974795724). So we just needed to lowercase the module name before requesting the module contents from the proxy.

Hope that helps 👍

kozgot commented 3 years ago

@shawnps I did not have the time to look into it yet, but certainly will. Thank you for the suggestion.

shawnps commented 3 years ago

@kozgot sure, let me know how it goes.

AchoArnold commented 3 years ago

Its all good from my end. Can i close the ticket?

shawnps commented 3 years ago

@AchoArnold sure, thanks for reporting 👍

TomiwaAribisala-git commented 1 year ago

Hello, @shawnps @hermanschaaf apologies for opening up this issue, I am having a similar problem generating a GoReportCard for KubeArmor project, i must point out that the root source code does not have a go.mod file--going forward i intend to do go mod init https://github.com/kubearmor/KubeArmor in the root as indicated in your comment and see if i can generate a report card.

Also i checked the project repo via proxy.golang.org using lowercaseletters(https://github.com/kubearmor/kubearmor), the picture output was generated below: download

I await your favorable response, thanks

shawnps commented 1 year ago

@TomiwaAribisala-git sorry for the late response.

Go Report Card downloads .zip files of source code from proxy.golang.org.

If you download this file:

http://proxy.golang.org/github.com/kubearmor/kubearmor/@v/v1.0.3.zip

You'll notice that there are no .go files.

I'm not sure why that's happening (maybe like you said because there's no go.mod file in the root), but that would be why GRC returns an error.