-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Limit rssChangeLog feed to 20 entries by default #26422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1165,17 +1165,22 @@ class FeedItem { | |||||
| scmDisplayName = " " + String.join(", ", scmNames); | ||||||
| } | ||||||
|
|
||||||
| for (RunT r = getLastBuild(); r != null; r = r.getPreviousBuild()) { | ||||||
| int idx = 0; | ||||||
| if (r instanceof RunWithSCM) { | ||||||
| for (ChangeLogSet<? extends ChangeLogSet.Entry> c : ((RunWithSCM<?, ?>) r).getChangeSets()) { | ||||||
| for (ChangeLogSet.Entry e : c) { | ||||||
| entries.add(new FeedItem(e, idx++)); | ||||||
| } | ||||||
| } | ||||||
| final int MAX_ENTRIES = 20; | ||||||
| int totalFeedItems = 0; | ||||||
| for (RunT r = getLastBuild(); r != null && totalFeedItems < MAX_ENTRIES; r = r.getPreviousBuild()) { | ||||||
| int idx = 0; | ||||||
| if (r instanceof RunWithSCM) { | ||||||
| for (ChangeLogSet<? extends ChangeLogSet.Entry> c : ((RunWithSCM<?, ?>) r).getChangeSets()) { | ||||||
| for (ChangeLogSet.Entry e : c) { | ||||||
|
||||||
| if (totalFeedItems >= MAX_ENTRIES) break; | ||||||
| entries.add(new FeedItem(e, idx++)); | ||||||
| totalFeedItems++; | ||||||
| } | ||||||
| if (totalFeedItems >= MAX_ENTRIES) break; | ||||||
| } | ||||||
| RSS.forwardToRss( | ||||||
| } | ||||||
| } | ||||||
| S.forwardToRss( | ||||||
|
||||||
| S.forwardToRss( | |
| RSS.forwardToRss( |
Outdated
Copilot
AI
Mar 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are unmatched closing braces here (} / }) which appear to terminate the for loop and even the doRssChangelog method before the feed is rendered. This will either fail compilation or change control flow so no RSS output is produced. Please re-balance braces so forwardToRss(...) remains inside doRssChangelog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coding
MAX_ENTRIES = 20inside the handler makes it difficult to tune for larger/smaller instances and doesn’t satisfy the “clients can ask for full-length explicitly” requirement from the linked issue. Consider using a system property default (pattern used widely in core viajenkins.util.SystemProperties.getInteger) and allowing an optional request parameter (e.g.,max) to override the default with a reasonable upper bound.