Skip to content

gh pr view --json files does not return files #3561

@austindrenski

Description

@austindrenski

Describe the bug

The PullRequest type has a Files field, but it is not populated by gh pr view --json files. It appears that this is simply due to the fact that files is not included in any of the GraphQL queries.

For a proof of concept, I updated the queries to include files in austindrenski#2, but assume that this would be better addressed as part of @mislav's work in #3547.

Steps to reproduce the behavior

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

$ gh pr view 3557 --json files
{
  "files": null
}

After building with the patch from austindrenski#2:

$ bin/gh.exe pr view 3557 --json files
{
  "files": [
    {
      "path": "pkg/cmd/root/help_topic.go",
      "additions": 2,
      "deletions": 2
    },
    {
      "path": "pkg/cmdutil/repo_override.go",
      "additions": 2,
      "deletions": 0
    },
    {
      "path": "pkg/cmdutil/repo_override_test.go",
      "additions": 64,
      "deletions": 0
    }
  ]
}

Expected vs actual behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions