Skip to content

check_issue_refs fails a pull request that says it closes an issue the pull request itself closes #1139

Open

Description

@yakew7

Where: scripts/check_issue_refs.py, .github/workflows/lint.yml, tests/test_check_issue_refs.py.

Current gap: the check compares every issue number cited in ROADMAP.md, CHANGELOG.md, CONTRIBUTORS.md and METRICS.md with GitHub: a CHANGELOG line that says closes #N fails while #N is open, and a checked ROADMAP item that cites an open issue fails. That is correct on main, and wrong on the pull request that fixes #N: the PR's body says Closes #N, the CHANGELOG line is part of the same change, and the issue closes only when the PR merges, so the PR's own lint run fails. The only way to make it pass is to close the issue before merging or to leave the CHANGELOG and ROADMAP lines out of the PR and land them in a second one. This showed up on every batch of fixes committed with their docs in the last two weeks.

Repro: on a branch, add closes #<an open issue> to the CHANGELOG and run python3 scripts/check_issue_refs.py.

Suggested approach: when running in a pull request (GITHUB_EVENT_NAME == pull_request), read the PR body from the event payload, collect the issue numbers it closes (closes, fixes, resolves, case-insensitive), and treat them as closed for the comparison. Locally keep the strict behaviour, with an optional --assume-closed N flag for a developer who wants the same effect. Say in the output which issues were assumed closed.

Done when: a PR whose body closes #N can cite #N as closed in the CHANGELOG and ROADMAP and pass lint, a citation of a different open issue still fails, and the tests cover the payload parsing.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions