Skip to content

How to handle non-canonical GitHub URLs (specifically w/r/t number of contributors) #26

@sfirke

Description

@sfirke

Conor's fix in #23 stopped the function get_num_contributors() from erroring, instead it returns NA. Say, for the package "tsDyn" whose url is http://github.com/MatthieuStigler/tsDyn/wiki. Conor writes:

You could recover the canonical URL, i.e. remove wiki but this would be wrong in a few cases where more than one package lives in the same github repo.

I accepted his PR which now returns NA, much better than erroring. But to his point about erring on the side of caution in case multiple packages live in the same GitHub repo - our other metrics don't care about that, e.g., when you run package_list_metrics("tsDyn") you get GitHub forks, stars, watchers.

So for consistency, should we update get_num_contributors() to check the canonical URL and return the number of contributors? I think it depends on whether we want to err on the side of providing data when there's a non-canonical URL (like tsDyn above) and accept that in rare cases where multiple CRAN packages share a GitHub repo, we're providing inaccurate results. (Which is what we do currently for all other GH-related metrics).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions