Skip to content

Deduplicate build causes in queue tooltip and build overview#26392

Open
mawinter69 wants to merge 4 commits intojenkinsci:masterfrom
mawinter69:issue-16557
Open

Deduplicate build causes in queue tooltip and build overview#26392
mawinter69 wants to merge 4 commits intojenkinsci:masterfrom
mawinter69:issue-16557

Conversation

@mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented Mar 1, 2026

When a job is in the queue for longer time it might get triggered several times, e.g. by timer, a user or another job.
Having several such jobs in the queue with a long list of triggers can lead to noticeable loading delays of the dashboard.

The trigger list on the build overview page can also become very long when that happened for an upstream build.

This change will remove any duplicate causes from the tooltip und in the display of upstream causes.

The persistence of upstream causes is not changed here as many plugins use the getUpstreamCauses method and changing that might cause undesired side effects.

fixes #16557

Testing done

Interactive testing

  1. create job that runs every minute and sleeps for some minutes and the triggers another job
  2. wait 2 minutes and then trigger the job few times manually
  3. verified that in the queue there are only 2 causes listed with with the number of times for the causes
  4. verified that on the build overview page the upstream cause also (deeper nested) has the duplicate causes removed
  5. verified that on the build overview page this also applies to old builds that have run before this change

Screenshots (UI changes only)

Before

image image

After

image image

Proposed changelog entries

  • Deduplicate build causes in queue tooltip and build overview

Proposed changelog category

/label rfe,web-ui

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.

@comment-ops-bot comment-ops-bot bot added rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted web-ui The PR includes WebUI changes which may need special expertise labels Mar 1, 2026
Copy link

@andreahlert andreahlert left a comment

Choose a reason for hiding this comment

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

causeBag is transient and only set in the constructors. When we load a build from disk we don’t run those, so for any build with upstream causes getCauseCounts() will NPE when the jelly uses it. Need to init causeBag when it’s null (e.g. in getCauseCounts() call fillCauseBag() first).

@mawinter69
Copy link
Contributor Author

causeBag is transient and only set in the constructors. When we load a build from disk we don’t run those, so for any build with upstream causes getCauseCounts() will NPE when the jelly uses it. Need to init causeBag when it’s null (e.g. in getCauseCounts() call fillCauseBag() first).

Loading from disk runs through the callback method in line 368 which calls the fillCauseBag that ensures the causeBag is initialized. But doing that in getCauseCounts instead of the callbackwould also do the job

Copy link

@andreahlert andreahlert left a comment

Choose a reason for hiding this comment

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

LGTM

@andreahlert
Copy link

causeBag is transient and only set in the constructors. When we load a build from disk we don’t run those, so for any build with upstream causes getCauseCounts() will NPE when the jelly uses it. Need to init causeBag when it’s null (e.g. in getCauseCounts() call fillCauseBag() first).

Loading from disk runs through the callback method in line 368 which calls the fillCauseBag that ensures the causeBag is initialized. But doing that in getCauseCounts instead of the callbackwould also do the job

Checked the PR branch. the callback does call uc.fillCauseBag(), so causeBag is initialized after deserialization. Withdrawing the NPE concern.

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

Labels

rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted web-ui The PR includes WebUI changes which may need special expertise

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JENKINS-73834] hover tooltip of stuck jobs in build queue can become extremely huge

2 participants