Skip to content

Conversation

@stevearmstrong-dev
Copy link
Contributor

@stevearmstrong-dev stevearmstrong-dev commented Nov 16, 2025

See JENKINS-45927

Testing done

Added comprehensive unit tests in CompositeCauseOfBlockageTest:

  • Few reasons (no truncation)
  • Exactly 5 reasons (boundary case)
  • More than 5 reasons (truncation)
  • 100 reasons (extreme case, verifies length is reasonable)

Proposed changelog entries

  • Truncate verbose queue blockage messages to show maximum 5 reasons with "... and N more" suffix.

Proposed upgrade guidelines

N/A

Submitter checklist

  • The Jira issue, JENKINS-45927, 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.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, methods, and fields are annotated with @Restricted or have @since TODO Javadoc.
  • New deprecations are annotated with @Deprecated(since = "TODO").
  • New or fixed UI is crresponsible to Content Security Policy defaults.
  • If dependency changes, these were updated to link to relevant changelogs.
  • If new extension/APIs were added, there is link to its consumers.

Desired reviewers

@timja

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, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

Summary

When hovering over queued build items, Jenkins displays extremely verbose blockage reasons that can fill the entire browser window. The message lists every node with format: "nodeA doesn't have label X; nodeB doesn't have label X; ..." for ALL nodes.

Changes

  • Modified CompositeCauseOfBlockage.getShortDescription() to truncate messages when there are more than 5 reasons
  • Shows first 5 reasons followed by "... and N more" to keep tooltips readable
  • Added comprehensive unit tests for the truncation behavior

Before/After

Before: "node1 doesn't have label X; node2 doesn't have label X; node3 doesn't have label X; ... (continues for all 100 nodes)"

After: "node1 doesn't have label X; node2 doesn't have label X; node3 doesn't have label X; node4 doesn't have label X; node5 doesn't have label X; ... and 95 more"

When multiple nodes reject a task, CompositeCauseOfBlockage previously
joined ALL rejection reasons with "; ", causing extremely verbose
tooltips that could fill the entire browser window.

This fix truncates the message to show only the first 5 reasons,
followed by "... and N more" when there are more than 5 reasons.

Signed-off-by: Steve Armstrong <[email protected]>
@welcome
Copy link

welcome bot commented Nov 16, 2025

Yay, your first pull request towards Jenkins core was created successfully! Thank you so much!

A contributor will provide feedback soon. Meanwhile, you can join the chats and community forums to connect with other Jenkins users, developers, and maintainers.

@timja
Copy link
Member

timja commented Nov 16, 2025

Please restore (and follow) the PR template: https://github.com/jenkinsci/jenkins/blob/master/.github/PULL_REQUEST_TEMPLATE.md

@stevearmstrong-dev
Copy link
Contributor Author

/label rfe

@comment-ops-bot comment-ops-bot bot added the rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Nov 16, 2025
stevearmstrong-dev and others added 3 commits November 16, 2025 18:04
The CompositeCauseOfBlockage uses a TreeMap which sorts keys
alphabetically, so "Reason 10" comes before "Reason 2". Updated
tests to use zero-padded numbers to ensure predictable ordering.

Signed-off-by: W0474997SteveArmstrong <[email protected]>
Jenkins Checkstyle rules require static imports to be in their own
group at the top, before regular imports.

Signed-off-by: W0474997SteveArmstrong <[email protected]>
@stevearmstrong-dev
Copy link
Contributor Author

stevearmstrong-dev commented Nov 19, 2025

Please restore (and follow) the PR template: https://github.com/jenkinsci/jenkins/blob/master/.github/PULL_REQUEST_TEMPLATE.md

Done.
Please review. @timja
Thanks

@timja timja requested a review from a team November 27, 2025 08:27
@MarkEWaite
Copy link
Contributor

MarkEWaite commented Dec 1, 2025

This PR is now ready for merge. We will merge it after the master branch is unlocked, 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 Dec 1, 2025
MarkEWaite added a commit to MarkEWaite/bom that referenced this pull request Dec 2, 2025
@MarkEWaite
Copy link
Contributor

MarkEWaite commented Dec 2, 2025

Tested in the plugin BOM to confirm that it is not breaking tests there. Pull request is:

Since this may affect the UI, needs to be tested in acceptance test harness.

MarkEWaite added a commit to MarkEWaite/acceptance-test-harness that referenced this pull request Dec 2, 2025
@MarkEWaite
Copy link
Contributor

Passed acceptance test harness.

@timja
Copy link
Member

timja commented Dec 2, 2025

Could you provide some screenshots of what it looks like in the usecases you've provided?

Copy link

@A1exKH A1exKH left a comment

Choose a reason for hiding this comment

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

LGTM.

@MarkEWaite MarkEWaite merged commit f075bc0 into jenkinsci:master Dec 13, 2025
18 checks passed
@welcome
Copy link

welcome bot commented Dec 13, 2025

Congratulations on getting your very first Jenkins core pull request merged 🎉🥳

This is a fantastic achievement, and we're thrilled to have you as part of our community! Thank you for your valuable input, and we look forward to seeing more of your contributions in the future!

We would like to invite you to join the community chats and forums to meet other Jenkins contributors 😊
Don't forget to check out the participation page to learn more about how to contribute to Jenkins.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JENKINS-45927] CauseOfBlockage of items in Queue is extremely verbose

4 participants