Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17575

Incorrect redirection after delete of job in folder in view

      If you create a top-level list view v, to which you add a folder d, and add a job j inside the folder, then delete j, you are redirected to /view/v/ rather than /view/v/job/d/ as expected.

      This is because in AbstractProject.doDoDelete, req.findAncestorObject(View.class) is v, whose url is view/v/. In this case we would be better served by using the super method's logic (the branch where view == null), since parent.url is view/v/job/d/ which is what we want. The use of view.url is only appropriate in case that view's view group is the same as this job's parent.

          [JENKINS-17575] Incorrect redirection after delete of job in folder in view

          Code changed in jenkins
          User: Jesse Glick
          Path:
          test/src/test/java/hudson/model/AbstractProjectTest.java
          http://jenkins-ci.org/commit/jenkins/dcff6e41302093b6ba90da0aa6e9b09a5cfe2b86
          Log:
          JENKINS-17575 Baseline testing of behavior without folders.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: test/src/test/java/hudson/model/AbstractProjectTest.java http://jenkins-ci.org/commit/jenkins/dcff6e41302093b6ba90da0aa6e9b09a5cfe2b86 Log: JENKINS-17575 Baseline testing of behavior without folders.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/model/AbstractProject.java
          test/src/main/java/org/jvnet/hudson/test/MockFolder.java
          test/src/test/java/hudson/model/AbstractProjectTest.java
          http://jenkins-ci.org/commit/jenkins/1205e9f6c492c53983a7f02926a53739b50b92fd
          Log:
          [FIXED JENKINS-17575] Redirecting properly after deleting jobs in folders.
          Expanded MockFolder to be a ViewGroup so that it is possible to test views inside folders,
          and generally fixed it to service Stapler hierarchies properly so that WebClient-based tests can work.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/AbstractProject.java test/src/main/java/org/jvnet/hudson/test/MockFolder.java test/src/test/java/hudson/model/AbstractProjectTest.java http://jenkins-ci.org/commit/jenkins/1205e9f6c492c53983a7f02926a53739b50b92fd Log: [FIXED JENKINS-17575] Redirecting properly after deleting jobs in folders. Expanded MockFolder to be a ViewGroup so that it is possible to test views inside folders, and generally fixed it to service Stapler hierarchies properly so that WebClient-based tests can work.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2453
          JENKINS-17575 Baseline testing of behavior without folders. (Revision dcff6e41302093b6ba90da0aa6e9b09a5cfe2b86)
          [FIXED JENKINS-17575] Redirecting properly after deleting jobs in folders. (Revision 1205e9f6c492c53983a7f02926a53739b50b92fd)

          Result = SUCCESS
          Jesse Glick : dcff6e41302093b6ba90da0aa6e9b09a5cfe2b86
          Files :

          • test/src/test/java/hudson/model/AbstractProjectTest.java

          Jesse Glick : 1205e9f6c492c53983a7f02926a53739b50b92fd
          Files :

          • changelog.html
          • test/src/test/java/hudson/model/AbstractProjectTest.java
          • test/src/main/java/org/jvnet/hudson/test/MockFolder.java
          • core/src/main/java/hudson/model/AbstractProject.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2453 JENKINS-17575 Baseline testing of behavior without folders. (Revision dcff6e41302093b6ba90da0aa6e9b09a5cfe2b86) [FIXED JENKINS-17575] Redirecting properly after deleting jobs in folders. (Revision 1205e9f6c492c53983a7f02926a53739b50b92fd) Result = SUCCESS Jesse Glick : dcff6e41302093b6ba90da0aa6e9b09a5cfe2b86 Files : test/src/test/java/hudson/model/AbstractProjectTest.java Jesse Glick : 1205e9f6c492c53983a7f02926a53739b50b92fd Files : changelog.html test/src/test/java/hudson/model/AbstractProjectTest.java test/src/main/java/org/jvnet/hudson/test/MockFolder.java core/src/main/java/hudson/model/AbstractProject.java

          Code changed in jenkins
          User: Jesse Glick
          Path:
          test/src/test/java/hudson/model/AbstractProjectTest.java
          http://jenkins-ci.org/commit/jenkins/adcdf612227537ec465b10ca6743fbd2903b9e4b
          Log:
          JENKINS-17575 Baseline testing of behavior without folders.
          (cherry picked from commit dcff6e41302093b6ba90da0aa6e9b09a5cfe2b86)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: test/src/test/java/hudson/model/AbstractProjectTest.java http://jenkins-ci.org/commit/jenkins/adcdf612227537ec465b10ca6743fbd2903b9e4b Log: JENKINS-17575 Baseline testing of behavior without folders. (cherry picked from commit dcff6e41302093b6ba90da0aa6e9b09a5cfe2b86)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/model/AbstractProject.java
          test/src/main/java/org/jvnet/hudson/test/MockFolder.java
          test/src/test/java/hudson/model/AbstractProjectTest.java
          http://jenkins-ci.org/commit/jenkins/134e01e5be84dbff193d7166b95534ed3b0d897e
          Log:
          [FIXED JENKINS-17575] Redirecting properly after deleting jobs in folders.
          Expanded MockFolder to be a ViewGroup so that it is possible to test views inside folders,
          and generally fixed it to service Stapler hierarchies properly so that WebClient-based tests can work.
          (cherry picked from commit 1205e9f6c492c53983a7f02926a53739b50b92fd)

          Compare: https://github.com/jenkinsci/jenkins/compare/3a527ecd5c67...134e01e5be84

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/AbstractProject.java test/src/main/java/org/jvnet/hudson/test/MockFolder.java test/src/test/java/hudson/model/AbstractProjectTest.java http://jenkins-ci.org/commit/jenkins/134e01e5be84dbff193d7166b95534ed3b0d897e Log: [FIXED JENKINS-17575] Redirecting properly after deleting jobs in folders. Expanded MockFolder to be a ViewGroup so that it is possible to test views inside folders, and generally fixed it to service Stapler hierarchies properly so that WebClient-based tests can work. (cherry picked from commit 1205e9f6c492c53983a7f02926a53739b50b92fd) Compare: https://github.com/jenkinsci/jenkins/compare/3a527ecd5c67...134e01e5be84

          Code changed in jenkins
          User: Jesse Glick
          Path:
          test/src/main/java/org/jvnet/hudson/test/MockFolder.java
          http://jenkins-ci.org/commit/jenkins-test-harness/c2059409d3075b3dd0217b33b88e0427720c1667
          Log:
          [FIXED JENKINS-17575] Redirecting properly after deleting jobs in folders.
          Expanded MockFolder to be a ViewGroup so that it is possible to test views inside folders,
          and generally fixed it to service Stapler hierarchies properly so that WebClient-based tests can work.
          Originally-Committed-As: 1205e9f6c492c53983a7f02926a53739b50b92fd

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: test/src/main/java/org/jvnet/hudson/test/MockFolder.java http://jenkins-ci.org/commit/jenkins-test-harness/c2059409d3075b3dd0217b33b88e0427720c1667 Log: [FIXED JENKINS-17575] Redirecting properly after deleting jobs in folders. Expanded MockFolder to be a ViewGroup so that it is possible to test views inside folders, and generally fixed it to service Stapler hierarchies properly so that WebClient-based tests can work. Originally-Committed-As: 1205e9f6c492c53983a7f02926a53739b50b92fd

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: