Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

janfaracik
Copy link
Member

@janfaracik janfaracik commented Jan 17, 2025

2.504.1 introduced a new Detail API, allowing core and plugin developers to attach details and groups to objects in Jenkins. This is currently only used by Run in core.

This PR adds relevant Git info to ScmDetailGroup, provided by scm-api-plugin.

Description

For branches show:

Screenshot 2025-09-26 at 08 10 32

For pull requests show:

Screenshot 2025-09-26 at 08 11 06

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Automated tests have been added to exercise the changes
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

  • Run the changes and verify that the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

Documentation changes

  • Link to jenkins.io PR, or an explanation for why no doc changes are needed

Users/aliases to notify

SCMRevisionAction scmRevisionAction = getObject().getAction(SCMRevisionAction.class);
SCMRevision revision = scmRevisionAction.getRevision();

if (revision instanceof AbstractGitSCMSource.SCMRevisionImpl abstractRevision) {
Copy link
Member

Choose a reason for hiding this comment

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

potentially belongs in the Git plugin? and then this plugin only handles the pull request one?

Although not sure if you could figure out the link from there, maybe you can though?

<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>github-api</artifactId>
</dependency>
<dependency>
Copy link
Member Author

Choose a reason for hiding this comment

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

Needs to be removed when scm-api has been released.

@janfaracik janfaracik marked this pull request as ready for review September 26, 2025 07:17
@janfaracik janfaracik requested a review from a team as a code owner September 26, 2025 07:17
@janfaracik
Copy link
Member Author

Opening for review to get thoughts.

Is the information we show the right information - e.g. is commit hash needed?

Is my usage of the API correct/are there more efficient ways of doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants