Thanks again for all the hints. I was of course going in the wrong direction for my use case, so pulling out helps. And reading this page [1] <https://wiki.jenkins-ci.org/display/JENKINS/Action+and+its+family+of+subtypes> .
So I resolved my problem by first removing the weird collections of Job actions within Run actions. Then I added an extension that implements TransientActionFactory. This now creates a collection of a single element, which is my project action. And considering that the action is transient, i.e., uses persistance of build actions but does not persist anything by itself. Sure enough, the chart now appears on the dashboard and the route to the special view gets matched properly. At first, however, this oversolved the problem, because now that chart would appear on all the projects' dashboards. So I added a check for any sensible content before registering the action. These [2] <https://github.com/dice-project/DICE-Jenkins-Plugin/compare/86b437e...1e1bdb4> are now my changes that work. Best regards, Matej [1] https://wiki.jenkins-ci.org/display/JENKINS/Action+and+its+family+of+subtypes [2] https://github.com/dice-project/DICE-Jenkins-Plugin/compare/86b437e...1e1bdb4 Dne četrtek, 22. junij 2017 20.01.32 UTC+2 je oseba Matej Artač napisala: > > Hello Jesse, > > thank you again for your tips. I have made an update of the code [1] > <https://github.com/dice-project/DICE-Jenkins-Plugin/commit/e5f249b151b79c44a60e13b782eb56c81c1a4f8d> > > according to my understanding of your comments. Note that I implemented ` > RunAction2` methods on both Action classes just to see what happens. > However, these changes alone do not resolve my problem: the project action > does not get invoked by Jenkins - I do not see any visualizations > implemented in the plug-in, and I get `No matching rule was found on > <org.jenkinsci.plugins.workflow.job.WorkflowJob@7be09d78[DiceTestPipeline]> > for "/dice-dashboard"`. > > I have created a pull request [2] > <https://github.com/matejart/DICE-Jenkins-Plugin/pull/1> where hopefully > it will be easier to comment the changes and the code. > > Thank you and best regards, > Matej > > [1] > https://github.com/dice-project/DICE-Jenkins-Plugin/commit/e5f249b151b79c44a60e13b782eb56c81c1a4f8d > [2] https://github.com/matejart/DICE-Jenkins-Plugin/pull/1 > > Dne sreda, 21. junij 2017 17.03.37 UTC+2 je oseba Jesse Glick napisala: >> >> On Wed, Jun 21, 2017 at 3:20 AM, Matej Artač <[email protected]> >> wrote: >> >> Either attach all the `Actions` at top level (`Run.addAction`), or >> make >> >> the nested structures extend `Object` and implement `RunAction2` on >> the >> >> actual single `Action`. >> > >> > By the actual single Action you mean the Build action? What is >> considered >> > here as a top level? Won't extending Object remove the ability to show >> icons >> > on the appropriate level? >> >> Yes, so if you are using all the actions as actual `Action`s then you >> need to attach them all to the build, using `Run.addAction` on each. >> And then get rid of the field in one action holding a list of other >> actions. >> >> It is hard to discuss details of mistakes in your code over a mailing >> list. Much better to propose changes via pull request and then request >> reviewers, where individual lines can be annotated. >> > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/083bbd27-7c69-424f-b298-62ed62a12df0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
