diff --git a/justfile b/justfile index 3aa7466..010069a 100644 --- a/justfile +++ b/justfile @@ -1436,16 +1436,47 @@ _committers_jsonl: _a_pr: - #!/usr/bin/env -S bash -euo pipefail - [[ -n "${JUST_PR:-}" ]] && { head -n1 <<<"$JUST_PR"; exit 0; } ||: - cd upstream/master - gh pr list --limit 1000 --json 'number,title' --state open | jq '.[]|"\(.number) - \(.title)"' -r | gum filter --placeholder "Pick PR..." --height 15 | cut -d' ' -f1 + @JUST_GUM_FILTER_NO_LIMIT=0 just _some_prs _some_prs: #!/usr/bin/env -S bash -euo pipefail [[ -n "${JUST_PR:-}" ]] && { cat <<<"$JUST_PR"; exit 0; } ||: + declare -a possible_args=( + "--state open" + "--author @me" + "--state closed" + "--state merged" + "--state all" + # "--search 'ASDASDASD'" + # TODO: multiple --label seems to AND... + "--label '12.approvals: 1'" + "--label '12.approvals: 2'" + "--label '12.approvals: 3+'" + "--label '12.approved-by: package-maintainer'" + "--label '11.by: package-maintainer'" + "--label '11.by: upstream-developer'" + "--label '1.severity: significant'" + "--label '1.severity: channel blocker'" + "--label '1.severity: security'" + "--label '1.severity: blocker'" + "--label '9.needs: reviewer'" + "--label '12.first-time contribution'" + "--label '2.status: stale'" + "--label '8.has: package (new)'" + "--label '8.has: package (update)'" + "--label '8.has: module (new)'" + "--label '8.has: module (update)'" + ) + readarray -td $'\n' args < <(gum filter --no-limit -- "${possible_args[@]}") cd upstream/master - gh pr list --limit 1000 --json 'number,title' --state open | jq '.[]|"\(.number) - \(.title)"' -r | gum filter --placeholder "Pick PR..." --height 15 --no-limit | cut -d' ' -f1 + declare -a gum_args=() + if [[ "${JUST_GUM_FILTER_NO_LIMIT:-1}" -ne 0 ]]; then + gum_args+=(--no-limit) + fi + ( + set -x + gh pr list --limit 1000 --json 'number,title' --state open ${args[@]} + ) | jq '.[]|"\(.number) - \(.title)"' -r | gum filter --placeholder "Pick PR..." --height 15 "${gum_args[@]}" | cut -d' ' -f1 @_list_upstream_release_branches $prefix="upstream/" $suffix="": printf "${prefix//%/%%}%s${suffix//%/%%}\n" \