Skip to content

scripts: de-duplicate and harden the close_pull_requests_with_*.sh backlog jobs - #15170

Open
cclauss wants to merge 2 commits into
masterfrom
priya-improve-close-scripts
Open

scripts: de-duplicate and harden the close_pull_requests_with_*.sh backlog jobs#15170
cclauss wants to merge 2 commits into
masterfrom
priya-improve-close-scripts

Conversation

@cclauss

@cclauss cclauss commented Sep 3, 2026

Copy link
Copy Markdown
Member

This is a replica of @priya-sundaram-dev pull request:

This is a follow-up to:

Extract the five byte-for-byte-identical backlog-closing scripts into one parameterized close_pull_requests_with_label.sh and make each named script a thin wrapper. Addresses the recommendations from #15168:

  • Correctness: filter by label server-side (gh pr list --label) instead of listing all ~900 open PRs and matching client-side, so no PR is skipped by an arbitrary --limit cap.
  • De-duplication: one implementation removes the drift between copies (some had sleep 2, one had it commented out, two had none).
  • Throttling: a single, deliberate SLEEP (default 2s) between closes.
  • Safety rails: set -euo pipefail, explicit --repo, and a DRY_RUN=1 preview mode that prints what would close before a maintainer commits.
  • Machine-readable summary (CLOSED_COUNT/CLOSED_PRS) so the Hacktoberfest tracker can be updated from script output.

Describe your change:

  • Fix scripts
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is the work of @priya-sundaram-dev
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues, then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

priya-sundaram-dev and others added 2 commits September 3, 2026 05:14
…cklog jobs

Extract the five byte-for-byte-identical backlog-closing scripts into one
parameterized close_pull_requests_with_label.sh and make each named script a
thin wrapper. Addresses the recommendations from #15168:

- Correctness: filter by label server-side (gh pr list --label) instead of
  listing all ~900 open PRs and matching client-side, so no PR is skipped by
  an arbitrary --limit cap.
- De-duplication: one implementation removes the drift between copies (some
  had sleep 2, one had it commented out, two had none).
- Throttling: a single, deliberate SLEEP (default 2s) between closes.
- Safety rails: set -euo pipefail, explicit --repo, and a DRY_RUN=1 preview
  mode that prints what would close before a maintainer commits.
- Machine-readable summary (CLOSED_COUNT/CLOSED_PRS) so the Hacktoberfest
  tracker can be updated from script output.

Follow-up to #15081.
@cclauss
cclauss requested a review from poyea September 3, 2026 06:49
@algorithms-keeper algorithms-keeper Bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Sep 3, 2026
@cclauss

cclauss commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

@priya-sundaram-dev With these changes, I ran scripts/close_pull_requests_with_require_tests.sh, which output:
CLOSED_COUNT=24 CLOSED_PRS=14973,14732,14582,14478,14352,14342,14314,14303,14086,14045,14027,14019,14004,13883,13823,13822,13781,13774,13761,13742,13712,13655,13600,13523

Please create a PR to update docs/hacktober_2026_prep.md

@cclauss
cclauss enabled auto-merge (squash) September 3, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants