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

support multiple unshelve changelists in one build step

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • None

      we have a sandbox build environment with view mapping contain several entries. Multiple dev shelve changes can collaborate on single on demand sandbox build. currently we have to create mutiple build steps to do so. I would be very very helpfull to be able to enter multiple changelists in one build step

          [JENKINS-32761] support multiple unshelve changelists in one build step

          dan tran added a comment -

          I wonder if the change is as simple as this? at UnshelveBuilder

          // Expand shelf ${VAR} as needed and set as LABEL
          String ids = ws.getExpand().format(shelf, false);

          String [] tokens = StringUtils.split( id );
          for ( String id: tokens ) {
          int change = Integer.parseInt(id);
          task.setShelf(change);
          task.setWorkspace(ws);
          if ( !buildWorkspace.act(task) )

          { return false; }

          }

          return true;

          dan tran added a comment - I wonder if the change is as simple as this? at UnshelveBuilder // Expand shelf ${VAR} as needed and set as LABEL String ids = ws.getExpand().format(shelf, false); String [] tokens = StringUtils.split( id ); for ( String id: tokens ) { int change = Integer.parseInt(id); task.setShelf(change); task.setWorkspace(ws); if ( !buildWorkspace.act(task) ) { return false; } } return true;

          Paul Allen added a comment -

          That could work if the changes were passed as some kind of list (space or comer separated).

          There are two places to unshelve, once during the SCM checkout stage (as a Review) or the other as a Build Step. The build step allows other things to happen first, but has the disadvantage that the unshelved changes are not reported in the build summary.

          A third option, is to hack MultiBranch support (https://jenkins.io/doc/pipeline/) for use with shelves. I'm looking to add support for multi branch in the near future.

          Paul Allen added a comment - That could work if the changes were passed as some kind of list (space or comer separated). There are two places to unshelve, once during the SCM checkout stage (as a Review) or the other as a Build Step. The build step allows other things to happen first, but has the disadvantage that the unshelved changes are not reported in the build summary. A third option, is to hack MultiBranch support ( https://jenkins.io/doc/pipeline/ ) for use with shelves. I'm looking to add support for multi branch in the near future.

          dan tran added a comment -

          perforce shelves are working very well for us. We have sandbox builds that have a real need to accept multiple unshelves in one entry. Did not know about the review feature. Could you place some inline help for each field?

          dan tran added a comment - perforce shelves are working very well for us. We have sandbox builds that have a real need to accept multiple unshelves in one entry. Did not know about the review feature. Could you place some inline help for each field?

          Karl Wirth added a comment -

          Beleive Jenkinsfiles and P4Groovy fixes this. If that is not a valid workaround please feel free to reopen this job and let us know why.

          Karl Wirth added a comment - Beleive Jenkinsfiles and P4Groovy fixes this. If that is not a valid workaround please feel free to reopen this job and let us know why.

            Unassigned Unassigned
            dantran dan tran
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: