Skip to content

Centralize GH CLI timeout constant across maintenance scripts (#936)#1178

Open
yanyishuai wants to merge 1 commit into
ramimbo:mainfrom
yanyishuai:fix/issue-936-gh-cli-constants
Open

Centralize GH CLI timeout constant across maintenance scripts (#936)#1178
yanyishuai wants to merge 1 commit into
ramimbo:mainfrom
yanyishuai:fix/issue-936-gh-cli-constants

Conversation

@yanyishuai

Copy link
Copy Markdown

Summary

Centralizes the duplicated GH_TIMEOUT_SECONDS = 30 literal used across seven read-only GitHub CLI maintenance scripts into scripts/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

python -m pytest tests/test_gh_cli_constants.py -q

Existing script behavior is unchanged aside from the shared import.

Wallet

Do4v7foHJvRJLpRRoGaVPWX6DDEjX3yTK7J91gpwUQpE

Closes #936

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@yanyishuai, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable usage-based reviews in Billing to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 see our Fair Usage Limits Policy for further information, and refer to the rate limits docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 80811c59-09bf-4b70-9a05-2eaf5aded34d

📥 Commits

Reviewing files that changed from the base of the PR and between 3bc87d2 and fdba69b.

📒 Files selected for processing (9)
  • scripts/check_bounty_issue_states.py
  • scripts/check_live_bounty_closing_refs.py
  • scripts/claim_inventory.py
  • scripts/gh_cli_constants.py
  • scripts/pr_queue_health.py
  • scripts/proposed_work_triage.py
  • scripts/review_bounty_candidates.py
  • scripts/submission_quality_gate.py
  • tests/test_gh_cli_constants.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qingfeng312 qingfeng312 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@yanyishuai yanyishuai force-pushed the fix/issue-936-gh-cli-constants branch from dfbdf46 to fdba69b Compare June 29, 2026 05:11
@yanyishuai

Copy link
Copy Markdown
Author

@qingfeng312 Rebuilt this branch from ramimbo/main so it only centralizes GH_TIMEOUT_SECONDS — no accidental #1107 payment-language imports.

  • Added scripts/gh_cli_constants.py
  • Migrated the seven maintenance scripts + tests/test_gh_cli_constants.py
  • Fixed review_bounty_candidates.py sys.path bootstrap for subprocess --help
  • Ruff import order clean

Latest head: fdba69b11a67. CI: pass. Please re-review.

@yanyishuai

Copy link
Copy Markdown
Author

@qingfeng312 CI is green on the latest head (fdba69b11a67) for #936. Could you take another look when you have a moment?

1 similar comment
@yanyishuai

Copy link
Copy Markdown
Author

@qingfeng312 CI is green on the latest head (fdba69b11a67) for #936. Could you take another look when you have a moment?

@qingfeng312 qingfeng312 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MRWK bounty: 100 MRWK - code cleanup and maintainability improvements, round 2

2 participants