Centralize GH CLI timeout constant across maintenance scripts (#936)#1178
Centralize GH CLI timeout constant across maintenance scripts (#936)#1178yanyishuai wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 27 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
qingfeng312
left a comment
There was a problem hiding this comment.
CI is failing during pytest collection because the new timeout helper module is not present where the changed scripts import it.
tests/test_submission_quality_gate.py imports scripts.submission_quality_gate, which now imports from scripts.public_payment_language, but that module is missing in this PR's checked-out tree. The workflow stops with:
ModuleNotFoundError: No module named 'scripts.public_payment_language'
Please include the missing module, or update the imports so the test suite can collect successfully.
Evidence: GitHub Actions run 28344111604, job 83964056348, collection interrupted with 1 error.
dfbdf46 to
fdba69b
Compare
|
@qingfeng312 Rebuilt this branch from
Latest head: |
|
@qingfeng312 CI is green on the latest head ( |
1 similar comment
|
@qingfeng312 CI is green on the latest head ( |
qingfeng312
left a comment
There was a problem hiding this comment.
Follow-up on current head fdba69b11a67eaef982c56e157a4cce444af2fd4.
The earlier missing-module collection blocker has been resolved. I rechecked the new scripts/gh_cli_constants.py helper and the maintenance scripts migrated to use the shared GH_TIMEOUT_SECONDS value.
The branch is now self-contained, limits itself to the timeout-constant refactor plus the subprocess help bootstrap cleanup, and adds focused coverage for the constant.
Validation checked: GitHub CI Quality, readiness, docs, and image checks passed on run 28350097261; CodeRabbit status is success on this head. I did not find a remaining blocker for the scoped #936 change.
|
@qingfeng312 CI is green on the latest head ( |
4 similar comments
|
@qingfeng312 CI is green on the latest head ( |
|
@qingfeng312 CI is green on the latest head ( |
|
@qingfeng312 CI is green on the latest head ( |
|
@qingfeng312 CI is green on the latest head ( |
|
@qingfeng312 — proactive CRLF cleanup on this branch. Normalized LF line endings (no functional changes) in:
Should pass |
fdba69b to
53070c1
Compare
piaigmt
left a comment
There was a problem hiding this comment.
APPROVE — head 53070c1d73eb1ef91c67a2fc4356184d825e389c
Clean, behavior-preserving DRY refactor of the duplicated GH_TIMEOUT_SECONDS = 30 constant into a single shared module scripts/gh_cli_constants.py, plus a focused regression test.
Local verification (Py 3.12 venv, at head 53070c1d):
- No stray duplicates left:
grep -rn "GH_TIMEOUT_SECONDS = 30" scripts/ | grep -v gh_cli_constants.py→ empty. The canonical30definition now lives only ingh_cli_constants.py. - All 7 consumers wired to the shared module:
grep -rln "from scripts.gh_cli_constants import GH_TIMEOUT_SECONDS" scripts/→ 7 files (check_bounty_issue_states,check_live_bounty_closing_refs,claim_inventory,pr_queue_health,proposed_work_triage,review_bounty_candidates,submission_quality_gate). - No ImportError introduced:
python -c "import scripts.<m>"for all 7 consumers → all OK. Thereview_bounty_candidates.pysys.pathbootstrap for__package__ in {None, ""}correctly handles direct-script invocation. - Value preserved:
GH_TIMEOUT_SECONDS == 30(int) — pure consolidation, no timeout change. - New test passes:
pytest tests/test_gh_cli_constants.py -q→1 passed. - ruff clean:
ruff checkon all 9 touched files → All checks passed;ruff format --check→ already formatted. - CI green: CodeRabbit pass; "Quality, readiness, docs, and image checks" pass.
Non-tautological check: the test asserts both isinstance(GH_TIMEOUT_SECONDS, int) and > 0, which guards against a future accidental string/negative override of the shared constant.
No self-review conflict (author yanyishuai, reviewer piaigmt). Mergeable, no blockers.
|
@qingfeng312 CI is green on the latest head ( |
Summary
Centralizes the duplicated
GH_TIMEOUT_SECONDS = 30literal used across seven read-only GitHub CLI maintenance scripts intoscripts/gh_cli_constants.py.Why
Several maintenance scripts already share safety-cap and JSON-shape helpers; the timeout constant was still duplicated by hand. A single module reduces drift when the timeout policy changes.
Tests
Existing script behavior is unchanged aside from the shared import.
Wallet
Do4v7foHJvRJLpRRoGaVPWX6DDEjX3yTK7J91gpwUQpECloses #936