8000 Handle get_tags exception by coni2k · Pull Request #87 · ossf/criticality_score · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handle get_tags exception #87

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

Merged
merged 2 commits into from
Mar 1, 2021

Conversation

coni2k
Copy link
Contributor
@coni2k coni2k commented Feb 28, 2021

When we request get_tags for this repo, GitHub API throws an exception (interestingly, this was the only repo that was persistent in throwing an exception):
https://github.com/hortonworks/cloudbreak

python -u -m criticality_score.run --repo github.com/hortonworks/cloudbreak

It has 8,707 tags, so probably that's a large number for the API to process.

The only detail is that in catch block of "contributors", you return "10" as a default value. Should I set a similar default value for tags as well?

try:
total_tags = self._repo.get_tags().totalCount
except Exception:
logger.error(f'get_tags is failed: {self._repo.url}')
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment that this failure is usually due to large number of tags.
Also, i think we should default to 26, or whatever that constant for max release count is (use constant from that file). this just means we default to max threshold which is equivalent to having any value larger than it (since it caps it).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, added the comment: # Very large number of tags, i.e. 5000+. Cap at 26.
And returning RECENT_RELEASES_THRESHOLD as the default value

- Return default value
@inferno-chromium inferno-chromium marked this pull request as ready for review March 1, 2021 01:53
@inferno-chromium inferno-chromium merged commit c3f5481 into ossf:main Mar 1, 2021
@coni2k coni2k deleted the handle_get_tags_exception branch March 6, 2021 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0