In the Snippet Generator or Declarative Directive Generator, if an option has a help button and you click that, it usually shows the name of the plugin in which the thing is defined. For example, " (from Pipeline: Declarative)".
However, the help button for the “post: Post Stage or Build Conditions” directive seems to be nonfunctional. When I use the developer features of a Web browser to view the HTML DOM for the help button, it is defined like this:
<a tooltip="Help" helpurl="/jenkins/descriptor/org.jenkinsci.plugins.pipeline.modeldefinition.generator.PostDirective/help" href="#" class="jenkins-help-button" tabindex="9999" style="" title="Help"><span>?</span></a>
which at least hints to a “pipeline.modeldefinition” plugin. At that point, one can search for org.jenkinsci.plugins.pipeline.modeldefinition.generator PostDirective in the GitHub “jenkinsci” organization. This requires a GitHub account but finds PostDirective.java:
https://github.com/jenkinsci/pipeline-model-definition-plugin/blob/15978cd172a8d34e2cd6bf8a6bfeaa5514d44dad/pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/generator/PostDirective.java#L25-L36
The “fixed” condition is defined in this same repository and can be found by clicking “Go to file” and typing “fixed”.
Although the source code is in the same repository in this case, it is compiled to a separate plugin. The relevant code in PostDirective.getPossibleConditions calls BuildCondition.all():
https://github.com/jenkinsci/pipeline-model-definition-plugin/blob/15978cd172a8d34e2cd6bf8a6bfeaa5514d44dad/pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/generator/PostDirective.java#L74
BuildCondition is defined as an extension point:
https://github.com/jenkinsci/pipeline-model-definition-plugin/blob/15978cd172a8d34e2cd6bf8a6bfeaa5514d44dad/pipeline-model-extensions/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/model/BuildCondition.java#L53
which is in the pipeline-model-extensions plugin. The Extensions Index lists the classes that implement BuildCondition, including:
Apparently, the extension points are defined in Java in the pipeline-model-extensions plugin, and then they are implemented in Groovy in the pipeline-model-definition plugin.
It is unfortunate that the Extensions Index does not pinpoint the file in which each class is defined. I don’t know whether the plugin build processes for Java and Groovy code can save that information such that the Extensions Index could display it.