Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2023

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