Skip to content

Automate cleanup of unsigned and stale draft pull requests - #62936

Open
zelenenka wants to merge 4 commits into
mainfrom
zelenenka-automate-stale-drafts-and-unsigned-cla-warnings-and-closures
Open

Automate cleanup of unsigned and stale draft pull requests#62936
zelenenka wants to merge 4 commits into
mainfrom
zelenenka-automate-stale-drafts-and-unsigned-cla-warnings-and-closures

Conversation

@zelenenka

Copy link
Copy Markdown
Contributor
  • Notify the author when their PR has been in draft state with no new commits for three weeks
  • Close the draft PRs that didn't get updated after one more week
  • Re-try the cla-bot check on PRs that are still unsigned after a week
  • Close the PRs that are still unsigned after the re-try

Testing

It works on my machine™

python script/github-pr-cleanup.py --dry-run
Checking 713 open pull requests
Dry-run mode: no comments or closures will be made
PR #60885: asking the CLA bot to check again
  Would comment on PR #60885:
@cla-bot check

PR #61625: asking the CLA bot to check again
  Would comment on PR #61625:
@cla-bot check

PR #57239: warning about a stale draft
  Would comment on PR #57239:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

PR #57241: warning about a stale draft
  Would comment on PR #57241:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

PR #61461: warning about a stale draft
  Would comment on PR #61461:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

PR #61722: warning about a stale draft
  Would comment on PR #61722:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

PR #61808: warning about a stale draft
  Would comment on PR #61808:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

PR #61809: warning about a stale draft
  Would comment on PR #61809:
<!-- zed-community-automation:stale-draft-warning -->

This pull request has remained in draft without new commits for three weeks.
If it remains a draft without new commits for another week, it will be closed
automatically.

Cleanup complete: 0 unsigned PR closures, 6 draft warnings, 0 draft closures

Release Notes:

  • N/A

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 20, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Aug 20, 2026

@SomeoneToIgnore SomeoneToIgnore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, not versed enough in Python though.

Comment thread script/github-pr-cleanup.py Outdated

@MrSubidubi MrSubidubi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Details Image

Comment thread script/github-pr-cleanup.py Outdated
)
if warning_at is not None:
if now - warning_at >= DRAFT_CLOSE_AFTER_WARNING:
return "close"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could also make this an enum I suppose

Comment thread script/github-pr-cleanup.py Outdated
Comment on lines +405 to +406
post_comment(number, DRAFT_CLOSE_COMMENT, dry_run)
close_pull_request(number, dry_run)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Curious here why the comment only happens under that certain circumstance?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed some of this nonsense in a follow-up commit

@MrSubidubi

Copy link
Copy Markdown
Member

Also

Details grafik

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

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants