[JENKINS-75285] Make SSH repository URLs clickable in build summary#3925
[JENKINS-75285] Make SSH repository URLs clickable in build summary#3925Anshul-target wants to merge 4 commits intojenkinsci:masterfrom
Conversation
Make SSH repository URLs clickable in build summaryi SSH repository URLs (like git@github.com:user/repo.git) were displayed as plain text in the build summary page, while HTTPS URLs were clickable. This made it difficult to quickly navigate to the repository from builds using SSH URLs. Added getRepositoryBrowserUrl() method to BuildData class that converts SSH URLs to HTTP URLs using the configured Git browser. Updated the summary.jelly template to use this method for creating hyperlinks. When a Git browser is configured, SSH URLs are now converted to their corresponding web viewer URLs and displayed as clickable links, matching the existing behavior for HTTPS URLs. If no browser is configured, the original URL is displayed as before.
|
I don't review pull requests that are not passing checks. You have a spotbugs warning that indicates you did not run I am not yet persuaded that I'm willing to extend BuildData with the repository URL. BuildData has been a source of issues for retaining too much data. |
There was a problem hiding this comment.
Pull request overview
This PR aims to make SSH Git repository URLs (e.g. git@github.com:org/repo.git) clickable in the Jenkins build summary by resolving them to an HTTP(S) repository browser URL when a Git browser is configured.
Changes:
- Added
BuildData#getRepositoryBrowserUrl(String)(and a helper SCM lookup) to provide an HTTP(S) link target for repositories. - Updated
BuildData/summary.jellyto use the new helper when rendering repository links. - Added unit tests covering null and “no owning run” fallback behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/main/java/hudson/plugins/git/util/BuildData.java |
Adds a Jelly-facing helper to resolve repository URLs via configured Git browser and a GitSCM lookup helper. |
src/main/resources/hudson/plugins/git/util/BuildData/summary.jelly |
Switches summary rendering to prefer a browser-derived HTTP(S) URL when available. |
src/test/java/hudson/plugins/git/util/BuildDataTest.java |
Adds tests for null URL and fallback paths when no owning run is present. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add @checkfornull annotations for nullability clarity - Apply fix to both summary.jelly and index.jelly for consistency - Add null safety check in getGitSCM method - Remove basic unit tests - will rely on manual testing
|
Hi @MarkEWaite, please check my pr i have fixed the spotbugs issue |
Description
Fixes SSH repository URLs not being clickable in the build summary page when a Git browser is configured.
Problem:
Currently, the build summary page only creates hyperlinks for repository URLs that start with
httporhttps. SSH URLs (likegit@github.com:user/repo.git) are displayed as plain text, making it difficult to quickly navigate to the repository web viewer.Solution:
Added
getRepositoryBrowserUrl()method toBuildDataclass that converts SSH URLs to their corresponding HTTP URLs using the configured Git browser. Updatedsummary.jellytemplate to use this method when creating hyperlinks.Changes Made
getRepositoryBrowserUrl()method toBuildData.javato convert SSH URLs to browser URLsgetGitSCM()helper method to retrieve GitSCM configuration from the buildsummary.jellyto use browser URL for SSH repositories when availableTesting done
Manual Testing:
git@github.com:Anshul-target/NoteBackendhttps://github.com/Anshul-target/NoteBackend/Before (Bug):

After (Fixed):
Automated Testing:
BuildDataTest.javato verify:Test execution:
Submitter checklist
Related Issues