ossf / criticality_score

Gives criticality score for an open source project
Apache License 2.0
1.33k stars 119 forks source link

Script gets stuck when "get_stats_commit_activity" response is 202 #88

Closed coni2k closed 1 year ago

coni2k commented 3 years ago

The script gets stuck with the following repos:

python -u -m criticality_score.run --repo https://github.com/chromium/chromium
python -u -m criticality_score.run --repo https://github.com/WebKit/WebKit-http
python -u -m criticality_score.run --repo https://github.com/JetBrains/MPS
python -u -m criticality_score.run --repo https://github.com/mozilla/gecko-dev
python -u -m criticality_score.run --repo https://github.com/Asoul/tsec
python -u -m criticality_score.run --repo https://github.com/google/mozc
python -u -m criticality_score.run --repo https://github.com/jlippold/tweakCompatible
python -u -m criticality_score.run --repo https://github.com/Katee/git-bomb
python -u -m criticality_score.run --repo https://github.com/mandatoryprogrammer/TLDR
python -u -m criticality_score.run --repo https://github.com/stevenliuyi/covid19
python -u -m criticality_score.run --repo https://github.com/zapret-info/z-i

The problem is in PyGitHub package. When we call get_stats_commit_activity, GitHub API returns an empty response with 202 code. PyGitHub, for some reason, when the response is 202, does a retry and gets into a loop: https://github.com/PyGithub/PyGithub/issues/1862

Let's see whether they can address this. Else, we might want to add a timer to prevent waiting?

Another detail is that some of these repos actually have commits in the last year. Probably GitHub API somehow fails to calculate? https://github.com/chromium/chromium https://github.com/WebKit/WebKit-http https://github.com/JetBrains/MPS https://github.com/mozilla/gecko-dev https://github.com/google/mozc https://github.com/jlippold/tweakCompatible https://github.com/stevenliuyi/covid19 https://github.com/zapret-info/z-i

calebbrown commented 1 year ago

The new Go based implementation does get stuck on these responses.

e.g:

$ go run ./cmd/criticality_score -depsdev-disable https://github.com/google/mozc
repo.url: https://github.com/google/mozc
repo.language: C++
repo.license: BSD 3-Clause "New" or "Revised" License
repo.star_count: 1170
repo.created_at: 2010-05-10T12:05:41Z
repo.updated_at: 2022-11-24T02:57:57Z
legacy.created_since: 152
legacy.updated_since: 0
legacy.contributor_count: 36
legacy.org_count: 3
legacy.commit_frequency: 10.15
legacy.recent_release_count: 0
legacy.updated_issues_count: 283
legacy.closed_issues_count: 233
legacy.issue_comment_frequency: 1.92
legacy.github_mention_count: 213
default_score: 0.53631