Bug 214300 - Permit "Show Failures" to be enabled on multiple-node selections
Summary: Permit "Show Failures" to be enabled on multiple-node selections
Alias: None
Product: connecteddeveloper
Classification: Unclassified
Component: Hudson (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
Keywords: NETFIX
Depends on:
Reported: 2012-06-15 21:43 UTC by Jesse Glick
Modified: 2013-03-08 02:04 UTC (History)
0 users

See Also:
Exception Reporter:

Start of a patch (5.28 KB, patch)
2012-06-15 21:43 UTC, Jesse Glick
Details | Diff
Patch - Using NodeAction (5.15 KB, patch)
2013-03-04 18:11 UTC, Jaroslav Havlin
Details | Diff
Patch - Using ContextAwareAction with @ActionRegistration (12.69 KB, patch)
2013-03-06 14:34 UTC, Jaroslav Havlin
Details | Diff
Patch - Using ContextAwareAction (no @ActionRegistration) (12.16 KB, patch)
2013-03-06 14:52 UTC, Jaroslav Havlin
Details | Diff
Patch - Using ContextAwareAction (no @ActionRegistration) v2 (12.61 KB, patch)
2013-03-06 16:20 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2012-06-15 21:43:46 UTC
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.
Comment 1 Jaroslav Havlin 2013-03-04 18:11:31 UTC
Created attachment 132163 [details]
Patch - Using NodeAction

I've tried to implement it using NodeAction. Seems to work fine. Is it OK, or are there any drawbacks? Thanks.
Comment 2 Jesse Glick 2013-03-06 00:20:12 UTC
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.
Comment 3 Jaroslav Havlin 2013-03-06 14:34:05 UTC
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.
Comment 4 Jaroslav Havlin 2013-03-06 14:52:06 UTC
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.
Comment 5 Jaroslav Havlin 2013-03-06 16:20:18 UTC
Created attachment 132280 [details]
Patch - Using ContextAwareAction (no @ActionRegistration) v2

Fixed method ShowFailures.getExtraModuleBuilds.
Comment 6 Jesse Glick 2013-03-06 20:39:56 UTC
That looks right to me.
Comment 7 Jaroslav Havlin 2013-03-07 11:59:14 UTC
Thank you very much, Jesse, for your help and reviewing.
Comment 8 Quality Engineering 2013-03-08 02:04:03 UTC
Integrated into 'main-golden', will be available in build *201303072300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f24cdf758285
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #214300: Permit Show Failures to be enabled on multiple-node selections