There is many things that work in Groovy that doesn't in Pipeline scripting. 
Also the scripts approval for string manipulation and all those nightmare ish 
behavior make it trial and error to write something that actually work. Often I 
end up doing ugly for loop just because foreach and the like behave like crap. 
I wish it was Groovy with a library addon, but it ain't. The pipeline idea was 
a great idea. The usage of Groovy ish scripting language was a bad one. This is 
a pipeline, it will do extensive file manipulation and source operation, they 
should have chosen a scripting language that can do those thing easily. I 
understand that the backend is Java and using Groovy as the scripting engine 
over it was easier by nature, but this is not even full fledge Groovy and the 
behavior is unpredictable at best. @NonCPS anyone? string regex that need 
approval...

I rely more and more on Python and Groovy only call a python script now a day. 
I did try to put more stuff into that pipeline syntax, but it always end up in 
pain and hard to achieve cross platform scripts.

Mark Waite:

> We've had many users that expected Jenkins Pipeline to be Groovy 
> (especially scripted Pipeline users) instead of being a domain 
> specific language that is based on Groovy.  I fear that linking to 
> more details of Groovy syntax will tend to confuse those users even 
> more rather than clarify for them.

If the declarative syntax of Jenkins is not a strict sub- or superset of 
Groovy, and if the differences are not easy to list, then I agree.

> The syntax of Declarative Pipeline is quite specific to Jenkins.
> Linking from Declarative Pipeline documentation to the Groovy syntax 
> seems to me like it will be more likely to confuse users rather than 
> clarify for them.  Declarative Pipeline is well suited for use in the 
> Blue Ocean pipeline editor and in defining Pipelines with Jenkins.

Then my question remains: where can I find the specification, or at least a 
reasonably detailed descriptionp[1], of the Jenkins declarative syntax? The 
only description that I have been able to locate is:

https://www.jenkins.io/doc/book/pipeline/#declarative-pipeline-fundamentals ,

but instead of specifying or describing the syntax, it gives a small example 
and calls it a day. If Jenkins users ought not to study the declarative syntax 
from the Groovy documenation, Jenkins should provide its own. And it should be 
sufficient for writing a Jenkinsfile without asking here or looking elsewhere.

> I'd rather include specific descriptions of syntax rules for single 
> quote and double quote strings and for variable expansion rather than 
> link to the Groovy documentation.

That would be great. Has this not come up before? How do users learn the 
declarative syntax?

1. With the example of Markdown,
   Description:   https://daringfireball.net/projects/markdown/syntax
   Specification: https://spec.commonmark.org/0.29/

   Another good example is the C programming language, specified in
   an ISO standard and described in the famous book by K&R.

   In the long run, I think both are needed, but I should be happy
   with just a more detailed informal description.

--
()  ascii ribbon campaign - against html e-mail /\  
http://preview.tinyurl.com/qcy6mjc [archived]

--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/20200816013539.47dad1d2cadf88723ced7b13%40gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/YTOPR0101MB23154789E926DB25220F6D3BCD5F0%40YTOPR0101MB2315.CANPRD01.PROD.OUTLOOK.COM.

Reply via email to