Skip to content

feat(cli): add --parent filter to issues list#18

Merged
dubscode merged 4 commits intomainfrom
issue-3
May 9, 2026
Merged

feat(cli): add --parent filter to issues list#18
dubscode merged 4 commits intomainfrom
issue-3

Conversation

@dubscode
Copy link
Copy Markdown
Contributor

@dubscode dubscode commented May 9, 2026

Summary

  • Adds --parent <id-or-identifier> to linear issues list, accepting Linear identifiers (e.g. BB-418) or UUIDs.
  • Threads the constraint into the Linear SDK as filter: { parent: { id: { eq: <uuid> } } } so filtering happens server-side instead of paginating the workspace.
  • New LinearGateway.resolveIssueId helper short-circuits when the input already looks like a UUID, otherwise looks the issue up once.

Notes

  • Filter merge (rather than overwrite) keeps the variables shape composable when future server-side filters land.
  • Adversarial review caught the double-resolution and clobbering-filter bugs — both fixed before commit.

Test plan

  • pnpm verify (biome + typecheck + tests) — 90/90 pass
  • New gateway tests cover identifier lookup, UUID short-circuit, and the SDK variables shape
  • Smoke test against a real workspace: linear issues list --parent <PARENT-ID> --json

Refs: #3

dubscode added 2 commits May 8, 2026 22:11
Threads a parent issue identifier or UUID through `linear issues list`
to the Linear SDK as `{ filter: { parent: { id: { eq: ... } } } }`.
The gateway resolves identifiers (e.g. ANN-123) to UUIDs once and
merges into any existing filter so future server-side constraints
compose cleanly.

Refs: #3
Copilot AI review requested due to automatic review settings May 9, 2026 05:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a --parent <id-or-identifier> filter to linear issues list, allowing users to list direct child issues of a given parent by Linear identifier (e.g. ENG-42) or UUID, with server-side filtering via the Linear SDK.

Changes:

  • Adds --parent as a CLI option and threads it into issues list pagination calls.
  • Extends LinearGateway.listIssues to merge a parent constraint into SDK issues(...) query variables, using a new resolveIssueId helper.
  • Adds gateway tests covering identifier→UUID resolution and the resulting SDK variables shape.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/linear-core/tests/linear-gateway.test.ts Adds tests for parent filter variable shape + resolveIssueId behavior.
packages/linear-core/src/types/public.ts Extends ListOptions with an optional parent field.
packages/linear-core/src/entities/linear-gateway.ts Implements parent filter merging + resolveIssueId helper.
packages/cli/src/runtime/options.ts Plumbs parent through global options parsing.
packages/cli/src/index.ts Registers --parent and passes it into issues list loader.
packages/cli/src/help/root-help.ts Adds an example usage with --parent.
.reports/issue-3.html Adds a QA/report artifact describing the change.
.reports/issue-3-qa.md Adds a QA fallback doc describing verification steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/linear-core/src/entities/linear-gateway.ts
Comment thread packages/cli/src/index.ts
Comment thread .reports/issue-3-qa.md Outdated
dubscode added 2 commits May 8, 2026 22:20
…nd triage

Pre-resolves the parent identifier to a UUID once per command, before the
collectPageResult paging loop, so identifier inputs no longer trigger an
extra client.issue() lookup on every page when --all, --sort, or local
filters drain pages. Also threads the resolved parent UUID through my-work
and triage, which previously ignored --parent silently.

Refs: #3
# Conflicts:
#	packages/cli/src/index.ts
Copilot AI review requested due to automatic review settings May 9, 2026 05:22
@dubscode dubscode merged commit e1e8f21 into main May 9, 2026
7 checks passed
@dubscode dubscode deleted the issue-3 branch May 9, 2026 05:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment on lines 79 to 83
export interface ListOptions {
readonly limit?: number;
readonly cursor?: string | null;
readonly parent?: string;
}
Comment on lines +495 to +501
const variables: Record<string, unknown> = toListVariables(options);

if (options.parent) {
const parentId = await this.resolveIssueId(options.parent);
const existingFilter = (variables.filter as Record<string, unknown> | undefined) ?? {};
variables.filter = { ...existingFilter, parent: { id: { eq: parentId } } };
}
github-actions Bot pushed a commit that referenced this pull request May 9, 2026
# [1.5.0-alpha.3](v1.5.0-alpha.2...v1.5.0-alpha.3) (2026-05-09)

### Features

* **cli:** add --parent filter to issues list ([#18](#18)) ([e1e8f21](e1e8f21)), closes [#3](#3)
* **cli:** richer filters for issues list ([#17](#17)) ([34d98bd](34d98bd)), closes [#4](#4)
* **cli:** show per-resource filters, examples, input field hints in subcommand help ([#19](#19)) ([5818d1e](5818d1e)), closes [#7](#7)
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

🎉 This PR is included in version 1.5.0-alpha.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions Bot pushed a commit that referenced this pull request May 9, 2026
# [1.5.0](v1.4.0...v1.5.0) (2026-05-09)

### Features

* **cli:** add --parent filter to issues list ([#18](#18)) ([e1e8f21](e1e8f21)), closes [#3](#3)
* **cli:** add linear cli v2 foundations ([#2](#2)) ([854d165](854d165))
* **cli:** improve help discoverability for subcommands ([#1](#1)) ([702ebce](702ebce))
* **cli:** richer filters for issues list ([#17](#17)) ([34d98bd](34d98bd)), closes [#4](#4)
* **cli:** show per-resource filters, examples, input field hints in subcommand help ([#19](#19)) ([5818d1e](5818d1e)), closes [#7](#7)
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

🎉 This PR is included in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants