Skip to content

[BUG] gh_issues.py cross-ref misses PRs linked via Refs: instead of Closes/Fixes #121

Closed

Description

@gerchowl

Description

The _build_cross_refs function in scripts/gh_issues.py only detects issue↔PR links via branch name matching and Closes/Fixes/Resolves keywords in PR bodies. It does not detect Refs: #<number> — which is the project's standard commit/PR reference format (see CLAUDE.md).

Problem

PR #106 merged with Refs: #102 in its body. GitHub did not auto-close issue #102 and did not create a formal PR↔issue link because Refs: is not a GitHub closing keyword. The gh-issues table also fails to show the PR↔issue cross-reference since _build_cross_refs doesn't parse Refs:.

Expected Behavior

_build_cross_refs should also match Refs: #<number> (and comma-separated variants like Refs: #102, #103) in PR bodies to build the issue↔PR mapping.

Reproduction

  1. Create a PR whose body contains Refs: #102 (no Closes/Fixes)
  2. Run just gh-issues
  3. Observe that the PR column for issue [FEATURE] Add optional reviewer parameter to worktree-start for autonomous PR creation #102 is empty

Proposed Fix

Add a regex for Refs:\s*#(\d+) (with comma-separated support) to _build_cross_refs alongside the existing _CLOSING_RE.

Activity

  1. added
    bug
    on Feb 20, 2026
  2. self-assigned this
    on Feb 21, 2026
  3. gerchowl commented on Feb 21, 2026

    @gerchowl
    ContributorAuthor

    Design

    Problem: _build_cross_refs only detects issue↔PR links via branch names and Closes/Fixes/Resolves keywords. The project uses Refs: #<n> as the standard format (CLAUDE.md), which GitHub does not auto-link.

    Solution: Add a regex Refs:\s*#(\d+) (with comma-separated support) alongside _CLOSING_RE in _build_cross_refs. Both regexes feed into the same linked set — no structural change.

    Files: scripts/gh_issues.py only.

    Testing: Add unit tests in tests/test_gh_issues.py for Refs: #102 and Refs: #102, #103 (TDD: test first, then implementation).

  4. gerchowl commented on Feb 21, 2026

    @gerchowl
    ContributorAuthor

    Implementation Plan

    Issue: #121
    Branch: bugfix/121-cross-ref-misses-refs-linked-prs

    Tasks

    • Task 1: Add failing unit tests for Refs: #N and Refs: #N, #M in tests/test_gh_issues.py — verify: pytest tests/test_gh_issues.py::TestBuildCrossRefs -v
    • Task 2: Add _REFS_RE regex and use it in _build_cross_refs in scripts/gh_issues.py — verify: pytest tests/test_gh_issues.py::TestBuildCrossRefs -v
  5. gerchowl commented on Feb 21, 2026

    @gerchowl
    ContributorAuthor

    Autonomous Run Complete

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

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions