Skip to content

Add badges to build page #10651

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

strangelookingnerd
Copy link
Contributor

Add badge actions to the build page.

Following a discussion with @janfaracik and @timja in jenkinsci/badge-plugin#263 I propose to add badges (provided by BadgeActions) to the build page. In my opinion it only makes sence to have the information of the badges displayed here as well rather then having it only in the build history.

Full disclaimer: I am far from being a UI/UX expert, but want to push this topic forward. So any feedback is highly welcome!

Testing done

See before and after screenshots:

Before

Boring1
Boring2

After

Awesome1
Awesome2

Proposed changelog entries

  • Add badges to build page

Proposed changelog category

/label rfe,web-ui

Proposed upgrade guidelines

N/A

Submitter checklist

  • The Jira 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.
  • 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

@jenkinsci/sig-ux @jenkinsci/core-pr-reviewers

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).

@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 May 14, 2025
Copy link
Member

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

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

This looks weird with the usual (everywhere else except badge and groovy-buildstep) badges that are just an icon.

Screenshot 2025-05-14 at 11 22 31

Plus the tooltip is wrong for this one in core, the sidepanel includes the cause:

Screenshot 2025-05-14 at 11 22 27

(forgot to set it or similar?)


IMO: If an action should appear on the project page, there should be such an action. Reusing badges just for convenience in badge plugin seems too focused on the existing implementation.

@strangelookingnerd
Copy link
Contributor Author

strangelookingnerd commented May 14, 2025

This looks weird with the usual (everywhere else except badge and groovy-buildstep) badges that are just an icon.

Can't really argue with that. Maybe adding some sort of container would help to make the icons not look so out of place.

IMO: If an action should appear on the project page, there should be such an action. Reusing badges just for convenience in badge plugin seems too focused on the existing implementation.

The idea is to mirror the information from the build history here, hence a new action would defeat that purpose. It's less about convenience but consistency. Or is there any reason to not have that information here?

@strangelookingnerd
Copy link
Contributor Author

Plus the tooltip is wrong for this one in core, the sidepanel includes the cause:

Fixed in 73d4080

@strangelookingnerd
Copy link
Contributor Author

Other approaches I found to be a little more appealing:

Badges to the right

BadgesRight

Badges in a container

WithContainer

@krisstern krisstern requested a review from daniel-beck May 14, 2025 11:35
@daniel-beck
Copy link
Member

daniel-beck commented May 14, 2025

The idea is to mirror the information from the build history here, hence a new action would defeat that purpose.

I disagree with the idea, that's the point of my feedback. If the information should appear on this page as well, then it should be such an action added to the build. For example https://plugins.jenkins.io/buildtriggerbadge/ only makes sense in the widget, because causes are already shown on the main build page.

Badge plugin could do this, and it's not clear to me why it's not being changed to do this. What do we gain from this change to core behavior?

Other approaches I found to be a little more appealing

These look a lot nicer. To the right of the build number/name might also work.

@strangelookingnerd
Copy link
Contributor Author

The idea is to mirror the information from the build history here, hence a new action would defeat that purpose.

I disagree with the idea, that's the point of my feedback. If the information should appear on this page as well, then it should be such an action added to the build. For example https://plugins.jenkins.io/buildtriggerbadge/ only makes sense in the widget, because causes are already shown on the main build page.

Understood. I also kind of disagree with your feedback, but you do raise a fair point.
Another approach to this could be to add the build history widget to every build page. Any thoughts on that?

Badge plugin could do this, and it's not clear to me why it's not being changed to do this. What do we gain from this change to core behavior?

Like how? The only extension point I can think of here is to have a summary.jelly that displays all badge actions added to the build by the badge plugin (or even all of them).

Other approaches I found to be a little more appealing

These look a lot nicer. To the right of the build number/name might also work.

I tried that but was not really happy with the result, so I scratched it.

@daniel-beck
Copy link
Member

Like how? The only extension point I can think of here is to have a summary.jelly that displays all badge actions added to the build by the badge plugin (or even all of them).

Looking at the plugin, BadgeSummaryAction and AddSummaryStep already exist, so this request is even less clear to me now. If I want something to show on the main page, that's how I do it already now, or not?

@krisstern krisstern requested a review from a team June 15, 2025 12:34
@henriduflot
Copy link

Currently, you proposed to use Jenkins addSummary method to display badge on build page:

addSummary text: "temurin-21", style: 'color: var(--accent-color)', cssClass: 'badge-text--background'
addSummary text: "redeploy", style: 'color: var(--text-color-secondary)', cssClass: 'badge-text--background'
addSummary text: "tests failed", style: 'color: var(--error-color)', cssClass: 'badge-text--background'
addSummary text: "security issues", style: 'color: var(--warning-color)', cssClass: 'badge-text--background'
image

The problem with this approach is:

  1. These summaries appear scattered throughout the build page as other plugins add their own summaries
  2. They display line by line, potentially pushing important information to the bottom of the page
  3. It requires using both addBadge and addSummary methods, which is not practical

We need a more efficient way to display badges that:

  1. Shows all badges in a single section at the top of the build page
  2. Displays badges on the same line
  3. Consolidates the badge functionality into a single method call
  4. Ensures important build information is immediately visible

This would improve visibility of critical build information and create a more consistent user experience.

@daniel-beck
Copy link
Member

These summaries appear scattered throughout the build page as other plugins add their own summaries
They display line by line, potentially pushing important information to the bottom of the page

These are implementation choices and could easily be done differently by the plugin.

It requires using both addBadge and addSummary methods, which is not practical

Others may see this as allowing fine-grained control of what shows where, and this change would result in a confusing API ("badges" are actually "badge + summary" and summary is just summary).

@strangelookingnerd
Copy link
Contributor Author

These summaries appear scattered throughout the build page as other plugins add their own summaries
They display line by line, potentially pushing important information to the bottom of the page

These are implementation choices and could easily be done differently by the plugin.

I don't think this is the case as the layout is controlled by the enclosing container which resides in core.

It requires using both addBadge and addSummary methods, which is not practical

Others may see this as allowing fine-grained control of what shows where, and this change would result in a confusing API ("badges" are actually "badge + summary" and summary is just summary).

Not sure if I fully agree on that. I think it's more about displaying badges not only in the build history widget but also on the build summary page. Similar to the build status, number or execution time.

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.

3 participants