Conversation
There was a problem hiding this comment.
Pull request overview
Expands Linear issue payloads produced by the core gateway and updates CLI output handling so --fields also projects JSON output while preserving pagination metadata (e.g. nextCursor).
Changes:
- Enrich
IssueRecordwith state identifiers/types, creator metadata, structured labels, and completion/cancellation/archive timestamps. - Update
LinearGatewayissue mapping to populate the new fields (including structuredlabels). - Apply
--fieldsprojection to JSON envelopes in the CLI formatter while keeping page-level metadata intact; update/extend tests accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/linear-core/tests/v2-gateway.test.ts | Adds assertion for structured issue.labels in v2 gateway issue detail. |
| packages/linear-core/tests/linear-gateway.test.ts | Extends test fixtures + assertions for new issue fields (state id/type, creator, timestamps). |
| packages/linear-core/src/entities/models.ts | Extends IssueRecord and introduces IssueLabelSummary for richer issue output typing. |
| packages/linear-core/src/entities/linear-gateway.ts | Populates new issue fields (creator, state metadata, structured labels, timestamps) in toIssue. |
| packages/cli/tests/output.test.ts | Adds coverage for JSON field projection preserving nextCursor. |
| packages/cli/src/index.ts | Updates --fields help text to reflect JSON + human output behavior. |
| packages/cli/src/formatters/output.ts | Implements JSON data projection for --fields while preserving page structure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+125
to
+137
| function isSensitiveJsonKey(key: string): boolean { | ||
| const normalized = key.toLowerCase().replace(/[^a-z0-9]/g, ""); | ||
| return ( | ||
| normalized.includes("apikey") || | ||
| normalized.includes("password") || | ||
| normalized.includes("secret") || | ||
| normalized.includes("token") || | ||
| normalized.includes("authorizationurl") || | ||
| normalized.includes("clientid") || | ||
| normalized.includes("redirecturi") || | ||
| normalized.includes("scope") || | ||
| normalized.includes("codeverifier") | ||
| ); |
Comment on lines
+133
to
+136
| normalized.includes("clientid") || | ||
| normalized.includes("redirecturi") || | ||
| normalized.includes("scope") || | ||
| normalized.includes("codeverifier") |
Comment on lines
+218
to
+231
| function projectJsonData(data: unknown, fields: readonly string[]): unknown { | ||
| if (Array.isArray(data)) { | ||
| return data.map((item) => (isRecord(item) ? pickFields(item, fields) : item)); | ||
| } | ||
|
|
||
| if (isPageResult(data)) { | ||
| return { | ||
| ...data, | ||
| items: data.items.map((item) => (isRecord(item) ? pickFields(item, fields) : item)), | ||
| }; | ||
| } | ||
|
|
||
| if (isRecord(data)) { | ||
| return pickFields(data, fields); |
|
🎉 This PR is included in version 1.5.0-alpha.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR expands issue output with state IDs/types, creator details, structured labels, and completion/cancellation/archive timestamps from the Linear gateway.
It also makes
--fieldsapply to JSON output while preserving page metadata likenextCursor.Tests cover JSON field projection and the new gateway issue fields.
Validation:
pnpm verify.