Conversation
| * When enabled, the changelog view displays both the Git author and committer | ||
| * with explicit labels, instead of showing only one identity. | ||
| * | ||
| * @since TODO |
There was a problem hiding this comment.
Could we replace the @ since TODO with the actual plugin version this API is being introduced in? The Open Tasks Scanner is currently flagging this, and the same TODO appears on the other new public APIs in this PR.
There was a problem hiding this comment.
No, we can't, because we don't know the release that will include it.
Jenkins core uses a similar technique. @since TODO is added to indicate a new API. After the release of the new API, the value is updated in the Javadoc comment
There was a problem hiding this comment.
🟡 Changes recommended
The REST test requests depth 1 while traversing changeSet.items at two locations; update those requests to depth 2.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds flag-independent Git author/committer getters and opt-in changelog rendering for both identities.
Changes:
- Exposes six exported author/committer name, email, and date getters.
- Persists display configuration and renders dual identities in full changelog views.
- Adds styling, documentation, localization, and test coverage.
File summaries
| File | Summary |
|---|---|
src/test/java/hudson/plugins/git/GitChangeSetSimpleTest.java |
GitChangeSet behavior coverage. |
src/test/java/hudson/plugins/git/GitChangeSetListTest.java |
Changelog list configuration and serialization coverage. |
src/test/java/hudson/plugins/git/GitChangeSetIdentityTest.java |
Identity getters and REST export coverage. |
src/test/java/hudson/plugins/git/GitChangeSetEuroTest.java |
Git identity and date parsing coverage. |
src/test/java/hudson/plugins/git/GitChangeSetEmptyTest.java |
Empty-change-set regression coverage. |
src/test/java/hudson/plugins/git/GitChangeSetBasicTest.java |
Basic GitChangeSet regression coverage. |
src/test/java/hudson/plugins/git/extensions/impl/ShowAuthorAndCommitterInChangelogTest.java |
Extension configuration and rendering coverage. |
src/main/resources/hudson/plugins/git/styles.css |
Styles dual-identity labels. |
src/main/resources/hudson/plugins/git/GitChangeSetList/index.properties |
Adds localized identity labels. |
src/main/resources/hudson/plugins/git/GitChangeSetList/index.jelly |
Renders both identities in full changelog views. |
src/main/resources/hudson/plugins/git/extensions/impl/ShowAuthorAndCommitterInChangelog/help.html |
Documents the opt-in extension. |
src/main/java/hudson/plugins/git/GitSCM.java |
Detects the display extension. |
src/main/java/hudson/plugins/git/GitChangeSetList.java |
Stores the display setting. |
src/main/java/hudson/plugins/git/GitChangeSet.java |
Adds author/committer getters. |
src/main/java/hudson/plugins/git/GitChangeLogParser.java |
Propagates display configuration. |
src/main/java/hudson/plugins/git/extensions/impl/ShowAuthorAndCommitterInChangelog.java |
Defines the opt-in extension. |
README.adoc |
Documents configuration and APIs. |
Review details
Suppressed comments (3)
src/main/java/hudson/plugins/git/GitChangeSet.java:309
- The behavior here is controlled by the
authorOrCommitterconstructor flag, not by whether anAuthorInChangelogextension is present.GitChangeSethas public constructors that can set this flag directly, so describing the result only in terms of the extension makes this API documentation incorrect for direct callers; use the flag in these descriptions (and the analogousgetAuthor*Javadocs).
/**
* Returns the committer date by default, or the author date when
* {@link hudson.plugins.git.extensions.impl.AuthorInChangelog} is enabled.
src/main/java/hudson/plugins/git/GitChangeSet.java:338
- This Javadoc describes
getTimestamp()as returning a date, but the method returns alongepoch-millisecond timestamp. It also attributes the selection to an extension even though the public constructor flag controls it; document the selected timestamp and its units instead.
/**
* Returns the committer date by default, or the author date when
* {@link hudson.plugins.git.extensions.impl.AuthorInChangelog} is enabled.
*
* @see #getDate()
* @see #getGitAuthorDate()
* @see #getGitCommitterDate()
*/
src/test/java/hudson/plugins/git/GitChangeSetIdentityTest.java:261
- This request uses
depth=1but the assertions traverse two nested levels (changeSet.items). The depth-limited Jenkins export does not include the items array at this depth, so the test fails while reading the JSON; the REST example in the PR usesdepth=2. Request depth 2 here as well.
Page page = r.createWebClient().goTo(build.getUrl() + "api/json?depth=1", "application/json");
- Files reviewed: 17/18 changed files
- Comments generated: 6
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Fixes #3831
Related #2670 #2170 #3777
GitChangeSetparse both author and committer from every git commit, but both fields are private, the only way to read identity is throughgetAuthor()(plusgetAuthorEmail()/getTimestamp/Date()), which return one identity selected by theauthorOrCommitterflag. TheChangeLogSet.Entryinterface only covers a single identity and a single timestamp, so git-plugin picked one and the other was unreachable. The flag default is intentional and unchanged to avoid behavior regressions.Flag-independent identity getters
getGit{Author/Committer}{Name/Email/Date}six new@Exportedmethods onGitChangeSet.These always return the raw Git field regardless of
authorOrCommitter. No side effects from any extension.getAuthor()is unchanged, only its Javadoc is updated to make the existing flag behavior explicit.Changelog UI extension (opt-in, second commit)
Important
This second commit can be reverted or extracted to a follow-up PR without affecting the API getters.
It is included here as a concrete, working example of what the new API enables, e.g., making the rebase-merge commits immediately visible to developers browsing build changes.
A new
ShowAuthorAndCommitterInChangelogextension, mirroring the existingauthorOrCommitterpattern.When enabled and author name differs from committer name, the changelog shows "authored by X · committed by Y". When identities match or the extension is absent, rendering is identical to today.
The extension does not affect
getAuthor(). The two concerns are independent:AuthorInChangelogcontrols which identity Jenkins propagates as the SCM entry author to other plugin consumers;ShowAuthorAndCommitterInChangelogonly controls whether the UI displays both.Note
The flag is resolved at parse time. The result is stored in
GitChangeSetListas a serialized field. Enabling or disabling the extension after a build has no effect on that build's changelog, only new builds pick up the change.Compact mode (build summary widget, project Changes view) suppresses dual labels. Only the full Build / Changes page shows them.
Avatar: when both identities are shown the avatar still resolves from
getAuthor(). Known gap, not practical to fix in Jelly without side effects.Testing done
Tested locally with
mvn hpi:runand a repo where some commits have author ≠ committer.Extension enabled. Changes page:
REST API:
{ "msg": "commit different identity", "gitAuthorName": "Alice Author", "gitAuthorEmail": "alice@example.com", "gitAuthorDate": "2026-08-01 09:15:00 +0200", "gitCommitterName": "GitHub Merge Bot", "gitCommitterEmail": "noreply@github.com", "gitCommitterDate": "2026-08-09 00:55:13 +0200" }Submitter checklist