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

list-jobs CLI command should not list ItemgGroups of any items but TopLevelItems

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • cli
    • None

      Currently, list-jobs command tries to list any ItemGroups (including MavenModuleSet or MatrixProject which does not make sense). It should list instances of View and ItemGroup<? extends TopLevelItem> exclusively.

      jenkins-cli.jar list-jobs MyMatrixJob fails with:

      java.lang.ClassCastException: hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem
      	at hudson.cli.ListJobsCommand.run(ListJobsCommand.java:88)
      	at hudson.cli.CLICommand.main(CLICommand.java:229)
      	at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:282)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:263)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:222)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:326)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
      	at hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      	at java.lang.Thread.run(Thread.java:662)
      

          [JENKINS-18393] list-jobs CLI command should not list ItemgGroups of any items but TopLevelItems

          Oliver Gondža created issue -
          Oliver Gondža made changes -
          Description New: Currently, {{list-jobs}} command tries to list any {{ItemGroups}} (including {{MavenModuleSet}} or {{MatrixProject}} which does not make sense). It should list instances of {{View}} and {{ItemGroup<? extends TopLevelItem>}} exclusively.

          {{jenkins-cli.jar list-jobs MyMatrixJob}} fails with:
          {noformat}
          java.lang.ClassCastException: hudson.matrix.MatrixConfiguration cannot be cast to hudson.model.TopLevelItem
          at hudson.cli.ListJobsCommand.run(ListJobsCommand.java:88)
          at hudson.cli.CLICommand.main(CLICommand.java:229)
          at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:282)
          at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:263)
          at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:222)
          at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:326)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
          at hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
          at java.lang.Thread.run(Thread.java:662)
          {noformat}
          Summary Original: list-jobs CLI command should list TopLevelItems exclusively New: list-jobs CLI command should not list ItemgGroups of any items but TopLevelItems
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 149700 ] New: JNJira + In-Review [ 193249 ]

            olivergondza Oliver Gondža
            olivergondza Oliver Gondža
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: