Skip to content

Open an issue a week before a draft goes stale - #93

Open
bc1cindy wants to merge 1 commit into
mainfrom
stale-drafts
Open

bc1cindy wants to merge 1 commit into
mainfrom
stale-drafts

Conversation

@bc1cindy

Copy link
Copy Markdown
Member

Closes #64. Stubs are skipped, as their drafts are on pull request branches.

🤖 Generated with Claude Code

Comment thread contrib/stale.py Resolved
@github-actions

Copy link
Copy Markdown
range-diff for force push 6b144c6648 → 604da103fc November 16, 2026 21:40 UTC: 1 modified

reproduce: git range-diff cbb5404..6b144c6 cbb5404..604da10

1:  6b144c6648 ! 1:  604da103fc Open an issue a week before a draft goes stale
1: 6b144c6648 ! 1: 604da103fc Open an issue a week before a draft goes stale
@@ contrib/stale.py (new)
 +#!/usr/bin/env python3
 +"""Open an issue for each draft chapter that goes stale within a week.
 +
-+A chapter gets no second issue while an open one's title names it, nor
-+an issue titled like a closed one, so closing the issue without moving
-+the chapter's stale_after leaves it closed. Stubs are skipped: a stub's
-+draft is under review on its pull request's branch, so its stale_after
-+does not date anything in docs/.
++A chapter gets no second issue while the first word of an open one's
++title is its path, nor an issue titled like a closed one, so closing the
++issue without moving the chapter's stale_after leaves it closed. Stubs
++are skipped: a stub's draft is under review on its pull request's
++branch, so its stale_after does not date anything in docs/.
 +
 +    GH_TOKEN=... python3 stale.py ROOT
 +"""
@@ contrib/stale.py (new)
 +        title = f"{path} goes stale on {stale_after:%Y-%m-%d}"
 +        if stale_after - now > NOTICE or any(
 +            i["title"] == title
-+            or (i["state"] == "OPEN" and i["title"].startswith(f"{path} "))
++            or (i["state"] == "OPEN" and i["title"].partition(" ")[0] == path)
 +            for i in existing
 +        ):
 +            continue
@@ contrib/test_stale.py (new)
 +    return [t for t, _ in stale.issues(pages, existing, NOW)]
 +
 +
-+def test_no_second_issue_while_one_is_open_for_the_chapter():
-+    existing = [{"title": "docs/a.md goes stale on 2027-01-01", "state": "OPEN"}]
++@pytest.mark.parametrize("title", ["docs/a.md goes stale on 2027-01-01", "docs/a.md"])
++def test_no_second_issue_while_one_is_open_for_the_chapter(title):
++    existing = [{"title": title, "state": "OPEN"}]
 +    assert titles(existing) == ["docs/ab.md goes stale on 2027-04-10"]
 +
 +

Comment thread .github/workflows/stale.yml Resolved
Stubs are skipped, as their drafts are on pull request branches.
@github-actions

Copy link
Copy Markdown
range-diff for force push 604da103fc → cb0c0e2265 November 16, 2026 22:10 UTC: 1 modified

reproduce: git range-diff cbb5404..604da10 cbb5404..cb0c0e2

1:  604da103fc ! 1:  cb0c0e2265 Open an issue a week before a draft goes stale
1: 604da103fc ! 1: cb0c0e2265 Open an issue a week before a draft goes stale
@@ .github/workflows/stale.yml (new)
 +  workflow_dispatch:
 +permissions:
 +  contents: read
++concurrency:
++  group: stale-drafts
++  cancel-in-progress: false
 +jobs:
 +  stale:
 +    runs-on: ubuntu-latest

This branch has not been deployed

No deployments
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.

open an issue a week before a draft goes stale

2 participants