Skip to content

fix(roadmap): refine reads PR #N of another project as an issue #7379

Done

Description

@dan-petty

Problem Description

Refine reads each #<n> of a wait text as an issue of the item's own repository (_text_issues in src/devops_cli/roadmap/refine/refine.py, used by _wait_refs). A wait text can name a pull request of another project in the form PR #<n>.

Seen on 2026-11-27: dan-petty/homelab#61 waits for "an ansible-lint release with the fix of PR #5240" (https://github.com/ansible/ansible-lint/pull/5240). Its record holds refine.wait_refs = #5240, so each refine round of the item reads dan-petty/homelab#5240. That number is no issue of the repository; since v0.223.4 the store logs #5240 is no issue of dan-petty/homelab now. The store leaves it out. at each round.

Effect: one wasted GitHub read and one misleading log line in each round, and a wait that no issue of the repository can end. No wrong write.

Expected vs Actual Behavior

  • Expected: a wait reference names an issue of the repository only when the text names it as such: #<n> with no other project before it, or owner/name#<n> of the same repository.
  • Actual: PR #5240 after a link to another project is recorded as #5240 of the own repository.

Proposed Fix

Leave out a #<n> whose number is the number of a GitHub link to another repository in the same text, and read owner/name#<n> with its repository. Or drop a wait reference that the store answers as no issue of the repository, so the round reads it one time only.

Acceptance Criteria

  • A test: the wait text of homelab#61 (a link to ansible/ansible-lint/pull/5240 and the words PR #5240) gives no wait reference #5240.
  • A test: a bare #12 in a wait text is still a wait reference of the own repository.

Environment Diagnostics

devops-cli 0.224.0.

Alternatives check of 2026-11-27: partly.
Tool: semantic-release/issue-parser (https://github.com/semantic-release/issue-parser), MIT, last activity 2026-11-25, maintained.
Reason: Searches found no Python reference parser; issue-parser extracts a bare #12 and an owner/name#12 with its repository, but it has no rule to drop #5240 that matches a cross-repository link in the same text.

Covers:

  • Reads a bare #12 with no repository
  • Reads owner/name#12 with its repository slug
  • Returns raw text, slug and issue number per reference

Lacks:

  • No rule to drop #5240 that matches a cross-repository link
  • No repository inference from a nearby pull request URL
  • JavaScript package with no Python equivalent on PyPI

Proposed design

Problem statement

Refine reads each #<n> of a wait text as an issue of the item's own repository. A wait text can name a pull request of another project, as dan-petty/homelab#61 does with PR #5240. Each round then reads an issue that the repository does not hold, and the store logs a misleading line. The wait can never end by an issue of the repository.

Acceptance criteria

Requirement: Cross-repository pull request number

The wait-reference reader SHALL leave out a bare #<n> when the same text holds a GitHub link to another repository with that number.

Scenario: Pull request of another project

  • WHEN A test calls the wait-reference reader of src/devops_cli/roadmap/refine/refine.py with the text an ansible-lint release with the fix of PR #5240 and the link https://github.com/ansible/ansible-lint/pull/5240.
  • THEN The test asserts that the result holds no wait reference to issue 5240.

Requirement: Bare number of the own repository

The wait-reference reader SHALL keep a bare #<n> as a wait reference of the item's own repository when the text holds no cross-repository link with that number.

Scenario: Bare number with no link

  • WHEN A test calls the wait-reference reader with the text waits for #12.
  • THEN The test asserts that the result holds one wait reference to issue 12 of the own repository.

Requirement: Qualified reference of another repository

The wait-reference reader MUST read owner/name#<n> with that repository and MUST keep it only when owner/name is the repository of the item.

Scenario: Qualified reference of another repository

  • WHEN A test calls the wait-reference reader with the text blocked by ansible/ansible-lint#5240 for the repository dan-petty/homelab.
  • THEN The test asserts that the result holds no wait reference to issue 5240 of the own repository.

Requirement: Qualified reference of the own repository

The wait-reference reader SHALL keep owner/name#<n> as a wait reference of the own repository when owner/name is the repository of the item.

Scenario: Qualified reference of the own repository

  • WHEN A test calls the wait-reference reader with the text needs dan-petty/homelab#61 for the repository dan-petty/homelab.
  • THEN The test asserts that the result holds one wait reference to issue 61.

Existing Tool Considered

The alternatives check of 2026-11-27 in the issue body records the verdict partly for semantic-release/issue-parser (https://github.com/semantic-release/issue-parser, MIT, maintained). The block names what the tool covers and what it lacks. The tool lacks the one rule that the reported wait text needs: no drop of #5240 that matches a cross-repository link, and no repository from a nearby pull request URL. It is a JavaScript package with no Python equivalent on PyPI, so the change keeps the existing Python reader in src/devops_cli/roadmap/refine/refine.py and adds that one rule to _text_issues. The cost of the rule is about 1 500 tokens to write it with its tests and about 30 minutes to keep it.

Key questions

  • Where does refine read the wait references of a wait text?: _wait_refs in src/devops_cli/roadmap/refine/refine.py reads the text of the parts of the refine section that name a cause and the text of the replies. _text_issues turns each #<n> into an issue of the item's repository, and the job record keeps the result in RefineRecordKey.WAIT_REFS. [sources: src/devops_cli/roadmap/refine/refine.py:2750, src/devops_cli/roadmap/refine/refine.py:2809]
  • Which rule makes a bare #<n> a wait reference of the own repository?: A bare #<n> is a wait reference of the own repository. The reader drops it when the same text holds a GitHub link to another repository with number <n>. This rule costs no GitHub read and keeps the wait text as the only input. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:2750]
    • Chosen: Drop a number that a cross-repository link in the same text names. The text holds the link and the number already, so the rule needs no request, and it follows the expected behavior of the issue.
    • Rejected: Drop a reference that the store answers as no issue. It costs one GitHub read in each round, and the issue reports that read as the effect to remove.
    • Rejected: Read owner/name#<n> with its repository alone. The reported wait text has a bare #5240, so this option leaves the defect in place.
  • Which URL forms count as a GitHub link to another repository?: A link counts when it has the form https://github.com/<owner>/<name>/pull/<n>, https://github.com/<owner>/<name>/issues/<n> or https://github.com/<owner>/<name>/discussions/<n>, and <owner>/<name> is not the repository of the item. A link to a repository root or to a file names no number, so it counts for nothing. (best practice) [sources: src/devops_cli/roadmap/refine/refine.py:2809]
    • Chosen: Match the three GitHub object URL forms with their repository. GitHub gives these three forms a number, and each form names its repository in the path.
    • Rejected: Match each https://github.com/ URL. A link to a repository root or to a file holds no object number, so it would drop a correct reference.
    • Rejected: Match the words PR before the number. The words give no repository, and a bare #12 after PR can still be an issue of the own repository.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    effort/low
    value/low
    on Nov 27, 2026
  2. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 27, 2026
  4. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • remark-github plugin autolink issue references owner/repo#123 PR fix(security): the masker leaves names after token or Secret alone #5240, results: 5
    • python library parse GitHub issue and pull request references owner/repo#123 from text, results: 5
    • remark-github npm package parse issue references, results: 5
    • "github" reference parser library "owner/repo#123" cross-repository issue reference, results: 5
    • remark-github, results: 5
    • github issue reference parsing library python pypi, results: 5
    • npm remark-github package, results: 5
    • linkify-it-py github issue references, results: 5
    • python package github reference autolink issue number regex, results: 5
    • issue-parser npm extract issue references slug owner repo, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  7. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 28, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 28, 2026
  9. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 00:41 UTC

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

    effort/lowpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions