open-sauced / app

🍕 Insights into your entire open source ecosystem.
https://pizza.new
Apache License 2.0
410 stars 217 forks source link

Bug: Contributors chart displays NaN for Average per day while data is loading #3699

Closed nickytonline closed 1 month ago

nickytonline commented 2 months ago

The contributors chart displays NaN for Average per day while the data is loading. It seems to only happen for the 30 day range from what I can tell. And it only appears to happen while loading data. Once the data is loaded, it course corrects.

I cam across this while viewing https://app.opensauced.pizza/s/fabian-hiller/valibot

CleanShot 2024-07-09 at 08 54 21

github-actions[bot] commented 2 months ago

Thanks for the issue, our team will look into it as soon as possible! If you would like to work on this issue, please wait for us to decide if it's ready. The issue will be ready to work on once we remove the "needs triage" label.

To claim an issue that does not have the "needs triage" label, please leave a comment that says ".take". If you have any questions, please comment on this issue.

For full info on how to contribute, please check out our contributors guide.

jdegand commented 1 month ago

I don't believe this issue only happens from loading. For repos with no activity, you will get NaN for average per day.

BekahHW commented 1 month ago

I get this on the torvalds/linux repo page no matter what the time period is.

image

I think this is what should populate it:

image

I'm not totally sure how this works, but we're definitely returning contributors for the lottery factor, so I'm not sure why we wouldn't get anyone here.

bdougie commented 1 month ago

I get this on the torvalds/linux repo page no matter what the time period is.

Linux is mirror. All code happens off platform and not as GitHub pull requests. I am not sure we'd get events from it.

Wordpress, Linux, and other popular mirrored projects are good for testing but not great for examples or story telling.

BekahHW commented 1 month ago

@bdougie we are seeing PRs and contributors on the repo pages for linux:

image
jpmcb commented 1 month ago

Note that those PRs include opened PRs but not necessarily accepted ones: we may want to make the lottery factor only focused on accepted / closed PRs.


I also notice this on repos that don't have contributions:

Screenshot 2024-08-06 at 11 29 56 AM

It should just say "Average per week: 0" since there are no contributions accepted/merged.

ajitzero commented 1 month ago

Seeing this for angular/angular:

image

I visited this page directly from a link off LinkedIn.

geromegrignon commented 1 month ago

@brandonroberts it's about this code:

const rangedAverage = useMemo(
    () => (filteredTotal / (stats ? stats.contributors.length : 1)).toPrecision(2),
    [filteredTotal, stats]
  );

If filteredTotal and stats.contributors.length equal 0, it results 0/0, leading to the error.

brandonroberts commented 1 month ago

Thanks @geromegrignon!

open-sauced[bot] commented 1 month ago

:tada: This issue has been resolved in version 2.52.0-beta.8 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

open-sauced[bot] commented 4 weeks ago

:tada: This issue has been resolved in version 2.52.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: