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

Invoke Batch Tasks should support Folder absolute path

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • batch-task-plugin
    • Jenkins 1.642.2
      Folders Plugin 5.11
      Batch Task Plugin 1.17

      When using folders (plugin), the batch tasks to be triggered must be referenced with an absolute path: while the task suggestion field works fine with a relative job path during configuration, the batch task is not properly configured in the later screens.

      Let's consider a folder named aFolder with a job named aJob; that job has a batch task named aBatchTask

      On http://.../jenkins/job/aFolder/job/aJob/configure :
      Add an Invoke batch tasks post build step with two tasks, one absolute and one relative:

      • Project: /aFolder/aJob
      • Task: aBatchTask
      • Project: aJob
      • Task: aBatchTask

      On http://.../jenkins/job/aFolder/job/aJob :
      The "Downstream Tasks" lists:

      • aFolder » aJob » aBatchTask
      • Invalid entry: aJob » aBatchTask

      An absolute job reference seems to be required here.

          [JENKINS-35188] Invoke Batch Tasks should support Folder absolute path

          jcarsique I don't think there is any issue here - only that your project name is not /aFolder/aJob but aFolder/aJob.

          If you go to this job: http://localhost:8080/jenkins/job/aFolder/job/aJob - you should have a section which tells you: Full project name: - this is indeed the name of the project you should use.

          Can you try this and close this Jira issue in case I am right, please?

          Félix Belzunce Arcos added a comment - jcarsique I don't think there is any issue here - only that your project name is not /aFolder/aJob but aFolder/aJob . If you go to this job: http://localhost:8080/jenkins/job/aFolder/job/aJob - you should have a section which tells you: Full project name: - this is indeed the name of the project you should use. Can you try this and close this Jira issue in case I am right, please?

          fbelzunc Indeed, the Full project name is "aFolder/aJob" but:

          • the absolute reference "/aFolder/aJob" is valid too,
          • the configuration screen validates the user entry: both absolute and relative references are accepted.

          I'm editing the issue title to be more precise: beside that bug, the folders are supported, you're right.

          However, I confirm there is an issue: the configuration screen validates a value which is later not working. The bug is likely not in the validation but in the later use. The screens must be consistent and I don't see any reason to restrict the use to relative paths only, is there?

          Julien Carsique added a comment - fbelzunc Indeed, the Full project name is "aFolder/aJob" but: the absolute reference "/aFolder/aJob" is valid too, the configuration screen validates the user entry: both absolute and relative references are accepted. I'm editing the issue title to be more precise: beside that bug, the folders are supported, you're right. However, I confirm there is an issue: the configuration screen validates a value which is later not working. The bug is likely not in the validation but in the later use. The screens must be consistent and I don't see any reason to restrict the use to relative paths only, is there?

          Julien Carsique added a comment - - edited

          Note also that from aFolder/aJob, the relative reference aFolder/aJob is wrong and the true relative reference aJob should work. Else how could it be possible to copy a folder?
          Finally, the only working reference is the only one which should not :/

          In any place, it should be possible to use either absolute or relative path.

          • /aFolder/aJob should work from anywhere
          • aJob should work from any job in /aFolder/
          • aFolder/aJob should not work from /aFolder/ but only from root.

          Julien Carsique added a comment - - edited Note also that from aFolder/aJob , the relative reference aFolder/aJob is wrong and the true relative reference aJob should work. Else how could it be possible to copy a folder? Finally, the only working reference is the only one which should not :/ In any place, it should be possible to use either absolute or relative path. /aFolder/aJob should work from anywhere aJob should work from any job in /aFolder/ aFolder/aJob should not work from /aFolder/ but only from root.

          I proposed: https://github.com/jenkinsci/batch-task-plugin/pull/3

          For the moment I prefer not fully support the / because it will be a hack on the plugin, this should be addressed on jenkins-core or in a separate plugin.

          Félix Belzunce Arcos added a comment - I proposed: https://github.com/jenkinsci/batch-task-plugin/pull/3 For the moment I prefer not fully support the / because it will be a hack on the plugin, this should be addressed on jenkins-core or in a separate plugin.

          +1 for https://github.com/jenkinsci/batch-task-plugin/pull/3 as an improvement regarding the current situation, although keeping the current issue opened.

          Julien Carsique added a comment - +1 for https://github.com/jenkinsci/batch-task-plugin/pull/3 as an improvement regarding the current situation, although keeping the current issue opened.

          Code changed in jenkins
          User: Félix Belzunce Arcos
          Path:
          src/main/java/hudson/plugins/batch_task/BatchTaskInvoker.java
          src/main/resources/hudson/plugins/batch_task/BatchTaskInvoker/Config/help-project.html
          src/main/resources/hudson/plugins/batch_task/BatchTaskInvoker/Config/help-task.html
          src/main/resources/hudson/plugins/batch_task/Messages.properties
          http://jenkins-ci.org/commit/batch-task-plugin/76be8f7680baa4879d484d5f751d98892c97d20d
          Log:
          JENKINS-35188 Add warning when Project start by /

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Félix Belzunce Arcos Path: src/main/java/hudson/plugins/batch_task/BatchTaskInvoker.java src/main/resources/hudson/plugins/batch_task/BatchTaskInvoker/Config/help-project.html src/main/resources/hudson/plugins/batch_task/BatchTaskInvoker/Config/help-task.html src/main/resources/hudson/plugins/batch_task/Messages.properties http://jenkins-ci.org/commit/batch-task-plugin/76be8f7680baa4879d484d5f751d98892c97d20d Log: JENKINS-35188 Add warning when Project start by /

          Code changed in jenkins
          User: Felix Belzunce Arcos
          Path:
          src/main/java/hudson/plugins/batch_task/BatchTaskInvoker.java
          src/main/resources/hudson/plugins/batch_task/BatchTaskInvoker/Config/help-project.html
          src/main/resources/hudson/plugins/batch_task/BatchTaskInvoker/Config/help-task.html
          src/main/resources/hudson/plugins/batch_task/Messages.properties
          http://jenkins-ci.org/commit/batch-task-plugin/25303f8665a9af99f9fecd7261641e578f349a49
          Log:
          Merge pull request #3 from fbelzunc/JENKINS-35188

          [FIXED JENKINS-35410] Improve User Experience

          Compare: https://github.com/jenkinsci/batch-task-plugin/compare/70c492a35deb...25303f8665a9

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Felix Belzunce Arcos Path: src/main/java/hudson/plugins/batch_task/BatchTaskInvoker.java src/main/resources/hudson/plugins/batch_task/BatchTaskInvoker/Config/help-project.html src/main/resources/hudson/plugins/batch_task/BatchTaskInvoker/Config/help-task.html src/main/resources/hudson/plugins/batch_task/Messages.properties http://jenkins-ci.org/commit/batch-task-plugin/25303f8665a9af99f9fecd7261641e578f349a49 Log: Merge pull request #3 from fbelzunc/ JENKINS-35188 [FIXED JENKINS-35410] Improve User Experience Compare: https://github.com/jenkinsci/batch-task-plugin/compare/70c492a35deb...25303f8665a9

            fbelzunc Félix Belzunce Arcos
            jcarsique Julien Carsique
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: