-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins ver. 2.138.2, org.jenkins-ci.plugins.workflow:workflow-cps:2.60
The "/pipeline-syntax/ ("Pipeline Syntax Snippet Generator") view exposed by workflow-cps-plugin, and the related "/pipeline-syntax/html" ("Steps Reference") don't expose any information about where a step comes from - the plugin, class, etc.
This makes it awfully hard to track things down when trying to debug an issue.
It'd be a big improvement if steps were annotated in the help with their implementing class in both places. So in the snippet generator when you choose a "Sample Step" it loads the step descriptor and shows:
- Step description if any
- Implementing class
- "Friendly name" of plugin containing implementing class and its actual plugin-id too, with a link to the plugins wiki
I've spent way too long trying to find a step's implementation in a sub-sub-sub plugin of a plugin, which has two different display names, a different internal plugin name, and a different-again git repo name.
For the bigger picture of "how do I identify where X came from in Jenkins" see JENKINS-26565.
See also JENKINS-54442 for the related issue with globals.
~~~
For Google: this issue is about workflow-cps-plugin a.k.a workflow-cps a.k.a. "Pipeline: Groovy" a.k.a "Pipeline Groovy Plugin", i.e. the "/pipeline-syntax/" page, the "Pipeline Syntax: Snippet Generator".
It looks like the Descriptor abstract base that StepDescriptor extends exposes a getPlugin() method that would be ideal. AFAICS in src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly.
I think it needs to inject getPlugin().getDisplayName() hyperlinked to its getPlugin().getUrl(), and probably the step class's getSimpleName() too.
I haven't figured out how to do that in jelly (I used JSF2 in a prior life, but I've never done jelly) and don't have a local Jenkins for testing yet. But hopefully this is a useful starting point. My wild guess is:
In the <f:ajax> block, maybe after the end of the <st:include/> block, something like
I'd love a hand as I'm a bit stuck about how to get from this to testing it and sending a pull request.