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

Building from workspace: Add checkbox to return workspace to a pristine state

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • teamconcert-plugin
    • None

      There should be a checkbox, when building from a workspace, to restore the checkout to its pristine state.

      I know you can do this with a build definition, but I cannot use build definitions[1] in my case and have to use workspaces.

      For example, the git scm plugin has this checkbox.

      See https://jazz.net/forum/questions/141370/scm-how-to-restore-a-workspace-to-pristine

      [1] I can't use build definitions because I cannot create, update, and destroy them in a programatic fashion. Manually creating 100s of build definitions is too boring.

          [JENKINS-21694] Building from workspace: Add checkbox to return workspace to a pristine state

          So Build definition's delete before loading is what you are doing now if I understand your forum question. Basically deleting the entire sandbox directory and then loading. I got from your forum post that this is too heavy.

          Sounds to me like you want the sandbox to hold exclusively just the contents of the workspace being built (i.e. some other build step can't populate the sandbox directory with other contents like scripts, tools, etc.). As well when the load takes place, it replaces the contents on disk with whats in the repository. If there are files/folders/links that are ignored & not in the repository, they should be deleted from disk (often build artifacts like bin directory, .class files etc. are marked as ignored and not in the repo, so they should be deleted to ensure a full build). Currently our load operation will leave those ignored items on disk.

          Just want to be sure I understand your definition of "pristine".

          Heather Fraser-Dube added a comment - So Build definition's delete before loading is what you are doing now if I understand your forum question. Basically deleting the entire sandbox directory and then loading. I got from your forum post that this is too heavy. Sounds to me like you want the sandbox to hold exclusively just the contents of the workspace being built (i.e. some other build step can't populate the sandbox directory with other contents like scripts, tools, etc.). As well when the load takes place, it replaces the contents on disk with whats in the repository. If there are files/folders/links that are ignored & not in the repository, they should be deleted from disk (often build artifacts like bin directory, .class files etc. are marked as ignored and not in the repo, so they should be deleted to ensure a full build). Currently our load operation will leave those ignored items on disk. Just want to be sure I understand your definition of "pristine".

          I have to admit I'm not super familiar with RTC and may have used incorrect terminology.

          I think what you said is what I mean. Just to be sure, I'll try again with different words:

          I'm currently deleting the Jenkins $WORKSPACE and then doing a "workspace load" (not a Build Definition load).

          What I'm asking for the $WORKSPACE to be in the same state at the beginning of build but without having to delete the workspace first allowing the checkout times to be much faster.

          The goal is so that the Team Concert plugin can do an "accept" with an existing workspace instead of re-downloading everything.

          It's odd this is so hard to explain. :-/

          Christian Höltje added a comment - I have to admit I'm not super familiar with RTC and may have used incorrect terminology. I think what you said is what I mean. Just to be sure, I'll try again with different words: I'm currently deleting the Jenkins $WORKSPACE and then doing a "workspace load" (not a Build Definition load). What I'm asking for the $WORKSPACE to be in the same state at the beginning of build but without having to delete the workspace first allowing the checkout times to be much faster. The goal is so that the Team Concert plugin can do an "accept" with an existing workspace instead of re-downloading everything. It's odd this is so hard to explain. :-/

          Heather Fraser-Dube added a comment - - edited

          So right now the load is not going to do what you want because it leaves the ignored files on disk.

          So I made a work item that will request that option on the load 303187: Provide a "Pristine" option for load

          I also made the work item for the build definition source control participant to support it too Support a "Pristine" load when configuring the source control of a build definition which would make the functionality available for use consistently in the plugin.

          I also updated work item 296206: Make "Just accept and fetch from a build workspace" more full featured to make sure it includes this as well.

          wrt to being able to have API to programmatically create/update/destroy build definitions, you will be interested in 272836: CCM Design SDK API. You might want to chime in there and identify the forum posts/workitems you have that describe your needs.

          Heather Fraser-Dube added a comment - - edited So right now the load is not going to do what you want because it leaves the ignored files on disk. So I made a work item that will request that option on the load 303187: Provide a "Pristine" option for load I also made the work item for the build definition source control participant to support it too Support a "Pristine" load when configuring the source control of a build definition which would make the functionality available for use consistently in the plugin. I also updated work item 296206: Make "Just accept and fetch from a build workspace" more full featured to make sure it includes this as well. wrt to being able to have API to programmatically create/update/destroy build definitions, you will be interested in 272836: CCM Design SDK API . You might want to chime in there and identify the forum posts/workitems you have that describe your needs.

            Unassigned Unassigned
            docwhat Christian Höltje
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: