-
Improvement
-
Resolution: Unresolved
-
Major
-
None
It often happens that I modify a pipeline script, it runs for several minutes in Jenkins and then fails because I added a method call that needs approval. Then I approve that method, run it again and have to hope that there's not another method call I have to approve.
So IMHO it'd be great if Jenkins did some kind of "dry run" on a script to check if there's any method signature that still needs approval and immediately fails before the script was actually executed.
This may also have severe consequences, e.g. if a component was deployed and the script fails afterwards and it's impossible to roll back the deployment.
Also, it's not possible to add script approvals manually using the web interface so I actually have to wait for the script to fail.
So this is actually surprisingly hard: since Groovy is a dynamic language, we don't actually know what the types of variables will be until we get to them. Therefore, we can't tell what exactly the signature would be until we try to execute it. I'll leave this open since it's an aspirational goal, but it's not likely to happen.