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

Get the error when creating the view "cleartool mkview -tag $view-name $view-name" with plugin 1.7.4, additional view-name added at the end of command line

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • Windows XP, Jenkins 1.445,
      ClearCase UCM Baseline 1.7.4, ClearCase Plugin 1.3.7,
      Master - Slave configuration, Project tied to the slave.

      Get the error when creating the view "cleartool mkview -tag $view-name $view-name" with plugin 1.7.4.
      Additional view-name added at the end of command line.
      In the additional arguments i placed the UNC path to the view. In case I don't add it it gives me
      "... UNC path should be provided..." error.
      Log:
      Building remotely on builder
      [test] $ cleartool mkview -tag jenkins_Official_G4_FW_Platform_Dev_int_22 \\builder\cc_views\jenkins_Official_G4_FW_Platform_Dev_int_22 jenkins_Official_G4_FW_Platform_Dev_int_22
      cleartool: Error: Extra arguments: "jenkins_Official_G4_FW_Platform_Dev_int_22"

          [JENKINS-12272] Get the error when creating the view "cleartool mkview -tag $view-name $view-name" with plugin 1.7.4, additional view-name added at the end of command line

          I think it the same issue than JENKINS-8168.
          I also have the same problem with plugin 1.7.4 even if issue 8168 is considered fixed in version 1.7.2.
          Here is my output from UCM Baseline plugin 1.7.4 (Jenkins 1.484, ClearCase plugin 1.3.10.1):

           
          [workspace] $ cleartool mkview -tag build_SDR \\build\ccviews\build_SDR.vws build_SDR
          cleartool: Error: Extra arguments: "build_SDR"
          

          Daniel Marchese added a comment - I think it the same issue than JENKINS-8168 . I also have the same problem with plugin 1.7.4 even if issue 8168 is considered fixed in version 1.7.2. Here is my output from UCM Baseline plugin 1.7.4 (Jenkins 1.484, ClearCase plugin 1.3.10.1): [workspace] $ cleartool mkview -tag build_SDR \\build\ccviews\build_SDR.vws build_SDR cleartool: Error: Extra arguments: "build_SDR"

          Warren Racz added a comment -

          I too am faced with an issue where I need to be able to use -host -hpath -gpath in the mkview options. I am not a committer of the code, but I'll contribute by attempting to suggest a possible resolution...

          I believe the problem could be rectified in
          https://svn.jenkins-ci.org/trunk/hudson/plugins/clearcase-ucm-baseline/src/main/java/com/michelin/cio/hudson/plugins/clearcaseucmbaseline/ClearToolUcmBaseline.java

                  // HUDSON-6409
                  if(StringUtils.isNotBlank(mkviewOptionalParam)) {
                      cmd.addTokenized(Util.replaceMacro(mkviewOptionalParam, variableResolver));
                  }
          
                  // HUDSON-8168
                  // cleartool mkview ...
                  // { –stg/loc { view-stgloc-name | –aut/o }
                  //   | [ –hos/t hostname –hpa/th host-storage-pname –gpa/th global-storage-pname ] dynamic-view-storage-pname }
                  if(!StringUtils.contains(mkviewOptionalParam, "-stg")) {
                      cmd.add(viewName);
                  }
          

          If it's safe to assume that you only append the view name when there are no optional arguments passed in then I'd suggest this fix:

                  // HUDSON-6409, HUDSON-8168, JENKINS-12272
                  if(StringUtils.isNotBlank(mkviewOptionalParam)) {
                      cmd.addTokenized(Util.replaceMacro(mkviewOptionalParam, variableResolver));
                  } else {
                      cmd.add(viewName);
                  }
          

          Otherwise I think something like this should resolve it:

                  // HUDSON-6409
                  if(StringUtils.isNotBlank(mkviewOptionalParam)) {
                      cmd.addTokenized(Util.replaceMacro(mkviewOptionalParam, variableResolver));
                  }
          
                  // HUDSON-8168, JENKINS-122272
                  // cleartool mkview ...
                  // { –stg/loc { view-stgloc-name | –aut/o }
                  //   | [ –hos/t hostname –hpa/th host-storage-pname –gpa/th global-storage-pname ] dynamic-view-storage-pname }
                  if (!StringUtils.contains(mkviewOptionalParam, "-stg") && !StringUtils.contains(mkviewOptionalParam, "-host") && !StringUtils.contains(mkviewOptionalParam, "-hpath") && !StringUtils.contains(mkviewOptionalParam, "-gpath")) {
                      cmd.add(viewName);
                  }
          

          Warren Racz added a comment - I too am faced with an issue where I need to be able to use -host -hpath -gpath in the mkview options. I am not a committer of the code, but I'll contribute by attempting to suggest a possible resolution... I believe the problem could be rectified in https://svn.jenkins-ci.org/trunk/hudson/plugins/clearcase-ucm-baseline/src/main/java/com/michelin/cio/hudson/plugins/clearcaseucmbaseline/ClearToolUcmBaseline.java // HUDSON-6409 if (StringUtils.isNotBlank(mkviewOptionalParam)) { cmd.addTokenized(Util.replaceMacro(mkviewOptionalParam, variableResolver)); } // HUDSON-8168 // cleartool mkview ... // { –stg/loc { view-stgloc-name | –aut/o } // | [ –hos/t hostname –hpa/th host-storage-pname –gpa/th global-storage-pname ] dynamic-view-storage-pname } if (!StringUtils.contains(mkviewOptionalParam, "-stg" )) { cmd.add(viewName); } If it's safe to assume that you only append the view name when there are no optional arguments passed in then I'd suggest this fix: // HUDSON-6409, HUDSON-8168, JENKINS-12272 if (StringUtils.isNotBlank(mkviewOptionalParam)) { cmd.addTokenized(Util.replaceMacro(mkviewOptionalParam, variableResolver)); } else { cmd.add(viewName); } Otherwise I think something like this should resolve it: // HUDSON-6409 if (StringUtils.isNotBlank(mkviewOptionalParam)) { cmd.addTokenized(Util.replaceMacro(mkviewOptionalParam, variableResolver)); } // HUDSON-8168, JENKINS-122272 // cleartool mkview ... // { –stg/loc { view-stgloc-name | –aut/o } // | [ –hos/t hostname –hpa/th host-storage-pname –gpa/th global-storage-pname ] dynamic-view-storage-pname } if (!StringUtils.contains(mkviewOptionalParam, "-stg" ) && !StringUtils.contains(mkviewOptionalParam, "-host" ) && !StringUtils.contains(mkviewOptionalParam, "-hpath" ) && !StringUtils.contains(mkviewOptionalParam, "-gpath" )) { cmd.add(viewName); }

            danielpetisme Daniel Petisme
            ztavor Zeev Tavor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: