Currently the only supported directories for the Pipeline Shared Groovy Library plugin are "src" and "vars". It would be helpful if directories for storing configuration variables and unit tests were also supported. As stated in the plugin documentation "Other directories under the root are reserved for future enhancements.", so for reasons of forwards compatibility it makes sense for developers not to assume folders they create for these purposes won't break their libraries in future versions.

      Perhaps the "src" directory could support a more standard layout such as "src/main" , "src/test", "src/resources"? Or perhaps new directories at the top level such as "conf" and "test"?

      The "test" would be for unit testing the code in "src" and "vars". The "conf" directory would be used for configuration files such as YAML or JSON where credential IDs, job names etc. could be stored, decoupled from the code.

          [JENKINS-44481] Support test and configuration directories

          Jesse Glick added a comment -

          Not an exact duplicate of JENKINS-46721, as this requests something stronger—the ability to place specific folders in arbitrary locations, rather than in the current structure but under a lower root—but closely related.

          Jesse Glick added a comment - Not an exact duplicate of  JENKINS-46721 , as this requests something stronger—the ability to place specific folders in arbitrary locations, rather than in the current structure but under a lower root—but closely related.

          Adam Voss added a comment -

          jglick If I understand your comment correctly, I don't interpret this this request the same as you do.  I read this as a request for standardization of where config and test files are expected within a pipeline library rather than a request that there be configuration options for where each of the folders are.

          Adam Voss added a comment - jglick If I understand your comment correctly, I don't interpret this this request the same as you do.  I read this as a request for standardization of where config and test files are expected within a pipeline library rather than a request that there be configuration options for where each of the folders are.

          Jesse Glick added a comment -

          There is no standardization of testing Pipeline libraries, so that is not really an option.

          Jesse Glick added a comment - There is no standardization of testing Pipeline libraries, so that is not really an option.

          Adam Voss added a comment -

          There is no standardization of testing Pipeline libraries

          Is that really true?  The documentation seems to give a prescriptive directory structure which seems enforced in the code.

          Adam Voss added a comment - There is no standardization of testing Pipeline libraries Is that really true?  The documentation seems to give a  prescriptive directory structure which seems enforced in the code .

          Jesse Glick added a comment -

          Yes there is a defined directory structure—there has to be, or the feature could not work without having every library reference specify these folder paths. Testing is not part of that.

          Jesse Glick added a comment - Yes there is a defined directory structure—there has to be, or the feature could not work without having every library reference specify these folder paths. Testing is not part of that.

          Adam Voss added a comment -

          jglick In that case, what is actionable here?  I came here via workflow-cps-global-lib-plugin#40 where it is requested this JIRA be addressed.  That (testing) seems to be exactly what the requestor is asking for:

          It would be helpful if directories for storing configuration variables and unit tests were also supported.

           

          Adam Voss added a comment - jglick In that case, what is actionable here?  I came here via workflow-cps-global-lib-plugin#40 where it is requested this JIRA be addressed.  That (testing) seems to be exactly what the requestor is asking for: It would be helpful if directories for storing configuration variables and unit tests were also supported.  

          Jesse Glick added a comment -

          That PR would merely allow you to select a different subdirectory. Why you would do that, and what you place in other related directories, is up to you.

          Jesse Glick added a comment - That PR would merely allow you to select a different subdirectory. Why you would do that, and what you place in other related directories, is up to you.

            Unassigned Unassigned
            boon Joe Harte
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: