Skip to content

Conversation

@timja
Copy link
Member

@timja timja commented Oct 16, 2025

Adds a commit link to the build page with experimental UI - relates to jenkinsci/github-branch-source-plugin#826

Testing done

Enabled experimental flag for build redesign on latest weekly.
Setup two pipelines with a pipeline hosted on GitHub.
One using GitHub SCM and one with GitSCM.

GitSCM now has a commit detail whereas before it had nothing.
GitHub branch jobs have a duplicate detail as github-branch-source is adding GitSCM details but that can be removed
GitHub Pull request jobs don't have a duplicate as the pull request scm fails an instanceof check and the git plugin doesn't add another details entry

Untested but non github based jobs should either have no link, or use the configured repository browser / the plugin will use the pre-existing guess method too


I can add some integration tests but want to check the direction so far

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@timja timja added the enhancement Improvement or new feature label Oct 16, 2025
}

@CheckForNull
public GitRepositoryBrowser guessBrowser() {
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure about this, I couldn't find any way to get to the Repository Browser from a SCMSource.

The existing getBrowser() in this class just returns null.
Javadoc says it should then fallback to the auto browser, which seems to no longer exist / is disabled by default.

I've copied the guess implementation from GitSCM as I can't see a way to go from a SCMSource to an SCM.

WorkflowRun does have a getSCMs method and its possible to get there that way.

@timja timja requested a review from MarkEWaite October 16, 2025 11:04
@github-actions github-actions bot added the tests Automated test addition or improvement label Oct 16, 2025
class GitCommitDetailTest {

@Test
void testIsHiddenIfNoScm(JenkinsRule j) throws Exception {
Copy link
Member Author

Choose a reason for hiding this comment

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

I've got more tests locally but really struggling to get the right APIs =/
Will see how I get on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement or new feature tests Automated test addition or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant