jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-44562] getTrustedRevision for a non-merge untrusted PR build should be common ancestor with base branch

Open
#1,084 1 comment 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

As danielbeck noted, after PR 2890, some builds of PRs previously open failed, because they were loading Jenkinsfile from current master (where it expects a settings-azure.xml), but checking out scm from the PR head where this file does not exist. For example, PR-2903 #1 failed because the PR head commit was derived from a8994d4fa55eb4f5ba1b5a60837876c8107eeb95, long predating the merge of #2890. That should have been the PullRequestSCMRevision.baseHash. Instead it loaded from dd18af378f014e1aae706c0bb300bcb0f66342a9, after the merge, and thus not a common ancestor of the PR and the base branch. Did GitHub misreport the .base.sha, or is this field not in fact appropriate for the purpose? It is hard to tell in this example now, because the PR was already updated to merge with master.

---
Originally reported by jglick, imported from: getTrustedRevision for a non-merge untrusted PR build should be common ancestor with base branch


  • status: Open
  • priority: Major
  • component(s): github-branch-source-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-02

Raw content of original issue

As danielbeck noted, after PR 2890, some builds of PRs previously open failed, because they were loading Jenkinsfile from current master (where it expects a settings-azure.xml), but checking out scm from the PR head where this file does not exist. For example, PR-2903 #1 failed because the PR head commit was derived from a8994d4fa55eb4f5ba1b5a60837876c8107eeb95, long predating the merge of #2890. That should have been the PullRequestSCMRevision.baseHash. Instead it loaded from dd18af378f014e1aae706c0bb300bcb0f66342a9, after the merge, and thus not a common ancestor of the PR and the base branch. Did GitHub misreport the .base.sha, or is this field not in fact appropriate for the purpose? It is hard to tell in this example now, because the PR was already updated to merge with master.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.