Skip to content

Commit e6afe5f

Browse files
authored
more dev reports infrastructure (#11997)
1 parent 5bc2190 commit e6afe5f

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

tools/dev_reports/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.PHONY:
2+
3+
dev-activity: check_steering_committee.py
4+
python check_steering_committee.py
5+
6+
unacknowledged-bugs: unacknowledged-bug-reports.jq bug-reports-12-to-2-months-old.json
7+
@jq -f unacknowledged-bug-reports.jq bug-reports-12-to-2-months-old.json
8+
9+
bug-reports-12-to-2-months-old.json:
10+
@echo "Querying GitHub REST API..."
11+
@gh issue list \
12+
-l bug \
13+
--json state,number,title,createdAt,comments > bug-reports-12-to-2-months-old.json
14+
15+
clean:
16+
@rm bug-reports-12-to-2-months-old.json || true
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Processor for `gh issue list` output that displays unacknowledged bug reports
2+
# that are 2-12 months old. The date range is specific to OpenSSF best practices.
3+
4+
# `now` is in seconds since the unix epoch
5+
def one_year_ago: now - (365 * 24 * 60 * 60);
6+
7+
def sixty_days_ago: now - (60 * 24 * 60 * 60);
8+
9+
def date_fmt: "%Y/%m/%d";
10+
11+
def make_pretty_date_range:
12+
(one_year_ago | strftime(date_fmt)) + " - " + (sixty_days_ago | strftime(date_fmt));
13+
14+
def make_issue_url: "https://github.com/mne-tools/mne-python/issues/\(.number)";
15+
16+
def get_dev_comments: .comments | map(select(.authorAssociation == "MEMBER"));
17+
18+
19+
# main routine
20+
map(
21+
select(
22+
(.createdAt > (one_year_ago | todate)) and
23+
(.createdAt < (sixty_days_ago | todate))
24+
) +=
25+
{ "devComments": . | get_dev_comments | length }
26+
) |
27+
{
28+
"range": make_pretty_date_range,
29+
"has_dev_comments": map(select(.devComments > 0)) | length,
30+
"no_dev_comments": map(select(.devComments == 0) and .state == "OPEN") | length,
31+
"unaddressed_bug_reports": map(select(.devComments == 0) | make_issue_url),
32+
}

0 commit comments

Comments
 (0)