Skip to content

fix(issue get): show incoming issue relations #60

Description

@dorkitude

Summary

linctl issue get ISSUE-ID only queries and renders the issue's forward relations connection. It omits inverseRelations, so incoming relationships are absent from the rich output and JSON.

For example, for an edge A --blocks--> B, linctl issue get B does not show that B is blocked by A. This is especially confusing now that linctl issue relation list B correctly renders the same edge.

Current code

  • pkg/api/queries.go selects only relations in GetIssue.
  • cmd/issue.go renders only issue.Relations.Nodes.
  • The renderer has a case "blocked", but blocked is not an IssueRelationType; incoming blocks rows need to be represented/rendered as Blocked by based on their inverse direction.

Proposed fix

  1. Query inverseRelations with both issue endpoints and state.
  2. Preserve which direction each row came from (or merge through a shared relation helper).
  3. Render the counterpart and a direction-aware label for both connections: Blocks / Blocked by, Duplicate of / Has duplicate, and unchanged symmetric labels.
  4. Add command tests covering the same edge viewed from both endpoints, including issue get -j.

Related: #59 fixed this behavior in issue relation list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions