The run is null, so there's nothing to get a sidepanel from. The RunAction2 special behavior isn't supported by TransientActionFactory, so you need to add a constructor argument to end up with a reference to the Run. Could be as designed based on the RunAction2 Javadoc. The problem it solves is one that isn't trivial to do otherwise (having a reference to the run after loading from disk), so I can see why this might get ignored in the transient action factory case, that's easy to solve.
Here's a patch to make it work: https://gist.github.com/daniel-beck/34b7a1425f85bfa499bd43823d17f030 On Thu, Jun 16, 2022 at 8:48 PM Nozim Islamov < [email protected]> wrote: > Actually, I am using RunAction2 interface, and I am using > TransientActionFactory to show it for every Run, please refer to this git: > https://github.com/M1ZoN/promoted/tree/SimpleBuildWrapper > ActionFactory: > https://github.com/M1ZoN/promoted/blob/SimpleBuildWrapper/src/main/java/io/jenkins/plugins/sample/MyActionFactory.java > RunAction2: > https://github.com/M1ZoN/promoted/blob/SimpleBuildWrapper/src/main/java/io/jenkins/plugins/sample/PromotedBuildAction.java > Jelly for Action: > https://github.com/M1ZoN/promoted/blob/SimpleBuildWrapper/src/main/resources/io/jenkins/plugins/sample/PromotedBuildAction/index.jelly > > On Thursday, June 16, 2022 at 4:08:21 AM UTC-7 [email protected] wrote: > >> HI, >> >> If I understand your question correctly, you just need to return non-null >> for getDisplayName and getIconFileName in your Action[1] >> >> /James >> >> [1] https://javadoc.jenkins.io//hudson/model/Action.html >> >> On Thursday, June 16, 2022 at 12:17:40 AM UTC+1 [email protected] >> wrote: >> >>> Is there any way to include side-panel to actions that are created by >>> TransientActionFactory? >> >> -- > 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/c4e9df21-9b96-4f3f-9acb-a11584cad93cn%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-dev/c4e9df21-9b96-4f3f-9acb-a11584cad93cn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAMo7Pt%2Bb3EHPpz4ei%3D6%2B%3DhHyEYj92%3Dvc%2B-4ayGmCZHme9BqcTA%40mail.gmail.com.
