Skip to content

[JENKINS-75683] re-introduce actions for Jenkins with custom action.jelly#10678

Merged
MarkEWaite merged 6 commits intojenkinsci:masterfrom
jtnord:JENKINS-75683
Jun 24, 2025
Merged

[JENKINS-75683] re-introduce actions for Jenkins with custom action.jelly#10678
MarkEWaite merged 6 commits intojenkinsci:masterfrom
jtnord:JENKINS-75683

Conversation

@jtnord
Copy link
Member

@jtnord jtnord commented May 22, 2025

JENKINS-75683
Actions without a URL but a custom action.jelly were not shown correctly in the header.

NB: this is built on top of #10729 adn the changes for this PR are all contained in b091ea21533865f26ee747bec2930bb1f730465d

This re-introduces them and allows custom rendering of actions again (by using an action.jelly).
Actions that require a confirmation (and post) work.

Things still to do,
* task taglib needs to be adjusted to style correctly when tasks are in the header
~ ** nested tasks need to be handled appropriately (they are included only in sub pages, but see previous bullet point)~
* remove the url hack.
* Fix the nested tasks so that the parent still contains the correct tooltip.
* use the dropdown for nested elements..?
* the task styling in the dropdown is oh so wrong...
* check the rendering when inside the "overflow" icon dropdown.

  • update screen shots
    * run ATH

Screen Shots

Note

the after screenshots include the hamburger introduced in https://github.com/jenkinsci/jenkins/pull/10729which is a requirement for this change.

Before

with overflow menu:
image
without overflow menu:
image

issues:

  • The actions highlighted in Yellow have an action.jelly that would hide the actions (but they show up).
  • The actions highlighted in Ornage have an action.jelly that includes sub tasks that should be shown.
  • There is no element/icon/action for the purge-build-queue plugin

After

no current action:
image

no current action expanded hamburger:
image

current action with subtasks:
image

current action with hamburger: (action removed from hamburger)
image

Support for tasks that require confirmation:
image

The above demonstrate that an Action with an action.jelly are now handled correctly.

  • Actions are present if their action.jelly says they should be regardless of the lack of an icon from the java side.
  • Actions that where hidden in the action.jelly no longer show
  • Actions with subtasks are correctly allow you to interact with subtasks when the action is the current action in the page.

See JENKINS-75683.

Testing done

Proposed changelog entries

  • RootActions that used custom rendering (action.jelly) are once again visible in the header and behave appropriately.

  • RootActions that use jelly to show/hide are correctly hidden in the header

  • RootActions with sub tasks now show the subtasks as a dropdown when in the correct context

  • 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

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

@jtnord jtnord added the bug For changelog: Minor bug. Will be listed after features label May 23, 2025
@daniel-beck daniel-beck added the regression-fix Pull request that fixes a regression in one of the previous Jenkins releases label May 24, 2025
@scherler
Copy link
Contributor

FYI PR To fix the styling jtnord#2

@jtnord
Copy link
Member Author

jtnord commented Jun 2, 2025

For some reason this fails to show RootActions when in a View. When used in conjuction with #10676 RootActions show neither in Folders nor Views

Seems to be an issue with the specific action that is trying to infer things from the current URL, and making assumptions that no longer hold true.

@MarkEWaite MarkEWaite added the web-ui The PR includes WebUI changes which may need special expertise label Jun 4, 2025
jtnord added 2 commits June 16, 2025 18:21
This PR distinguishes between primary and secondary Actions for the
header.

Primary actions are always shown, and secondary actions are by default
in the Hamburger menu.
When the current page is the page for the secondary action (or a parent
thereof) the action is put in the main header action list and not in the
hamburger menu.
@jtnord jtnord force-pushed the JENKINS-75683 branch 4 times, most recently from 599134e to 3bc9a6d Compare June 19, 2025 09:56
jtnord and others added 2 commits June 19, 2025 11:03
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jtnord added a commit to jtnord/purge-build-queue-plugin that referenced this pull request Jun 19, 2025
The code was incorrectly checking the permission ${it.ADMINISTER}
however it when vewing the root of Jenkins (and other views) is an
instance of AllView.  As such the permission check failed silently and
was then not shown.

jenkinsci/jenkins#10678 sets ${it} to Jenkins
now, and then this causes the incorrect permission check to blow up as
it is a single permission that is set for permissions (which expects an
array).

This fixes the issue and actually removes the permission check from the
task, as the permission is already checked in the layout.

We now take advantage of the Manage permission also so that users
without Jenkins.ADMINISTER but with JENKINS.MANAGE can clear the build
queue.
NotMyFault pushed a commit to jenkinsci/purge-build-queue-plugin that referenced this pull request Jun 19, 2025
* bump to recent parent pom

* Compatability with Future Jenkins version

The code was incorrectly checking the permission ${it.ADMINISTER}
however it when vewing the root of Jenkins (and other views) is an
instance of AllView.  As such the permission check failed silently and
was then not shown.

jenkinsci/jenkins#10678 sets ${it} to Jenkins
now, and then this causes the incorrect permission check to blow up as
it is a single permission that is set for permissions (which expects an
array).

This fixes the issue and actually removes the permission check from the
task, as the permission is already checked in the layout.

We now take advantage of the Manage permission also so that users
without Jenkins.ADMINISTER but with JENKINS.MANAGE can clear the build
queue.
…elly

actions without a URL but a custom action.jelly where not shown
correctly in the header.

This re-introduces them and allows custom rendering of actions again (by
using an action.jelly).

adjust the task taglib so that it renders in the style of the header
when in the header.

Nested tasks work, but when expanded the original looses its tooltip.

move subtasks to the dropdown

use tasks class to fix layout

fix scss formatting
jtnord added a commit to jtnord/acceptance-test-harness that referenced this pull request Jun 19, 2025
@jtnord jtnord marked this pull request as ready for review June 19, 2025 17:26
@jtnord jtnord requested review from a team, MarkEWaite and janfaracik June 19, 2025 17:27
@MarkEWaite MarkEWaite requested a review from a team June 23, 2025 10:24
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 Jun 23, 2025
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.

@github-actions
Copy link
Contributor

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Jun 23, 2025
@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Jun 23, 2025
@MarkEWaite MarkEWaite merged commit 39e85a0 into jenkinsci:master Jun 24, 2025
17 checks passed
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 regression-fix Pull request that fixes a regression in one of the previous Jenkins releases 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.

6 participants