How to hide git changelog about shared library in Jenkins multibranch pipeline

Hi,

I’m trying to hide git changelog/changeset about shared library within a Jenkins multibranch pipeline.

I’ve explored explored various options without success.
Let’s overview what I’ve tried and please let m know if there’s something I’m missing:

Options Explored:

option 1: unchecked “Include @Library changes in job recent changes” from system global configurations

option 2: add “changelog: false” to pipelines

Since I’m using various pipeline types I was able to tried them all:

  • example 1: library identifier: '<my shared lib>@<shared lib branch>', changelog: false
  • example 2: @Library(value='<my shared lib>@<shared lib branch>', changelog=false)

option 3: clear ChangeSets and perform checkout

In this option we can run currentBuild.getChangeSets().clear() and then we chan perform git clone with checkout scm (or other git command).
However, this would require manual checkout, losing the benefit of automatic default checkout scm.

None of the 3 options above worked for me, and I’m still seeing the shared library changelog in my multibranch pipelines.

Any other solutions?

It seems there’s an open ticket (link) related to hiding changesets, but I’m not quite sure if this ticket is also relevant for multibranch pipelines.

jenkins version: 2.462.2

Further information can be found here:

Any other ideas for this? The problem applies to simple (single stage) pipelines, too. Every job’s console output is filled with these 20+ lines:

21:46:12  Started by user XYZ
21:46:12  Loading library xyz-shared@main:notifications/
21:46:12  Attempting to resolve main from remote references...
21:46:12   > git.exe --version # timeout=10
21:46:12   > git --version # 'git version 2.49.0.windows.1'
21:46:12   > git.exe ls-remote -h -- file:///c:/tools/jenkins_library # timeout=10
21:46:13  Found match: refs/heads/main revision 1aece44c1b542de9af60ea9d9427b10086a82beb
21:46:13  The recommended git tool is: NONE
21:46:13  No credentials specified
21:46:13   > git.exe rev-parse --resolve-git-dir C:\data\Jenkins\.jenkins\workspace\JOB NAME@libs\568c993389b5b6ef2f458b1b92e4a16e940df87d578c9ae18719b0b4f5e22761\.git # timeout=10
21:46:13  Fetching changes from the remote Git repository
21:46:13   > git.exe config remote.origin.url file:///c:/tools/jenkins_library # timeout=10
21:46:13  Fetching without tags
21:46:13  Fetching upstream changes from file:///c:/tools/jenkins_library
21:46:13   > git.exe --version # timeout=10
21:46:13   > git --version # 'git version 2.49.0.windows.1'
21:46:13   > git.exe fetch --no-tags --force --progress -- file:///c:/tools/jenkins_library +refs/heads/*:refs/remotes/origin/* # timeout=10
21:46:13  Checking out Revision 1aece44c1b542de9af60ea9d9427b10086a82beb (main)
21:46:13   > git.exe config core.sparsecheckout # timeout=10
21:46:13   > git.exe checkout -f 1aece44c1b542de9af60ea9d9427b10086a82beb # timeout=10
21:46:14  Commit message: "added instructions to readme"
21:46:14   > git.exe rev-list --no-walk 1aece44c1b542de9af60ea9d9427b10086a82beb # timeout=10
21:46:14  [Pipeline] Start of Pipeline

Our users would prefer not to see all of message unrelated to pipeline steps.

You’re asking a different question than the original question in this topic. The original topic is related to not included the changelog from the shared library in the changelog of the job that is using the shared library. You are asking to hide a section of the console log. They are very different questions.

An enhancement request asks to optionally reduce the verbosity of the logging done by the git client plugin.

I think that include the changes of the library in pipeline has no sense if the checkbox is disabled. For the console output I really don’t think that it’s a problem