Skip to content

[JENKINS-71515] Make codemirror-config a valid JSON#26

Merged
froque merged 1 commit intojenkinsci:masterfrom
yaroslavafenkin:JENKINS-71515
Sep 5, 2023
Merged

[JENKINS-71515] Make codemirror-config a valid JSON#26
froque merged 1 commit intojenkinsci:masterfrom
yaroslavafenkin:JENKINS-71515

Conversation

@yaroslavafenkin
Copy link
Contributor

Needed before jenkinsci/jenkins#6867 can get merged.

codemirror-config attribute is expected to be a valid JSON except the start and end bracket as per https://github.com/jenkinsci/jenkins/blob/cd3b1517e7a553fd6fcf39e25c4bd1e18fbe39de/core/src/main/resources/lib/form/textarea.jelly#L70-L73.

In the upstream change JSON#parse is used instead of eval to transform the codemirror-config into a JSON object. JSON#parse cannot parse function attributes, hence the drop of onBlur handler in this PR. There seems to be no need for it because this code re-adds it.

Testing done

Tested interactively against jenkinsci/jenkins#6867. Created a freestyle job, added the PowerShell build step. Made sure codemirror-config is parsed correctly, and no errors are thrown in the developer console.

### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue

@NotMyFault NotMyFault requested a review from a team August 30, 2023 19:38
@froque froque merged commit 97740d5 into jenkinsci:master Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants