-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get clean code_repository url from pypi "project_urls" data #1156
Comments
I went through and found every plugin with a malformed or no
|
I didn't realize we try to guess the Regarding when a |
Hmm thinking about this one more, it seems like we expect a very specific format for this field - It seems like we should at least validate the URL pattern in these cases - curious to get your thoughts @manasaV3 |
I agree. We could even parse the URL to remove anything outside of |
@manasaV3 That sounds good to me. I'm realizing that for both validating and cleaning there would be some edge cases, e.g. if someone were to provide a source code URL that's a github URL but something unrelated like https://github.com/orgs/chanzuckerberg/projects/12/views/26. But that seems unlikely & would still be better than current behavior. Regardless, let's plan to validate the URL to the best of our ability and then handle it the same way we do for null code repository values*. *This is what we currently display in that case, though I wonder if we would want to tweak the language slightly 🤔 |
Also, I'm marking this a P0 because it results in displaying inaccurate data for plugins. We should at the minimum not display the data at all if we don't have a correctly formatted URL, which validation should help with. cc @junxini for awareness |
With this issue, we have identified cases where a plugin could have a code_repository url but not have valid stats for maintenance due to several possibilities. To handle those cases, we need additional validation on the front end. Before rendering the visualizations for maintenance, we should verify 2 conditions.
If either of the 2 conditions is false, we should display the text copy to inform the user the commit history stats are unavailable, which is referenced in here. Reasoning: |
Removing P0 from this and tracking the bug itself in #1220 |
To get the code repository, we currently check if there is a
Source Code
field in theproject_urls
section of the PyPI response. In case theSource Code
field does not exist, we iterate through the URLs, and fetch the first one, which is a GitHub url. In those cases, we might fetch options that aren't the best fit.For example, look at the snippet below:
In here, the code repository, gets set as
"https://github.com/imagej/napari-imagej#README.md"
. This leads to incorrect fetching of data from gitHub.We should parse the url to remove any additional anchor tags, query parameter in the url for code repository.
Also, we should check if the
source
field exists in the project url before iterating over the urls in that section.The text was updated successfully, but these errors were encountered: