fix: normalize issue +list output to use project-level issue numbers #31

Merged
wbtiger merged 1 commits from fix/issue-list-normalize-ids into master 2026-05-24 01:04:32 +08:00
Member

Summary

The issue +list JSON output was a raw API pass-through, which made the database-level id field (e.g., 142625) the most prominent identifier. This is confusing because all other issue commands (+view, +close, +update, +comment) use --number which maps to project_issues_index (the per-project sequential number shown in the web URL, e.g., 18).

Changes

  • Each issue in the +list output now includes a number field copied from project_issues_index
  • The id field is renamed to database_id to clarify it is the global database primary key
  • The project_issues_index field is preserved for backward compatibility

Before

{
  "id": 142625,
  "project_issues_index": 18,
  "subject": "..."
}

After

{
  "number": 18,
  "database_id": 142625,
  "project_issues_index": 18,
  "subject": "..."
}

Test plan

  • go build ./... passes
  • go test ./... — all existing tests pass
  • Manual verification: gitlink-cli issue +list shows number matching the web URL
## Summary The issue `+list` JSON output was a raw API pass-through, which made the database-level `id` field (e.g., `142625`) the most prominent identifier. This is confusing because all other issue commands (`+view`, `+close`, `+update`, `+comment`) use `--number` which maps to `project_issues_index` (the per-project sequential number shown in the web URL, e.g., `18`). ## Changes - Each issue in the `+list` output now includes a `number` field copied from `project_issues_index` - The `id` field is renamed to `database_id` to clarify it is the global database primary key - The `project_issues_index` field is preserved for backward compatibility ### Before ```json { "id": 142625, "project_issues_index": 18, "subject": "..." } ``` ### After ```json { "number": 18, "database_id": 142625, "project_issues_index": 18, "subject": "..." } ``` ## Test plan - [x] `go build ./...` passes - [x] `go test ./...` — all existing tests pass - [x] Manual verification: `gitlink-cli issue +list` shows `number` matching the web URL
wbtiger added 1 commit 2026-05-24 01:00:06 +08:00
64c0ff3cb5 Normalize issue +list output to use project-level issue numbers
The API returns both "id" (global database PK) and "project_issues_index"
(per-project sequential number). The +list JSON output was a raw API
pass-through, making the database ID the most prominent identifier.

This change normalizes each issue in the list:
- Add "number" field from project_issues_index (matches the web URL)
- Rename "id" to "database_id" to prevent confusion

The "number" field now matches the --number flag used by +view, +close,
+update, and +comment commands.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
wbtiger merged commit a46e06b78a into master 2026-05-24 01:04:32 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#31
No description provided.