Created attachment 120925[details]
Start of a patch
Sometimes it is useful to display test failures from multiple builds with one gesture. Currently you have to select the menu item on each. I started implementing this but there is some more to do - in order for an action to be enabled on multiselections, it has to be a singleton and accept a context. Could probably use @ActionRegistration if the ctor takes a List<HudsonJobBuild> (but TBD how to handle HudsonMavenModuleBuild - common parent interface?), then use Actions.forID to find the singleton.
You can do it that way if it is easiest, probably using CookieAction rather than NodeAction; last I checked SystemAction was just semideprecated. The best replacement is in spi.actions which is unfortunately still only available to “friends”. Doing it the encouraged way means using @ActionRegistration(eager=true) to define the ContextAwareAction (cannot make it lazy in this case since it has to accept two kinds of cookies).
The overloads in UI.showFailuresAction are now misleading since the result is a singleton, hence my original patch to UI.java.
The other parts of my patch were to add the action to nodes even when there was not a failure, so that you could multiselect all the builds of a job (for example) and select Show Failures and see just the test results from unstable builds.
Created attachment 132269[details]
Patch - Using ContextAwareAction with @ActionRegistration
Implementation that uses eager @ActionRegistration for a ContextAwareAction.
Needs more testing with maven module builds, but seems to work fine so far.
Created attachment 132270[details]
Patch - Using ContextAwareAction (no @ActionRegistration)
Similar to attachment 132269[details], but the action doesn't use @ActionRegistration.
Everything works correctly. There's no need to assign keyboard shortcut or to add the action to main menu, so I think this patch should suffice.