Skip to content

Fix missing issue taxonomy and trashed issue output#152

Merged
qwrobins merged 1 commit into
mainfrom
codex/fix-150-151-not-found-trashed
Jun 10, 2026
Merged

Fix missing issue taxonomy and trashed issue output#152
qwrobins merged 1 commit into
mainfrom
codex/fix-150-151-not-found-trashed

Conversation

@qwrobins

@qwrobins qwrobins commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • unify inline GraphQL error classification with the shared command failure taxonomy so missing referenced issues return not-found/exit 4 across get, update, delete, and bulk paths
  • include trashed and archivedAt in curated issue get/view output and human rendering
  • add a narrow comment list --issue INF-... parent existence check instead of returning an empty list for a missing parent
  • bump version to 0.8.2 and update CHANGELOG, command docs, and SKILL.md

Fixes #150
Fixes #151

Verification

  • bun run typecheck
  • bun run test
  • bun run build

Breaking changes

None. The new not-found mapping is a contract correction, and issue get adds fields to JSON output.

Summary by CodeRabbit

  • New Features

    • Issue retrieval now includes trash status and archive timestamps in both JSON and human-readable output.
  • Bug Fixes

    • comment list --issue now validates parent issues exist before listing comments and reports not-found errors properly.
    • Unified error handling for missing referenced entities across all commands with standardized exit codes.
  • Documentation

    • Updated command documentation to clarify JSON output includes soft-deleted issue fields and explain not-found error behavior.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4116f378-72a1-4878-96ca-49dcd8270940

📥 Commits

Reviewing files that changed from the base of the PR and between a70ddd1 and 83f0fba.

⛔ Files ignored due to path filters (1)
  • src/generated/embedded-skills.ts is excluded by !**/generated/**
📒 Files selected for processing (10)
  • CHANGELOG.md
  • docs/commands.md
  • package.json
  • skills/linearctl/SKILL.md
  • src/commands/comment.ts
  • src/commands/issue.ts
  • src/core/errors/command-failure.ts
  • src/core/runtime/command-context.ts
  • tests/commands/comment.test.ts
  • tests/commands/issue.test.ts
👮 Files not reviewed due to content moderation or server errors (6)
  • src/core/errors/command-failure.ts
  • src/core/runtime/command-context.ts
  • src/commands/issue.ts
  • src/commands/comment.ts
  • tests/commands/issue.test.ts
  • tests/commands/comment.test.ts

📝 Walkthrough

Walkthrough

This PR resolves two linked issues by unifying not-found error classification and adding soft-delete visibility. It introduces GraphQL error mapping infrastructure (mapGraphQLErrorPayload), extends the issue data model with trashed/archivedAt fields, validates parent issues in comment list, and updates tests and documentation accordingly.

Changes

Not-found Taxonomy and Soft-Delete Visibility

Layer / File(s) Summary
GraphQL error mapping infrastructure
src/core/errors/command-failure.ts
New mapGraphQLErrorPayload function and centralized helpers (isGraphQLErrorNotFound, isGraphQLErrorAuth, isGraphQLErrorRateLimit, etc.) extract user-facing messages and classify errors into not-found/authentication/rate-limit categories based on GraphQL payloads and extensions.
Command context exit-code resolution
src/core/runtime/command-context.ts
emitFailure now recalculates exit codes via exitCodeForErrors helper based on error categories; mapGraphQLErrors delegates to the new mapGraphQLErrorPayload instead of inline logic.
Issue soft-delete visibility
src/commands/issue.ts
GraphQL issue fragments now request trashed and archivedAt; RawIssue and NormalizedIssue types extended with these fields; human-readable output prints Trashed: true and Archived: <timestamp> when present.
Comment list parent issue validation
src/commands/comment.ts
New looksLikeIssueIdentifier helper detects human-readable identifiers; handleCommentList resolves identifier to internal ID via GraphQL lookup, returns not-found (exit 4) when parent issue missing, and wires resolved ID into pagination query.
Test coverage
tests/commands/issue.test.ts, tests/commands/comment.test.ts
New test suite verifies missing issues on get/update/delete map to not-found category / exit 4; soft-delete fields in normalized output; comment list returns not-found when parent issue missing; bulk-update missing-issue failures classified as not-found.
Documentation and release
CHANGELOG.md, docs/commands.md, skills/linearctl/SKILL.md, package.json
Version bumped to 0.8.2; documents not-found taxonomy unification, issue soft-delete fields, comment list parent validation, and error mapping contract.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • qwrobins/linearctl#149: Introduced initial not-found detection in GraphQL error handling; this PR extends and centralizes that via mapGraphQLErrorPayload for consistent taxonomy across all commands.
  • qwrobins/linearctl#6: Introduced issue command and NormalizedIssue type; this PR extends that model with trashed/archivedAt fields and output rendering.
  • qwrobins/linearctl#38: Modified command-context.ts error rendering; this PR refactors error-exit-code mapping in the same module using the new error classification helpers.

Poem

🐰 Soft-deleted issues now show their truth,
With trashed and timestamps in living proof,
Not-found errors unified, exit code four,
No more silent fails—consistency restored!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.76% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: fixing not-found error taxonomy consistency and adding trashed issue visibility.
Linked Issues check ✅ Passed All requirements from #150 and #151 are addressed: not-found taxonomy unified across get/update/delete/bulk, trashed/archivedAt fields added to issue output, and comment list parent-existence check implemented.
Out of Scope Changes check ✅ Passed All changes directly address the linked issue requirements; no unrelated modifications detected beyond the scope of #150 and #151.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-150-151-not-found-trashed

Comment @coderabbitai help to get the list of available commands and usage tips.

@qwrobins qwrobins merged commit 861c6db into main Jun 10, 2026
2 checks passed
@qwrobins qwrobins deleted the codex/fix-150-151-not-found-trashed branch June 10, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant