File: unacknowledged-issues.jq

package info (click to toggle)
python-mne 1.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 131,492 kB
  • sloc: python: 213,302; javascript: 12,910; sh: 447; makefile: 144
file content (32 lines) | stat: -rw-r--r-- 1,060 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Processor for `gh issue list` output that displays unacknowledged issues
# that are 2-12 months old. The date range is specific to OpenSSF best practices.

# `now` is in seconds since the unix epoch
def one_year_ago: now - (365 * 24 * 60 * 60);

def sixty_days_ago: now - (60 * 24 * 60 * 60);

def date_fmt: "%Y/%m/%d";

def make_pretty_date_range:
    (one_year_ago | strftime(date_fmt)) + " - " + (sixty_days_ago | strftime(date_fmt));

def make_issue_url: "https://github.com/mne-tools/mne-python/issues/\(.number)";

def get_dev_comments: .comments | map(select(.authorAssociation == "MEMBER"));


# main routine
map(
    select(
        (.createdAt > (one_year_ago | todate)) and
        (.createdAt < (sixty_days_ago | todate))
    ) +=
    { "devComments": . | get_dev_comments | length }
) |
{
    "range": make_pretty_date_range,
    "has_dev_comments": map(select(.devComments > 0)) | length,
    "no_dev_comments": map(select(.devComments == 0) and .state == "OPEN") | length,
    "unaddressed": map(select(.devComments == 0) | make_issue_url),
}