Skip to content

Log a warning when changelog lines are ignored - #4016

Open
vidhumahajan wants to merge 1 commit into
jenkinsci:masterfrom
vidhumahajan:report-ignored-changelog-lines
Open

vidhumahajan wants to merge 1 commit into
jenkinsci:masterfrom
vidhumahajan:report-ignored-changelog-lines

Conversation

@vidhumahajan

Copy link
Copy Markdown

GitChangeLogParser keeps at most 1000 lines per commit and drops the rest without saying anything. The code had a TODO for this: "if we ignored some lines, tell the user so."

Now the parser counts the dropped lines for each commit and logs one warning with the commit id and the count, for example:

Ignored 5 lines of changelog for commit 123abc456def

Commits under the limit log nothing, and the parsed changesets are the same as before. The TODO is removed.

The count is passed as a plain string, so it doesn't get a locale-dependent thousands separator.

One thing I wasn't sure about: the changelog can be parsed again when a build is loaded, so the same warning may show up more than once for a big commit. I used WARNING so it's visible by default, but I'm happy to lower it to INFO or FINE if you think it's too noisy.

Testing done

New tests in GitChangeLogParserTest:

  • a commit with 1005 lines logs exactly one warning saying 5 lines were ignored
  • a commit with more than 1500 ignored lines shows the number without a separator
  • a short commit logs nothing, even when listening at Level.ALL

GitChangeLogParserTest passes locally. I didn't run the full suite (not enough memory on my laptop), so I'm relying on CI for the rest.

@vidhumahajan
vidhumahajan requested a review from a team as a code owner October 25, 2026 21:03
@github-actions github-actions Bot added the tests Automated test addition or improvement label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Automated test addition or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant