Skip to content

Add getComment() to ChangeLogSet.Entry#26347

Open
0xShubhamSolanki wants to merge 1 commit intojenkinsci:masterfrom
0xShubhamSolanki:JENKINS-49202-add-getComment
Open

Add getComment() to ChangeLogSet.Entry#26347
0xShubhamSolanki wants to merge 1 commit intojenkinsci:masterfrom
0xShubhamSolanki:JENKINS-49202-add-getComment

Conversation

@0xShubhamSolanki
Copy link

@0xShubhamSolanki 0xShubhamSolanki commented Feb 22, 2026

Fixes #22542

Adds a new getComment() method to ChangeLogSet.Entry to expose the full commit message.

Currently, only getMsg() is available, which typically returns the short commit message.
Some integrations and API consumers require access to the full commit message.

The default implementation of getComment() returns getMsg() to preserve backward compatibility and existing behavior.
SCM implementations may override this method if they provide a distinct full commit message.

Testing done

Built Jenkins core locally with JDK 21.

mvn -pl core clean verify

Added automated unit test ChangeLogSetEntryTest which verifies:

  • getComment() returns the same value as getMsg() by default.
  • getComment() can be overridden by concrete SCM implementations.

The test includes a concrete anonymous subclass of ChangeLogSet.Entry to simulate real SCM implementations overriding the method.

Confirmed that:

  • No existing behavior was modified.
  • No UI behavior was changed.
  • getMsgAnnotated() continues to work as expected.
  • Build, Checkstyle, Spotless, and SpotBugs all pass.

Screenshots (UI changes only)

Before

N/A

After

N/A

Proposed changelog entries

  • Expose full commit message via getComment() in ChangeLogSet.Entry.

Proposed changelog category

/label developer

Proposed upgrade guidelines

N/A

Submitter checklist

  • The issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate.
  • There is automated testing.
  • The new public method is annotated with @Exported and @since 2.552.
  • No UI or dependency changes were introduced.
  • For the new API method, there is at least one consumer (unit test simulating SCM override).

Desired reviewers

@MarkEWaite

@comment-ops-bot comment-ops-bot bot added the developer Changes which impact plugin developers label Feb 22, 2026
@MarkEWaite MarkEWaite changed the title JENKINS-49202: Add getComment() to ChangeLogSet.Entry Add getComment() to ChangeLogSet.Entry Feb 22, 2026
@MarkEWaite MarkEWaite marked this pull request as draft February 22, 2026 00:39
@MarkEWaite
Copy link
Contributor

I've converted the pull request to draft because you've made several mistakes that need to be corrected before anyone reviews the pull requests. Those mistakes include:

  • Did not complete the full pull request template. Restore the pull request template and complete it, including a detailed description of how you interactively confirmed the new functionality is working
  • Did not provide tests for the newly added method
  • Did not provide at least one implementation that uses the newly added method
  • Made unrelated and unnecessary changes in the pull request. Reduce the pull request to its minimum impact. Remove the unnecessary and unrelated changes

If those steps are not taken promptly, I'll close the pull request as wasting maintainer time. In the future, pull requests like this will one will be immediately closed.

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Requesting changes based on my previous comment

@0xShubhamSolanki
Copy link
Author

Thank you for the detailed feedback.
I will update the PR to include proper tests, restore the template, remove unrelated changes, and provide at least one usage example of the new method.

@0xShubhamSolanki 0xShubhamSolanki force-pushed the JENKINS-49202-add-getComment branch from 781e013 to 05e4925 Compare February 23, 2026 10:58
@0xShubhamSolanki 0xShubhamSolanki force-pushed the JENKINS-49202-add-getComment branch from 05e4925 to 16a86d5 Compare February 23, 2026 14:06
@0xShubhamSolanki 0xShubhamSolanki marked this pull request as ready for review February 23, 2026 22:25
@0xShubhamSolanki
Copy link
Author

@MarkEWaite
I have addressed the requested changes, restored the PR template, removed unrelated changes, added proper tests and usage example, and rebased the branch.
Kindly let me know if any further changes are required.

@MarkEWaite
Copy link
Contributor

@MarkEWaite I have addressed the requested changes, restored the PR template, removed unrelated changes, added proper tests and usage example, and rebased the branch. Kindly let me know if any further changes are required.

Thanks. I will be on vacation for the next two weeks, so won't be reviewing pull requests in any significant way. I'll review this after I return from vacation.

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

Labels

developer Changes which impact plugin developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JENKINS-49202] ChangeLogSet.Entry does not expose getComment to get entire commit message

2 participants