Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/check_bounty_issue_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))

from scripts.api_host_args import public_api_host
from scripts.gh_cli_constants import GH_TIMEOUT_SECONDS

DEFAULT_API_HOST = "https://api.mrwk.online"
GH_TIMEOUT_SECONDS = 30


def _int_or_none(value: Any) -> int | None:
Expand Down
2 changes: 1 addition & 1 deletion scripts/check_live_bounty_closing_refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

from scripts.api_host_args import public_api_host
from scripts.bounty_refs import GITHUB_CLOSING_ISSUE_RE
from scripts.gh_cli_constants import GH_TIMEOUT_SECONDS

DEFAULT_API_HOST = "https://api.mrwk.online"
GH_TIMEOUT_SECONDS = 30
GH_PR_SAFETY_CAP = 200
MAX_BOUNTY_REF = 2**63 - 1

Expand Down
2 changes: 1 addition & 1 deletion scripts/claim_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

from scripts.api_host_args import public_api_host
from scripts.bounty_refs import BOUNTY_REF_RE
from scripts.gh_cli_constants import GH_TIMEOUT_SECONDS

DEFAULT_API_HOST = "https://api.mrwk.online"
GH_TIMEOUT_SECONDS = 30
GH_LIMIT = 200
GITHUB_URL_RE = re.compile(
r"https://github\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+/"
Expand Down
5 changes: 5 additions & 0 deletions scripts/gh_cli_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Shared constants for read-only GitHub CLI maintenance scripts."""

from __future__ import annotations

GH_TIMEOUT_SECONDS = 30
2 changes: 1 addition & 1 deletion scripts/pr_queue_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))

from scripts.bounty_refs import BOUNTY_REF_RE
from scripts.gh_cli_constants import GH_TIMEOUT_SECONDS

NOISY_TITLE_PREFIX_RE = re.compile(r"^\s*(?:\[[^\]]+\]\s*)+")
UNSTABLE_MERGE_STATES = {"blocked", "conflicting", "dirty", "unknown", "unstable"}
GH_TIMEOUT_SECONDS = 30
GH_PR_SAFETY_CAP = 201
GH_ISSUE_SAFETY_CAP = 201
MAX_BOUNTY_REF = 2**63 - 1
Expand Down
2 changes: 1 addition & 1 deletion scripts/proposed_work_triage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))

from scripts.api_host_args import public_api_host
from scripts.gh_cli_constants import GH_TIMEOUT_SECONDS


def _positive_int(value: str) -> int:
Expand Down Expand Up @@ -79,7 +80,6 @@ def _positive_int(value: str) -> int:
"to",
"work",
}
GH_TIMEOUT_SECONDS = 30
HTTP_TIMEOUT_SECONDS = 30
DEFAULT_API_HOST = "https://api.mrwk.online"
DEFAULT_PAYMENT_BOUNTY_ISSUE_NUMBERS = (649, 722)
Expand Down
7 changes: 6 additions & 1 deletion scripts/review_bounty_candidates.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
import subprocess
import sys
from collections import Counter
from pathlib import Path
from typing import Any

if __package__ in {None, ""}:
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))

from scripts.gh_cli_constants import GH_TIMEOUT_SECONDS

DIRTY_MERGE_STATES = {"blocked", "conflicting", "dirty"}
GH_TIMEOUT_SECONDS = 30
GH_PR_SAFETY_CAP = 201
STANDARD_QUALITY_CHECK = "Quality, readiness, docs, and image checks"
HUMAN_REVIEW_STATES = {"APPROVED", "CHANGES_REQUESTED", "COMMENTED"}
Expand Down
2 changes: 1 addition & 1 deletion scripts/submission_quality_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from scripts.api_host_args import public_api_host
from scripts.bounty_refs import BOUNTY_REF_RE, GITHUB_LINKED_ISSUE_RE, LEADING_BOUNTY_REF_RE
from scripts.gh_cli_constants import GH_TIMEOUT_SECONDS


def _non_negative_int(value: str) -> int:
Expand All @@ -40,7 +41,6 @@ def _non_negative_int(value: str) -> int:
re.IGNORECASE,
)
SUMMARY_RE = re.compile(r"\b(summary|what changed|changes?)\b", re.IGNORECASE)
GH_TIMEOUT_SECONDS = 30
DEFAULT_API_HOST = "https://api.mrwk.online"
DEFAULT_MAX_MAINTAINER_AGE_DAYS = 14
GH_PR_SAFETY_CAP = 101
Expand Down
10 changes: 10 additions & 0 deletions tests/test_gh_cli_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Tests for shared gh CLI maintenance constants."""

from __future__ import annotations

from scripts.gh_cli_constants import GH_TIMEOUT_SECONDS


def test_gh_timeout_is_positive_int() -> None:
assert isinstance(GH_TIMEOUT_SECONDS, int)
assert GH_TIMEOUT_SECONDS > 0
Loading