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

Declarative Pipeline GDSL

    XMLWordPrintable

Details

    • Declarative - 1.2

    Attachments

      Issue Links

        Activity

          jameshowe James Howe added a comment -

          ggarcia24 if you have code that generates the GSDL please share it. The result will be different for every Jenkins instance depending on what plugins (and versions thereof) are installed.

          jameshowe James Howe added a comment - ggarcia24 if you have code that generates the GSDL please share it. The result will be different for every Jenkins instance depending on what plugins (and versions thereof) are installed.
          cyberjoac Joachim Hagege added a comment - - edited

          Any news on this ? 
          Would be lovely to have support in IntelliJ IDEA of pipeline syntax !

          cyberjoac Joachim Hagege added a comment - - edited Any news on this ?  Would be lovely to have support in IntelliJ IDEA of pipeline syntax !
          joepohl Jozsef Pohl added a comment -

          Some update on this topic: I tried to use the gdsl file created by ggarcia24, and also checked a fork. Although it is possible to add support for every plugin, I could not find a way to support some parts of the basic pipeline structure.

          For example gdsl alone is not enough for the IDE to properly identify global variables and shared libraries. I suppose the whole jenkins library has to be linked inside the project somehow. Also the agent any expression will always be rejected by the IDE since it interprets the any word as a method, not a parameter. Finally I could not find out how to handle the typed parameters like enums (eg. changeRequest comparator) or time units (java.util.concurrent.TimeUnit). Not to mention some tiny details like order and max number of sections/directives.

          Based on these, I think it is impossible to create a gdsl for full IDE awareness of the declarative pipeline. It can improve the UX for some extent, but will never help with the most trivial syntactic issues. However a different approach could solve this problem. The best would be to change the declarative syntax for more strict logic (like yaml), and investigate the new linting possibilities. The other way is to improve the REST validation endpoint in Jenkins to report with more useful messages.

          joepohl Jozsef Pohl added a comment - Some update on this topic: I tried to use the gdsl file created by ggarcia24 , and also checked a fork . Although it is possible to add support for every plugin , I could not find a way to support some parts of the basic pipeline structure . For example gdsl alone is not enough for the IDE to properly identify global variables and shared libraries. I suppose the whole jenkins library has to be linked inside the project somehow. Also the agent any expression will always be rejected by the IDE since it interprets the any word as a method, not a parameter. Finally I could not find out how to handle the typed parameters like enums (eg. changeRequest comparator) or time units (java.util.concurrent.TimeUnit). Not to mention some tiny details like order and max number of sections/directives. Based on these, I think it is impossible to create a gdsl for full IDE awareness of the declarative pipeline . It can improve the UX for some extent, but will never help with the most trivial syntactic issues. However a different approach could solve this problem. The best would be to change the declarative syntax for more strict logic ( like yaml ), and investigate the new linting possibilities. The other way is to improve the REST validation endpoint in Jenkins to report with more useful messages.
          max8jenkins Max Calderoni added a comment - - edited

          Also looking forward to news on this.

          Or perhaps some instructions somewhere on how to properly set up your IDE for developing pipelines, including libraries, for what can be done now (I wonder why this has not already been supported for a long time, being Jenkins so popular...).

          So far, I found, among other things, these two sources, one describing how to set up Intellij using gradle, and one comment by jameshowe in gitter describing how to set up the linter.

          Finally, jenkinsfile-runner should be included in an IDE setup so that pipelines can also be run from the IDE.

          max8jenkins Max Calderoni added a comment - - edited Also looking forward to news on this. Or perhaps some instructions somewhere on how to properly set up your IDE for developing pipelines, including libraries, for what can be done now (I wonder why this has not already been supported for a long time, being Jenkins so popular...). So far, I found, among other things, these two sources, one describing how to set up Intellij using gradle , and one comment by jameshowe in gitter describing how to set up the linter. Finally, jenkinsfile-runner should be included in an IDE setup so that pipelines can also be run from the IDE.
          jameshowe James Howe added a comment -

          Just to note RE that comment, the IDEA plugin was updated and now works fine.

          jameshowe James Howe added a comment - Just to note RE that comment, the IDEA plugin was updated and now works fine.

          People

            rsandell rsandell
            abayer Andrew Bayer
            Votes:
            83 Vote for this issue
            Watchers:
            59 Start watching this issue

            Dates

              Created:
              Updated: