Skip to content

Commit

Permalink
Merge pull request #272 from DSACMS/sachin/avg-issue-fix
Browse files Browse the repository at this point in the history
Generating Graph Bug Fixes
  • Loading branch information
sachin-panayil authored Oct 22, 2024
2 parents 4fcd3d7 + 4f2330a commit df4aeb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions scripts/gen_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ def generate_solid_gauge_issue_graph(oss_entity):
oss_entity.metric_data['issues_count']
except ZeroDivisionError:
open_issue_percent = 0
except TypeError:
print("Repo has no issues")
return

issues_gauge.add(
'Open Issues', [{'value': open_issue_percent * 100, 'max_value': 100}])

Expand Down Expand Up @@ -586,8 +590,12 @@ def generate_average_issue_resolution_graph(oss_entity):
repo_name = data[0]
average_time_str = data[1]

days_str = average_time_str.split(' days ')
days = int(days_str[0])
if "days" in average_time_str:
days_str = average_time_str.split(' days ')
days = int(days_str[0])
else:
print("Average issue resolution time is less than a day")
return

gauge_graph.range = [0, round((days + 20))]

Expand Down
4 changes: 2 additions & 2 deletions templates/org_report_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ date_stampLastWeek: {date_stamp}
{{% render "graph-section" baseurl: site.baseurl, path: "/{repo_owner}/{repo_owner}_new_issues_by_day_over_last_six_months.svg", title: "New Issues over Last 6 Months" %}}
<!-- Top Committers Bar Graph -->
{{% render "graph-section" baseurl: site.baseurl, path: "/{repo_owner}/{repo_owner}_top_committers.svg", title: "Top Committers" %}}
<!-- Top Committers Bar Graph -->
{{% render "graph-section" baseurl: site.baseurl, path: "/{repo_owner}/{repo_owner}_libyear_timeline.svg", title: "Top Committers" %}}
<!-- Libyear Timeline Graph -->
{{% render "graph-section" baseurl: site.baseurl, path: "/{repo_owner}/{repo_owner}_libyear_timeline.svg", title: "Dependency Libyears" %}}
</div>
</div>

0 comments on commit df4aeb9

Please sign in to comment.