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

feat(pr-status): add build status to pr-status list table #129

Merged

Conversation

jorgedc93
Copy link
Contributor

@jorgedc93 jorgedc93 commented Mar 13, 2024

Adding the Build status to the pr-status list command using the StatusCheckRollup field from the github pr status command.

StatusCheckRollup contains a list with all the checks for the PR and their statuses, this is an example from a real PR with the pipeline failing:

"statusCheckRollup": [
        {
          "__typename": "StatusContext",
          "context": "continuous-integration/drone/pr",
          "startedAt": "2024-03-13T10:11:57Z",
          "state": "FAILURE",
          "targetUrl": "url"
        },
        {
          "__typename": "CheckRun",
          "completedAt": "2024-03-13T09:58:08Z",
          "conclusion": "SUCCESS",
          "detailsUrl": "url",
          "name": "Dependabot config validation",
          "startedAt": "2024-03-13T09:58:08Z",
          "status": "COMPLETED",
          "workflowName": ""
        },
        {
          "__typename": "CheckRun",
          "completedAt": "2024-03-13T09:58:05Z",
          "conclusion": "SUCCESS",
          "detailsUrl": "url",
          "name": "Security Rules Check",
          "startedAt": "2024-03-13T09:58:05Z",
          "status": "COMPLETED",
          "workflowName": ""
        },
        {
          "__typename": "StatusContext",
          "context": "license/snyk (Skyscanner)",
          "startedAt": "2024-03-13T09:58:06Z",
          "state": "SUCCESS",
          "targetUrl": "url"
        },
        {
          "__typename": "StatusContext",
          "context": "security/snyk (Skyscanner)",
          "startedAt": "2024-03-13T09:58:06Z",
          "state": "SUCCESS",
          "targetUrl": "url"
        }
      ],

And this is an example of what the pr-status list would look like now:

  Repository  State   Reviews          Build status  URL
org/repo1   OPEN    REVIEW_REQUIRED  FAILURE
org/repo2   MERGED  APPROVED         SUCCESS
org/repo3   CLOSED                   FAILURE

State        Count
Merged       1
Open         1
Closed       1
Skipped      0
No PR Found  0

Reactions: 👍 4   👎 3   🚀 1

Copy link

@jorgefloresr jorgefloresr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏼

cmd/prstatus/prstatus.go Outdated Show resolved Hide resolved
@jorgedc93 jorgedc93 force-pushed the add_build_status_to_prstatus_table branch from 53b6cb9 to b7d713f Compare March 14, 2024 08:10
rnorth
rnorth previously approved these changes May 20, 2024
Copy link
Collaborator

@rnorth rnorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@rnorth rnorth requested a review from olliecurtis May 20, 2024 14:15
Copy link
Contributor

@sledigabel sledigabel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Dan7-7-7 Dan7-7-7 changed the title Add build status to pr-status list table feat(pr-status): add build status to pr-status list table Jun 11, 2024
@Dan7-7-7 Dan7-7-7 merged commit f0b8dc4 into Skyscanner:main Jun 11, 2024
5 checks passed
@jorgedc93 jorgedc93 deleted the add_build_status_to_prstatus_table branch June 24, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants