[JIRA] (JENKINS-61429) Unable to move/reorder steps within a job

0 views
Skip to first unread message

dbeck@cloudbees.com (JIRA)

unread,
Mar 11, 2020, 12:53:03 PM3/11/20
to jenkinsc...@googlegroups.com
Daniel Beck updated an issue
 
Jenkins / Bug JENKINS-61429
Unable to move/reorder steps within a job
Change By: Daniel Beck
Summary: Unable to move/reorder items steps within a job
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

dbeck@cloudbees.com (JIRA)

unread,
Mar 11, 2020, 1:02:06 PM3/11/20
to jenkinsc...@googlegroups.com
Daniel Beck commented on Bug JENKINS-61429
 
Re: Unable to move/reorder steps within a job

I confirmed system config and view config are unaffected (and they use the pre-2.0 config page style).

dbeck@cloudbees.com (JIRA)

unread,
Mar 11, 2020, 1:05:03 PM3/11/20
to jenkinsc...@googlegroups.com

Folders are affected too, and they use the 2.0 config page style, just like freestyle jobs.

dbeck@cloudbees.com (JIRA)

unread,
Mar 11, 2020, 1:11:03 PM3/11/20
to jenkinsc...@googlegroups.com

A workaround would be to delete build steps and recreate them, as newly created steps can be reordered. That's only really feasible with simple build steps like shell/batch though, as they're basically one big textarea can can be copied easily into a new step.

fqueiruga@cloudbees.com (JIRA)

unread,
Mar 12, 2020, 6:40:03 AM3/12/20
to jenkinsc...@googlegroups.com

fqueiruga@cloudbees.com (JIRA)

unread,
Mar 12, 2020, 6:41:03 AM3/12/20
to jenkinsc...@googlegroups.com
Félix Queiruga Balado commented on Bug JENKINS-61429
 
Re: Unable to move/reorder steps within a job

I created a PR that fixes it. I'm doing some comprehensive manual testing to ensure everything is alright.

dbeck@cloudbees.com (JIRA)

unread,
Mar 12, 2020, 6:42:03 AM3/12/20
to jenkinsc...@googlegroups.com
Daniel Beck started work on Bug JENKINS-61429
 
Change By: Daniel Beck
Status: Open In Progress

dbeck@cloudbees.com (JIRA)

unread,
Mar 12, 2020, 6:42:03 AM3/12/20
to jenkinsc...@googlegroups.com

fqueiruga@cloudbees.com (JIRA)

unread,
Mar 12, 2020, 1:31:04 PM3/12/20
to jenkinsc...@googlegroups.com
 
Re: Unable to move/reorder steps within a job

I have a better idea of what caused this regression. I’ll try to explain it.

The war/src/main/js/config-scrollspy.js JS entry point contains some fixes for drag & drop behaviour for the job and folders form forms. Fixes are applied on a proxied Behaviour.specify call on the tabbar.js file it imports. These fixes are initialized by a function wrapped within a $() jquery block .(https://github.com/jenkinsci/jenkins/blob/23ab517cb4de3edd80e07b77d332d47eb9049276/war/src/main/js/config-scrollspy.js#L29).

Before 2.217, the code would run in the following order:

  1. config-scrollspy.js loads and it’s executed.
  2. The initialization code runs immediatly and the Behaviour.specify call registers the fixes (https://github.com/jenkinsci/jenkins/blob/1ca9f6e8d649be88adb364da5dc2533706a8bfa5/war/src/main/js/widgets/config/tabbar.js#L13)
  3. The window.onload event handler is triggered, and runs all pieces of code set up via Behaviour.specify

On 2.217+:

  1. config-scrollspy.js loads and it’s script-level code is executed, but the initialization code does not run.
  2. The window.onload event handler is triggered, and runs all pieces of code set up via Behaviour.specify. Because the intialization code was not yet run on the config-scrollspy.js file, drag & drop widgets existing on the page are not initialized.
  3. The initialization code for the drag & drop fixes is run. Because it came after the _window.onload _event, it will only apply to draggable widgets added after this point (i.e. recently added and unsaved steps).

Basically, jQuery will wait until window.onload event to run the subscription code on 2.217+. The fix consists on moving the Behaviour.specify call on the tabbar.js file to be run when the script loads, so that it happens before the window.onload event.

I don’t think it will negatively impact any other part of the app / plugin.

bmathus+ossjira@cloudbees.com (JIRA)

unread,
Mar 13, 2020, 9:37:05 AM3/13/20
to jenkinsc...@googlegroups.com
Change By: Baptiste Mathus
Status: In Review Fixed but Unreleased
Resolution: Fixed

bmathus+ossjira@cloudbees.com (JIRA)

unread,
Mar 13, 2020, 9:37:05 AM3/13/20
to jenkinsc...@googlegroups.com
Baptiste Mathus updated an issue
Change By: Baptiste Mathus
Released As: (towards) 2.226

bmathus+ossjira@cloudbees.com (JIRA)

unread,
Mar 16, 2020, 6:16:05 AM3/16/20
to jenkinsc...@googlegroups.com

bmathus+ossjira@cloudbees.com (JIRA)

unread,
Mar 16, 2020, 6:16:05 AM3/16/20
to jenkinsc...@googlegroups.com
Baptiste Mathus updated an issue
Change By: Baptiste Mathus
Released As: (towards) 2.226

ogondza@gmail.com (JIRA)

unread,
Apr 3, 2020, 4:44:05 AM4/3/20
to jenkinsc...@googlegroups.com
Oliver Gondža updated an issue
Change By: Oliver Gondža
Labels: lts 2.222.1 - candidate fixed regression
Reply all
Reply to author
Forward
0 new messages