Skip to content

gh pr view --json not returning date fields #3497

@frouioui

Description

@frouioui

Describe the bug

Hello 👋, I ran into this issue earlier today. The JSON payload provided by gh pr view --json does not show DateTime fields such as mergedAt, updatedAt, and createdAt.

Running on:

gh version 1.9.2 (2021-04-20)
https://github.com/cli/cli/releases/tag/v1.9.2

Steps to reproduce the behavior

  1. Execute the following command. gh pr view https://github.com/vitessio/vitess/pull/7753 --json author,assignees,title,createdAt,mergedAt,updatedAt,url
  2. Observe the output, and spot the missing value for createdAt, mergedAt, updatedAt.

Expected vs actual behavior

Command executed: gh pr view https://github.com/vitessio/vitess/pull/7753 --json author,assignees,title,createdAt,mergedAt,updatedAt,url

The output I got:

{
  "assignees": [],
  "author": {
    "login": "aquarapid"
  },
  "createdAt": "0001-01-01T00:00:00Z",
  "mergedAt": null,
  "title": "Allow modification of tablet unhealthy_threshold via debugEnv",
  "updatedAt": "0001-01-01T00:00:00Z",
  "url": "https://github.com/vitessio/vitess/pull/7753"
}

The output I should get (accurate hours and minutes of events were discarded by xs):

{
  "assignees": [],
  "author": {
    "login": "aquarapid"
  },
  "createdAt": "2021-03-27Txx:xx:xxZ",
  "mergedAt": "2021-04-22Txx:xx:xxZ",
  "title": "Allow modification of tablet unhealthy_threshold via debugEnv",
  "updatedAt": "2021-04-22Txx:xx:xxZ",
  "url": "https://github.com/vitessio/vitess/pull/7753"
}

Logs

No specific log beside the one listed above.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions