Skip to content

feat(relations): add multi-target issue relation creation - #252

Merged
ruby-automation merged 2 commits into
mainfrom
EXT-41-multi-target-relation-add
Sep 6, 2026
Merged

feat(relations): add multi-target issue relation creation#252
ruby-automation merged 2 commits into
mainfrom
EXT-41-multi-target-relation-add

Conversation

@ruby-automation

Copy link
Copy Markdown
Contributor

Summary

  • Adds lc issue relation add ISSUE RELATED_ISSUE... --type TYPE (alias: a) per Phase 16 plan decomposition 2
  • blocked-by reverses wire endpoints: each RELATED_ISSUE becomes issueId, ISSUE becomes relatedIssueId, wire type is "blocks"
  • Per-target independent processing: self-links rejected, duplicates treated as informative no-ops, partial failures reported and exit non-zero

Implementation details

  • IssueRelation.Create ManualCreate calls issueRelationCreate mutation; duplicate-relation GraphQL errors detected by message pattern and return {:duplicate_relation, msg} for safe no-op handling
  • create_issue_relation/3 code interface added to LinearCli.Linear domain
  • add subcommand with required --type option (parser validates blocks/blocked-by/related/duplicate) and allow_unknown_args: true for variadic related-issue list
  • Display.relation_to_plain/1 public helper for JSON output of create results
  • JSON output: per-target array with {target, status, relation} structure
  • Text output: direction-aware messages ("EXT-1 now blocks EXT-2", "EXT-3 now blocks EXT-1")
  • ERD updated with :create action and create_issue_relation code interface

Test plan

  • create_issue_relation/3 domain tests: successful creation, related type, API error, duplicate detection, wire variables
  • issue relation add command tests: blocks/blocked-by/related, multiple targets, duplicate no-op, self-link rejection, partial failure, JSON output
  • normalize_subcommand_aliases test: a alias → add for issue relation
  • 446 tests pass, credo clean, format clean

Closes EXT-41

🤖 Generated with Claude Code

ruby-automation and others added 2 commits September 5, 2026 19:43
Implements `lc issue relation add ISSUE RELATED_ISSUE... --type TYPE`
(alias: `a`) per the Phase 16 plan decomposition 2.

- IssueRelation.Create ManualCreate calls issueRelationCreate mutation,
  detects duplicate-relation GraphQL errors and returns :duplicate_relation
- create_issue_relation/3 code interface added to LinearCli.Linear domain
- `add` subcommand with --type option (blocks/blocked-by/related/duplicate)
  and allow_unknown_args: true for variadic related-issue list
- blocked-by reverses wire endpoints: each RELATED_ISSUE becomes issueId,
  ISSUE becomes relatedIssueId, wire type is "blocks"
- Per-target processing: self-link rejected, duplicate treated as no-op,
  partial failures reported and exit non-zero
- Display.relation_to_plain/1 helper for JSON output
- Unit tests at resource, domain, CLI command, and alias levels
- ERD updated with :create action and create_issue_relation interface

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- relation type "related" now renders "is now related to" (not "related of")
- relation type "duplicate" now renders "is now a duplicate of" (not "duplicate of")
- JSON error output now includes the actual error message (truncated at 200 chars)
  via relation_add_error_message/1 instead of a generic placeholder
- add truncate_message/2 helper for message length safety

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ruby-automation
ruby-automation merged commit a60a52e into main Sep 6, 2026
3 checks passed
@ruby-automation
ruby-automation deleted the EXT-41-multi-target-relation-add branch September 6, 2026 02:07
This was referenced Sep 6, 2026
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.

1 participant