Skip to content
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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yaroslavafenkin
Copy link

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 Process Job DSLs build step. Made sure codemirror-config is parsed correctly, and no errors are thrown in the developer console.

Submitter checklist

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
    Options
  2. Ensure that the pull request title represents the desired changelog entry
    Options
  3. Please describe what you did
    Options
  4. Link to relevant issues in GitHub or Jira
    Options
  5. Link to relevant pull requests, esp. upstream and downstream changes
    Options
  6. Ensure you have provided tests - that demonstrates feature works or fixes the issue
    Options

@yaroslavafenkin yaroslavafenkin requested a review from a team as a code owner August 16, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants