chanzuckerberg/napari-hub

Inaccurate maintenance data displayed for certain plugins

Closed this issue ยท 3 comments

Note: There has been some discussion in #1156 regarding this issue, but I wanted to create the actual bug report and clarify the desired behavior.

Bug

Several plugins show either an incomplete number of commits, or zero commits, when we in fact are not able to fetch data for the plugin. Reasons for this may vary, but could be due to the repo being private/removed/renamed, or the repo URL not being of a valid form. Impacted plugins include:
https://www.napari-hub.org/plugins/recOrder-napari
https://www.napari-hub.org/plugins/allencell-ml-segmenter
https://www.napari-hub.org/plugins/napari-bud-cell-segmenter
https://www.napari-hub.org/plugins/napari-stl-exporter
https://www.napari-hub.org/plugins/napari-indices
https://www.napari-hub.org/plugins/napari-laptrack
https://www.napari-hub.org/plugins/napari-imagej
https://www.napari-hub.org/plugins/napari-data-preview
https://www.napari-hub.org/plugins/misic-napari

Explanation for bug

Currently, we validate the user data provided for the code_repository field by checking whether it is null or has a non-github value. However, we do not validate the field if it is a github URL, e.g. we allow values like https://github.com/imagej/napari-imagej#README.md and https://github.com/mehta-lab/recOrder/tree/main/recOrder. And, even if it is in valid form, we do not check if it's private or exists under that name. As a result, we are unable to fetch commits data for these, and then incorrectly display that there is no commit activity for these plugins, instead of displaying a more informative message that we were unable to fetch data for those plugins.

Desired behavior

We should display a more informative message, similar to (or the same as?) our existing "Metrics not available" message, instead of displaying commit counts that are inaccurate. @Janeece maybe you could provide a suggestion on how best to update the copy? Something like "Metrics not available, this plugin does not have a code repository specified, the repository is not on GitHub, or the repository was not found based on the value provided"?

Possible solution

We should do an additional validation check before displaying maintenance data to account for the above issues. Note that for https://www.napari-hub.org/plugins/napari-bud-cell-segmenter, it was likely once a public repo as we have some data fetched for it, but now the repo is not found and may be private (or removed). Given that, it may be best to check a value we already fetch on the frontend (e.g. checking if the repo's date created is null or not), rather than relying on the data stored in snowflake (which is different from the suggestion in #1156 (comment)).

cc @codemonkey800 @manasaV3 @junxini

It looks like #1221 resolved all of the cases outlined above on staging, except for recOrder-napari (https://staging.napari-hub.org/plugins/recOrder-napari). For that one, it seems we would need to do one of the checks outlined in #1156 (comment) (e.g. check if the latest_commit_timestamp is null) since we're retrieving a repo date but it doesn't point to the repo location we expect it to. I will sync with @codemonkey800 on this.

Update: #1223 addresses the remaining edge case outlined in the above comment ๐Ÿ™Œ๐Ÿฝ

Chatted with @Janeece and we agreed it makes sense to update the empty stats language to "Metrics not available, this plugin may not have a valid code repository specified or the repository is not on GitHub." (bolded to highlight the changes, won't be formatted like that)

I'll open up a PR for that.