Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62783

Wrong Commit ID in Pull Request Builds

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Jenkins Version 2.235.1
      multibranch-pipeline
      bitbucket-branch-source-plugin
      git-plugin
    • Similar Issues:

      Description

      We are using a multibranch pipeline set up to get the pipeline from a Jenkinfile within the repository.

      The current configuration is:
      Discover branches: Exclude branches that are also filled as PRs
      Discover pull requests from origin: Merging the pull request with the current target branch revision
      Filter by name: .master|.*release/.|.PR-. (here if I don't include the pr part no prs are built)
      Clean before checkout
      Sparse Checkout (with about 6 different paths)
      Property Strategy All branches get the same properties

      Currently on PR Builds the env variable for the commit id, and previous commit id for that matter, are not valid commits in the Bitbucket repository.
      The commit id that shows on the blue ocean page is correct, the short version of commit iv, but it is in fact the last commit on source branch.

      Is this an expected behavior?

      As a side note PR changes are not reported on the first build (should this changeset include de diff between source branch and target branch)?

        Attachments

          Activity

          Hide
          mhtouchette Marie-Helene Touchette added a comment - - edited

          I'm seeing the same behavior.

          And unfortunately, the last commit id from the change-branch (as seen in blue-ocean) is nowhere to be found in the pipeline's environment variables.

          Instead, we are stuck with an unknown commit id, probably originating from the merge being done locally in the merge-PR-branch.

          I see this as a bug...

          Show
          mhtouchette Marie-Helene Touchette added a comment - - edited I'm seeing the same behavior. And unfortunately, the last commit id from the change-branch (as seen in blue-ocean) is nowhere to be found in the pipeline's environment variables. Instead, we are stuck with an unknown commit id, probably originating from the merge being done locally in the merge-PR-branch. I see this as a bug...

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            one_random_dev Random Dev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: