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-70591] Cannot create inline Pipeline job after Ace editor upgrade #657

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

basil
Copy link
Member

@basil basil commented Feb 9, 2023

#653 (comment) was an assertion without evidence, and also an incorrect one — the cause of JENKINS-70591 was #656, not #653. This was determined after a few minutes of bisection. Using the JQuery ready() API gets rid of this bug and is consistent with the code elsewhere in this file which uses JQuery rather than plain JavaScript. Note that I followed the recommended syntax:

jQuery offers several ways to attach a function that will run when the DOM is ready. All of the following syntaxes are equivalent:

  • $( handler )
  • $( document ).ready( handler )
  • $( "document" ).ready( handler )
  • $( "img" ).ready( handler )
  • $().ready( handler )

As of jQuery 3.0, only the first syntax is recommended; the other syntaxes still work but are deprecated.

The $(function() { syntax did look odd to me, but it is explicitly recommended in the documentation:

Which is equivalent to the recommended way of calling:

$(function() {
  // Handler for .ready() called.
});

To test this, I reproduced the problem described in JENKINS-70591 and verified the problem no longer occurred after this PR. I also repeated the testing done in #656 and #653.

@basil basil requested a review from a team as a code owner February 9, 2023 17:53
@jglick jglick added the bug label Feb 9, 2023
@jglick jglick enabled auto-merge February 9, 2023 18:03
@jglick jglick merged commit 13dba21 into jenkinsci:master Feb 9, 2023
@basil basil deleted the JENKINS-70591 branch February 9, 2023 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants