jenkinsci / jenkinsci/workflow-cps-plugin
[JENKINS-72230] Script security prompt for inline pipeline broken when perceived syntax error
- Dominant language
- Java
- Stars
- 186
- Forks
- 213
- Avg merge
- 12h 12m
- Merged PRs (30d)
- 8
Description
When there is a perceived error in an inline pipeline script, the dynamic messaging related to script approval does not update.
For me, I noticed when modifying a previously approved inline script that uses a shared library. The classes from the shared library are not recognized by the editor (this is "normal"), resulting in a validation error. The approval text below the editor remained at "This script is already approved" instead of updating to show the expected approval button.
As a workaround, the script could be approved in-place by saving the change and then opening up the config again. The updated script was loaded, along with the expected approval state description. (The new script was also available for approval from the script approval UI.)
---
Originally reported by
crussell52, imported from: Script security prompt for inline pipeline broken when perceived syntax error
Raw content of original issue
When there is a perceived error in an inline pipeline script, the dynamic messaging related to script approval does not update.
For me, I noticed when modifying a previously approved inline script that uses a shared library. The classes from the shared library are not recognized by the editor (this is "normal"), resulting in a validation error. The approval text below the editor remained at "This script is already approved" instead of updating to show the expected approval button.
As a workaround, the script could be approved in-place by saving the change and then opening up the config again. The updated script was loaded, along with the expected approval state description. (The new script was also available for approval from the script approval UI.)
- environment:
workflow-cps-plugin version: 3791.va_c0338ea_b_59c
2 attachments
- [approval-prompt-on-syntax-error.png](https://issues.jenkins.io/secure/attachment/61388/approval-prompt-on-syntax-error.png)
> 
- [approval-prompt-working.png](https://issues.jenkins.io/secure/attachment/61387/approval-prompt-working.png)
> 
Contributor guide
Research direction
Reproduce the issue in the workflow-cps-plugin inline pipeline editor by modifying an approved script that uses a shared library and triggers the perceived validation error. Trace the interaction between workflow-cps-plugin and script-security-plugin that supplies the approval status. Done means the approval message updates and shows the expected approval action without saving and reopening the configuration, with a regression test covering this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100