Skip to content

gh pr checks should show output summary of checks #5634

Description

@jgrumboe

Describe the feature or problem you’d like to solve

In GitHub UI I see summaries to checks run by Terraform Cloud for a pull request.
image

The command gh pr checks for the same PR looks like this:
image

I would like to see the summary Terraform plan: 6 to add, 0 to change, 0 to destroy. when running gh pr checks (maybe also with some --summary option).

Proposed solution

gh pr checks --summary could be a proposal to show the summary for each check. Maybe a new column before the links.

Additional context

Use case for me is to auto-approve pull requests where the summary output of each check is Terraform plan has no changes.

Activity

  1. added
    discussFeature changes that require discussion primarily among the GitHub CLI team
    and removed on May 16, 2022
  2. mislav commented on May 25, 2022

    @mislav
    Contributor

    Thanks for the feature request. We like this idea, and we agree that it would be useful to expose this text in the CLI. We're not sure about the name --summary, though, as "job summaries" are something different.

    I wonder which API field exposes the text Terraform plan has no changes come from. Might it be the title field?

    @jgrumboe Could you check by doing a manual API query on your end and report back:

    # 1. replace "123" with your PR number
    # 2. optionally replace "{owner}" and "{repo}" with your repository information
    gh api graphql -F owner='{owner}' -F repo='{repo}' -F pr=123 -f query='
    query ($owner: String!, $repo: String!, $pr: Int!) {
    	repository(owner: $owner, name: $repo) {
    		pullRequest(number: $pr) {
    			commits(last: 1) {
    				nodes {
    					commit {
    						statusCheckRollup {
    							state
    							contexts(first: 100) {
    								nodes {
    									__typename
    									... on CheckRun {
    										name
    										checkSuite {
    											workflowRun{workflow{name}}
    										}
    										text
    										title
    									}
    								}
    							}
    						}
    					}
    				}
    			}
    		}
    	}
    }
    '
  3. added
    more-info-neededMore info needed from user/contributor
    and removed
    discussFeature changes that require discussion primarily among the GitHub CLI team
    on May 25, 2022
  4. jgrumboe commented on May 25, 2022

    @jgrumboe
    ContributorAuthor

    Hi @mislav

    The output for one example PR is as follows:

    {
      "data": {
        "repository": {
          "pullRequest": {
            "commits": {
              "nodes": [
                {
                  "commit": {
                    "statusCheckRollup": {
                      "state": "SUCCESS",
                      "contexts": {
                        "nodes": [
                          {
                            "__typename": "StatusContext"
                          },
                          {
                            "__typename": "StatusContext"
                          },
                          {
                            "__typename": "StatusContext"
                          },
                          {
                            "__typename": "StatusContext"
                          },
                          {
                            "__typename": "StatusContext"
                          },
                          {
                            "__typename": "StatusContext"
                          },
                          {
                            "__typename": "StatusContext"
                          },
                          {
                            "__typename": "StatusContext"
                          }
                        ]
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      }
    }
    

    Does this help?

  5. mislav commented on Jun 21, 2022

    @mislav
    Contributor

    @jgrumboe Yeah that helps. Thank you!

  6. mislav commented on Jun 27, 2022

    @mislav
    Contributor

    Possibly related report: #3739

  7. jgrumboe commented on Jul 10, 2022

    @jgrumboe
    ContributorAuthor

    @mislav is there something I can help with?

  8. sspaeth-r7 commented on Mar 28, 2023

    @sspaeth-r7

    I too agree this feature would be extremely helpful for a similar use case. Anything we can do to help?

  9. vilmibm commented on Mar 28, 2023

    @vilmibm
    Contributor

    For tickets marked help wanted, feel free to announce intent to work on a thing and ask specific questions about implementation as needed.

  10. jgrumboe commented on May 16, 2023

    @jgrumboe
    ContributorAuthor

    @vilmibm I created #7451 to add my requested feature. It was more than luck today that I read about GH_DEBUG=api and found this, for me, simple solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions