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

When using Streams, custom view definition seems to be ignored

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      p4-plugin 1.8.5
      Jenkins 2.105
    • Similar Issues:

      Description

      I have a Perforce stream called //UE4/main and in a subdirectory I have the SteamCMD utility.

      To use the steamcmd utility I defined a job that maps that specific directory to the workspace only, like so:

      Unfortunately, when this job was ran, the resulting workspace was like so:

      Which resulted in an unnecessary download of about 13 80 Gb of content (when I only needed 2 Mb).

      I don't think I specified the view incorrectly (essentially, it should have only synced Tools/BuildScripts/Uploaders/Steam/ to the workspace folder Steam).

        Attachments

          Activity

          Hide
          mdelikat Mateusz Delikat added a comment - - edited

          It seems as if view mappings are being forced onto workspace view, but since it's specified as a stream workspace those can't be applied onto its specification.

          In old perforce plugin there were two "view maps" - one of those (when checked) could work as an overlay for jenkins to know what to sync and how to populate changeLogSet without interfering with workspace stream specification. This was ideal for situations like the one mentioned in this report.

           

          Show
          mdelikat Mateusz Delikat added a comment - - edited It seems as if view mappings are being forced onto workspace view, but since it's specified as a stream workspace those can't be applied onto its specification. In old perforce plugin there were two "view maps" - one of those (when checked) could work as an overlay for jenkins to know what to sync and how to populate changeLogSet without interfering with workspace stream specification. This was ideal for situations like the one mentioned in this report.  
          Hide
          p4paul Paul Allen added a comment -

          I have a possible workaround using the 'Preview Check Only' option (sync -n ...), but for the moment it will require a 'Pipeline' build.

          You would need to create a Jenkinsfile and checkout the code using a Streams workspace with the 'Preview Check Only' option; then use a P4 Groovy step to sync just the files you need from the same workspace definition.

          If you think this will work, but you would prefer to use the older FreeStyle Jenkins job, I would need to add a sync step or you would have to call out to a script.

          Show
          p4paul Paul Allen added a comment - I have a possible workaround using the 'Preview Check Only' option (sync -n ...), but for the moment it will require a 'Pipeline' build. You would need to create a Jenkinsfile and checkout the code using a Streams workspace with the 'Preview Check Only' option; then use a P4 Groovy step to sync just the files you need from the same workspace definition. If you think this will work, but you would prefer to use the older FreeStyle Jenkins job, I would need to add a sync step or you would have to call out to a script.
          Hide
          mdelikat Mateusz Delikat added a comment -

          Is P4Groovy step going to update changeset for the build when used that way?

          Show
          mdelikat Mateusz Delikat added a comment - Is P4Groovy step going to update changeset for the build when used that way?
          Hide
          p4paul Paul Allen added a comment -

          Unfortunately no; P4Groovy runs outside of Jenkins and will not update the built changes list. However the Preview Check Only option should record the changes and set the sync ID; this is used to report the changes in the build summary and record the SyncID used by polling to figure out if a build is required.

          Show
          p4paul Paul Allen added a comment - Unfortunately no; P4Groovy runs outside of Jenkins and will not update the built changes list. However the Preview Check Only option should record the changes and set the sync ID; this is used to report the changes in the build summary and record the SyncID used by polling to figure out if a build is required.
          Hide
          mdelikat Mateusz Delikat added a comment - - edited

          Paul Allen: Would it work, if I'd create a label my_label with revision field set as @X, where X is a changelist number submitted to stream {my_stream} with a view:

          //{my_stream}/...
          -//{my_stream}/{some_path}/...

          And then setting pin in p4sync to "@my_label,@my_label"?

          With "p4 sync //{my_stream}/...@{my_label}" it all files excluded from label are deleted, but with "p4 sync //{my_stream}/...@{my_label},@{my_label}" it looks like those excluded are left behind and not sync'ed, which basically is ideal. Does this construct work with p4sync pin feature?

          Show
          mdelikat Mateusz Delikat added a comment - - edited Paul Allen : Would it work, if I'd create a label my_label with revision field set as @X, where X is a changelist number submitted to stream {my_stream} with a view: //{my_stream}/... -//{my_stream}/{some_path}/... And then setting pin in p4sync to "@my_label,@my_label"? With "p4 sync //{my_stream}/...@{my_label}" it all files excluded from label are deleted, but with "p4 sync //{my_stream}/...@{my_label},@{my_label}" it looks like those excluded are left behind and not sync'ed, which basically is ideal. Does this construct work with p4sync pin feature?

            People

            • Assignee:
              p4paul Paul Allen
              Reporter:
              tsaukpaetra Harry Takata
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: