Skip to content

Add index variable to forEach loop in queue-items.jelly#26355

Merged
MarkEWaite merged 1 commit intojenkinsci:masterfrom
duemir:patch-3
Feb 24, 2026
Merged

Add index variable to forEach loop in queue-items.jelly#26355
MarkEWaite merged 1 commit intojenkinsci:masterfrom
duemir:patch-3

Conversation

@duemir
Copy link
Member

@duemir duemir commented Feb 23, 2026

Fixes a regression in the Build History widget when all the queued tasks show up with the same number. Which I think fixes #16748

Testing done

  1. Create a hello world pipeline that sleeps for 5 minutes. Disable concurrency. Add a parameter.
  2. Trigger a pipeline build. Ensure it works and sleeps
  3. Trigger more pipelines; give each a unique parameter

Expected: Build history shows a unique incremental number for each queued pipeline task
Actual: All queued tasks show the same number

Screenshots (UI changes only)

Before

2026-02-23-build-history-before

After

2026-02-23-build-history-after

Proposed changelog entries

  • Fix estimated build number in Build History widget

Proposed changelog category

/label bug

Proposed upgrade guidelines

N/A

Submitter checklist

  • The issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • UI changes do not introduce regressions when enforcing the current default rules of Content Security Policy Plugin. In particular, new or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, be a Bug or Improvement, and either the issue or pull request must be labeled as lts-candidate to be considered.

Fixes a regression in the Build History widget when all the queued tasks show up with the same number
@comment-ops-bot comment-ops-bot bot added the bug For changelog: Minor bug. Will be listed after features label Feb 23, 2026
<j:if test="${!queuedItems.isEmpty()}">
<span class="app-builds-container__heading">${%Pending}</span>
<j:forEach var="pageEntry" items="${queuedItems}">
<j:forEach var="pageEntry" items="${queuedItems}" indexVar="i">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JEXL on line 46 uses variable i.

<div class="app-builds-container__item__inner">
<div class="app-builds-container__item__inner__link">
<!-- Don't use math unless needed, in case nextBuildNumber is not numeric -->
#${queuedItems.size() == 1 ? it.widget.owner.nextBuildNumber : it.widget.owner.nextBuildNumber+queuedItems.size()-i-1}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L46

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback.

/label ready-for-merge

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Feb 23, 2026
@MarkEWaite
Copy link
Contributor

Merging now so that it will be included in weekly 2.552.

@MarkEWaite MarkEWaite merged commit 61c1b32 into jenkinsci:master Feb 24, 2026
18 checks passed
@duemir duemir deleted the patch-3 branch February 24, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JENKINS-75719] Build Number of Queued builds shows incorrect value

3 participants