Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils/github: get artifact from last run #14564

Merged
merged 1 commit into from Feb 9, 2023

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Feb 9, 2023

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Probably want someone more familiar with API to make sure.

I think the list is in order from oldest run to newest run.


Specifically saw an issue when merging Homebrew/homebrew-core#121077, which had 2 runs due to dropping a commit. The wrong bottles.zip was uploaded Homebrew/homebrew-core@0eac664


Similar issue in Homebrew/homebrew-core#116350. Due to PR getting closed and re-opened, there were 2 runs. The 1st run with only a single bottle got uploaded Homebrew/homebrew-core@0896128 rather than 2nd run with all bottles.


gh api graphql example
gh api graphql -F user='Homebrew' -F repo='homebrew-core' -F pr=121077 -f query='
      query ($user: String!, $repo: String!, $pr: Int!) {
        repository(owner: $user, name: $repo) {
          pullRequest(number: $pr) {
            commits(last: 1) {
              nodes {
                commit {
                  checkSuites(first: 100) {
                    nodes {
                      status,
                      workflowRun {
                        databaseId,
                        url,
                        workflow {
                          databaseId
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
'

{
  "data": {
    "repository": {
      "pullRequest": {
        "commits": {
          "nodes": [
            {
              "commit": {
                "checkSuites": {
                  "nodes": [
                    {
                      "status": "COMPLETED",
                      "workflowRun": {
                        "databaseId": 3964467999,
                        "url": "https://github.com/Homebrew/homebrew-core/actions/runs/3964467999",
                        "workflow": {
                          "databaseId": 2978613
                        }
                      }
                    },
                    {
                      "status": "COMPLETED",
                      "workflowRun": {
                        "databaseId": 3964468098,
                        "url": "https://github.com/Homebrew/homebrew-core/actions/runs/3964468098",
                        "workflow": {
                          "databaseId": 645528
                        }
                      }
                    },
                    {
                      "status": "COMPLETED",
                      "workflowRun": {
                        "databaseId": 3964748033,
                        "url": "https://github.com/Homebrew/homebrew-core/actions/runs/3964748033",
                        "workflow": {
                          "databaseId": 2978613
                        }
                      }
                    },
                    {
                      "status": "COMPLETED",
                      "workflowRun": {
                        "databaseId": 3964748075,
                        "url": "https://github.com/Homebrew/homebrew-core/actions/runs/3964748075",
                        "workflow": {
                          "databaseId": 645528
                        }
                      }
                    }
                  ]
                }
              }
            }
          ]
        }
      }
    }
  }
}

@BrewTestBot
Copy link
Member

Review period will end on 2023-02-10 at 02:29:12 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Feb 9, 2023
@cho-m cho-m marked this pull request as ready for review February 9, 2023 02:30
@MikeMcQuaid MikeMcQuaid added the critical Critical change which should be shipped as soon as possible. label Feb 9, 2023
@MikeMcQuaid
Copy link
Member

Thanks @cho-m!

@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Feb 9, 2023
@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

@MikeMcQuaid MikeMcQuaid merged commit e6548a8 into Homebrew:master Feb 9, 2023
@cho-m cho-m deleted the github-api-last-run branch February 11, 2023 19:06
@github-actions github-actions bot added the outdated PR was locked due to age label Mar 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants