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

Labels ignore/convert exclusionary view mappings

    XMLWordPrintable

Details

    Description

      When using exclusionary view mappings the label created changes the exclusion to an inclusion.

      Example client view:

      //depot/Freestyle/... //${P4_CLIENT}/Freestyle/...
      -//depot/Freestyle/main/sub1/... //${P4_CLIENT}/Freestyle/main/sub1/...
      -//depot/Freestyle/main/sub2/... //${P4_CLIENT}/Freestyle/main/sub2/...
      -//depot/Freestyle/main/sub3/... //${P4_CLIENT}/Freestyle/main/sub3/...
      //depot/sub/... //${P4_CLIENT}/sub/...
      

      Example label produced:

      Label:  jenkins-LabelTest
      Owner:  jenkins
      Description:
              Jenkins post-build label.
      Options:        unlocked noautoreload
      Revision:       @303
      View:
              //depot/Freestyle/...
              //depot/Freestyle/main/sub1/...
              //depot/Freestyle/main/sub2/...
              //depot/Freestyle/main/sub3/...
              //depot/sub/...

      This causes the label to contain more files ('//depot/Freestyle/main/sub*/...') than was included in the build.

       

      Reproduction steps:

      (1) Create a freestyle job with exclusionary mappings in the client view (example above).

      (2) Add the 'Post Build Action' called 'Perforce:label'.

      (3) Save and run the job.

      (4) Look at the label generated (p4 label -o LabelName).

       

      Attachments

        Activity

          p4karl Karl Wirth added a comment -

          Was a P4Java bug that is being investigated. Hopefully a fix will be available when the P4Plugin is rebuilt with latest P4Java.

          p4karl Karl Wirth added a comment - Was a P4Java bug that is being investigated. Hopefully a fix will be available when the P4Plugin is rebuilt with latest P4Java.
          p4paul Paul Allen added a comment -

          Released in 1.12.3

          p4paul Paul Allen added a comment - Released in 1.12.3
          p4karl Karl Wirth added a comment -

          Reopening.

          Still broken in 1.12.4.

          In 1.13.1 its worse. You get an error message and the label is not created:

          New Test Failed due to P4: Could not label: hudson.AbortException: P4: Task Exception: com.perforce.p4java.exception.RequestException: Error in label specification.
          Error detected at line 14.
          Null directory (//) not allowed in '"//depot/proj/....info"'.  

          We can reproduce this error at the command line if you create a label view with the '-' being outside quotes:

          $ p4 --field View+=-\"//depot/proj/....info\" label -o autotest | p4 label -i
          Error in label specification.
          Error detected at line 18.
          Null directory (//) not allowed in '"//depot/proj/....info"'.  

          In the above P4 based example we are using the view:

          -"//depot/proj/...info" 
          

           

           

           

           

          p4karl Karl Wirth added a comment - Reopening. Still broken in 1.12.4. In 1.13.1 its worse. You get an error message and the label is not created: New Test Failed due to P4: Could not label: hudson.AbortException: P4: Task Exception: com.perforce.p4java.exception.RequestException: Error in label specification. Error detected at line 14. Null directory ( //) not allowed in ' "//depot/proj/....info" ' . We can reproduce this error at the command line if you create a label view with the '-' being outside quotes: $ p4 --field View+=-\ " //depot/proj/....info\" label -o autotest | p4 label -i Error in label specification. Error detected at line 18. Null directory ( //) not allowed in ' "//depot/proj/....info" ' . In the above P4 based example we are using the view: - " //depot/proj/...info"        
          joel_brown Joel Brown added a comment - Pull created for fix, https://github.com/jenkinsci/p4-plugin/pull/157
          p4paul Paul Allen added a comment -

          Released in 1.13.2

          p4paul Paul Allen added a comment - Released in 1.13.2

          People

            Unassigned Unassigned
            p4karl Karl Wirth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: