Add additional debug logging to onNotifyCommit#3929
Open
MarkRx wants to merge 1 commit intojenkinsci:masterfrom
Open
Add additional debug logging to onNotifyCommit#3929MarkRx wants to merge 1 commit intojenkinsci:masterfrom
MarkRx wants to merge 1 commit intojenkinsci:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds more detailed debug logging to GitStatus.JenkinsAbstractProjectListener#onNotifyCommit to help troubleshoot why notifyCommit events do (or do not) trigger builds in Jenkins jobs.
Changes:
- Adds FINER/FINEST logs while comparing the notified URI against configured repository URIs and while checking branch specs.
- Adds FINER logs explaining why a potential match was skipped (no repo match, ignore-notify enabled, no branch match).
- Adds FINER timing log summarizing notification processing duration.
Comments suppressed due to low confidence (1)
src/main/java/hudson/plugins/git/GitStatus.java:368
- The debug log prints the repository URI using
URIish.toString().URIishcan include userinfo (and potentially a password/token), so loggingtoString()risks leaking credentials when FINER/FINEST logging is enabled. Prefer logginguri.toPrivateString()(and similarly for any otherURIishvalues in this method) to redact sensitive parts while keeping the URI useful for debugging.
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Received notification from {0} for uri = {1} ; sha1 = {2} ; branches = {3}",
new Object[]{StringUtils.defaultIfBlank(origin, "?"), uri, sha1, Arrays.toString(branches)});
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds additional FINER and FINEST logging to git onNotifyCommit to assist with debugging - #3910
Testing done
Set hudson.plugins.git logger to ALL level. Increased log size with startup parameter
-Dhudson.util.RingBufferLogHandler.defaultSize=16384Setup a Jenkins job with polling enabled and a branch specified.
Submitter checklist