Skip to content

gh pr checks should show the CI run overall run-id. #3558

Description

@Moisan

Describe the feature or problem you’d like to solve

gh pr checks currently show the different jobs of the CI runs and their run-id. However it doesn't show the overall run-id available in the URL of the Actions tab on the website.

Proposed solution

Getting this run-id would be useful for multiple reasons, one being the possibility of downloading all artifacts at once using gh run download <run-id>.

Additional context

For example when looking at this CI run, one can see in the URL that the overall run-id is 802610070 but this information is not available in the output of gh pr checks 76377 -R Homebrew/homebrew-core.

Activity

  1. vilmibm commented on May 18, 2021

    @vilmibm
    Contributor

    Agreed that this would be helpful; in general the output of pr checks can use help.

    It'd be nice to have:

    • elapsed time
    • completion time
    • run id (since the links are for job ids, generally)

    added, combined with column headers (see: #3575 )

  2. ganboonhong commented on Jun 7, 2021

    @ganboonhong
    Contributor

    Hi @vilmibm , I would like to work on this.

    I found that elapsed time has already included in the output.

    Besides, I didn't see overall run-id field in the docs (in this case, which is 802610070). Do you mind to point out the location of the docs for me (which object does this field belong to)? Thanks.

    (Edited: I've already found the field)

  3. mislav commented on Aug 4, 2021

    @mislav
    Contributor

    I agree that it would be useful to provide extra information from pr checks, but in the interest of backwards compatibility and not changing the current table output too much, I would suggest that extra fields should be exposed by adding --json functionality to this command and having the user select which fields they are interested in.

  4. jeremyd2019 commented on Oct 15, 2021

    @jeremyd2019

    I have been wanting an option, either on gh pr or gh run download to select the latest run for a given pull request number, rather than having to look up that run id manually. This would help looking up the run id, but what I really want is to plug that directly into gh run download

  5. nitrocode commented on Feb 11, 2023

    @nitrocode

    It's a bit tricky to do this now with the gh cli. While we wait for an easier solution to be implemented, I came up with a temporary solution.

    We can use PR #6990 as an example

    $ org=cli
    $ repo=cli
    $ ref=$(gh pr view -R cli/cli 6990 --json 'commits' --jq '.commits | last | .oid')
    $ echo $ref
    b07410d48554bc39594850dc74e5384c5edca6cf
    $ gh api \
      -H "Accept: application/vnd.github+json" \
      /repos/$org/$repo/commits/$ref/check-runs \
      --jq '[ .check_runs[] | {name: .name, run_id: .details_url | capture("(?<id>[0-9]+)") | .id } ]' | jq .
    [
      ...
      {
        "name": "lint",
        "run_id": "4118227632"
      }
    ]

    Then choose a run id and view it

    $ gh run -R cli/cli view 4118227632
    ✓ remote-add-no-fetch Lint #6990 · 4118227632
    Triggered via push about 3 days ago
    
    JOBS
    ✓ lint in 2m26s (ID 11178577059)
    
    For more information about the job, try: gh run view --job=11178577059
    View this run on GitHub: https://github.com/cli/cli/actions/runs/4118227632
    
  6. added
    gh-prrelating to the gh pr command
    on Oct 2, 2023
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 CLIgh-prrelating to the gh pr command

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions