Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75072

Support documentation of EnvVar contributed by GitSCMExtension

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      As a Jenkins plugin developer, when I provide an implementation of the GitSCMExtension extension point with environment variables via the populateEnvironmentVariables method, I also need to be able to provide documentation.
      Such documentation I would expect to contribute to the page under the "Pipeline Syntax" -> "Global Variable Reference" menu under the "env" pipeline step.

      Actually Jenkins core lookup for a buildEnv.jelly or buildEnv.groovy resource in the classpath of the plugin that provides an entension of EnvironmentContributor or SCM.
      Since the SCM implementation (GitSCM) is provided by the git-plugin, any buildEnv.groovy resource in the plugin where the implementation of GitSCMExtension is placed is not taken into account.

          [JENKINS-75072] Support documentation of EnvVar contributed by GitSCMExtension

          Nikolas Falco added a comment -

          Some consideration in this comment of PR #949

          Nikolas Falco added a comment - Some consideration in this comment of PR #949

          Jesse Glick added a comment -

          I guess it could look up all GitSCMExtension’s and display their environment variables, though it could be confusing since the variables are only actually added if you do select that extension.

          Jesse Glick added a comment - I guess it could look up all GitSCMExtension ’s and display their environment variables, though it could be confusing since the variables are only actually added if you do select that extension.

          Nikolas Falco added a comment - - edited

          Yes, but also in a EnvironmentContributor you could add a variable only under some conditions. It's in charge of the developer document when a variable is present. For example branch api start each description with "For a multibranch project, ..." that means those variables does not exists in a standard pipeline project

          Nikolas Falco added a comment - - edited Yes, but also in a EnvironmentContributor you could add a variable only under some conditions. It's in charge of the developer document when a variable is present. For example branch api start each description with "For a multibranch project, ..." that means those variables does not exists in a standard pipeline project

            Unassigned Unassigned
            nfalco Nikolas Falco
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: