Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Add parent forks to download counts #73

Merged
merged 1 commit into from
Aug 30, 2018

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Aug 29, 2018

Background

GitHub makes it easy to "fork" a project, and many KSP mods have changed ownership by way of new maintainers working on new forks. When this happens, we change the $kref value to point to the new fork.

Problem

As noted in #67, only the current fork is included in the download counts. If an older fork had a lot of downloads, our download count number will not represent the true number of downloads for that mod.

Changes

Now we check whether each GitHub repo has a parent fork. If so, then we add its download count to the mod's overall count, and so on until we reach the original fork. This will include more "historical" downloads in the count.

Caveat: If a mod has been hosted in a series of forks that do not have a (grand...-)parent relationship with the current fork, then some of their downloads still will not be counted. For example:

  • Original fork (will be counted)
    • Old sibling fork (will not be counted)
    • Currently active fork (will be counted)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 91.667% when pulling 434969b on HebaruSan:feature/count-parent-forks into 051c7bf on KSP-CKAN:master.

Copy link
Member

@techman83 techman83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙂

@techman83 techman83 merged commit 2a8523e into KSP-CKAN:master Aug 30, 2018
@HebaruSan HebaruSan deleted the feature/count-parent-forks branch August 30, 2018 03:27
@yalov
Copy link

yalov commented Dec 24, 2018

How to exclude new mod from the base one, counting the base downloads in the new one?

User can't fork their own repo. What if I create new user, make double forking and then delete repo in the middle?

@HebaruSan
Copy link
Member Author

Huh?

@yalov
Copy link

yalov commented Dec 24, 2018

oh, you can't fork a someone's fork of your repo....

In short, I will exclude from the commnet-antennas-extension its plugin part, as the forum poll requests.
Also, I don't want to lose the counter for the new plugin mod. Can I do it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants