Uploaded image for project: 'Yetus'
  1. Yetus
  2. YETUS-1022

Get commit sha from github PR json

Details

    • Hide
      <!-- markdown -->
      Git SHAs should now be more consistent on repositories hosted on GitHub, especially when running on Jenkins.
      Show
      <!-- markdown --> Git SHAs should now be more consistent on repositories hosted on GitHub, especially when running on Jenkins.

    Description

      For some CI systems (Jenkins), the merge strategy sets the commit sha to the local sha, not the one in GitHub. github plug-in should probably always override our internal variable if we've been given a github PR number.

      Attachments

        Issue Links

          Activity

            Started playing more with GitHub App support on Jenkins today. Branches appeared to be working fine after re-configuring the Jenkinsfile to point to the GitHub App token rather than the PAT I was using. Statuses still failed, which was a bit unexpected. Digging into further I discovered that:

            • Jenkins GIT_COMMIT variable was pointed to something that didn't match GitHub
            • GitHub API was (correctly) returning a 422

            422 was a HUGE clue as to what was going on. It's not a "permission denied" error: it is a "what was passed was formatted correctly and are allowed to do that, but what was sent was non-sensical." Looking at what test-patch sent and what was in the repo, it became clear that test-patch was trying to give status on a sha that didn't exist in github's view of that repo.

            aw Allen Wittenauer added a comment - Started playing more with GitHub App support on Jenkins today. Branches appeared to be working fine after re-configuring the Jenkinsfile to point to the GitHub App token rather than the PAT I was using. Statuses still failed, which was a bit unexpected. Digging into further I discovered that: Jenkins GIT_COMMIT variable was pointed to something that didn't match GitHub GitHub API was (correctly) returning a 422 422 was a HUGE clue as to what was going on. It's not a "permission denied" error: it is a "what was passed was formatted correctly and are allowed to do that, but what was sent was non-sensical." Looking at what test-patch sent and what was in the repo, it became clear that test-patch was trying to give status on a sha that didn't exist in github's view of that repo.

            So put up a PR that fixes this as well as documents more about what is needed to get test-patch to work better under Jenkins, some general github token stuff, etc since it is all sort of related.

            aw Allen Wittenauer added a comment - So put up a PR that fixes this as well as documents more about what is needed to get test-patch to work better under Jenkins, some general github token stuff, etc since it is all sort of related.

            Approved by aajisaka, so merged in

            aw Allen Wittenauer added a comment - Approved by aajisaka , so merged in

            People

              aw Allen Wittenauer
              aw Allen Wittenauer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m