MSDN > 論壇首頁 > Team Foundation Server - Build Automation > Build Retention Policy and Deleted Version Labels
發問發問
 

已答覆Build Retention Policy and Deleted Version Labels

  • Thursday, 25 September, 2008 15:31HATLANTA 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

     

    Thanks in advance, everyone.

     

    I have the retention policy in my builds to only keep the last two good builds, and that's fine.  However, when I used the Label Sidekick to view a baseline (version label) from many builds ago, that's when I realized that all my prior build labels are no longer on the code, and only the last two build labels still exist.

     

    How can I set up TFS so that I keep my build retention policy to only keep the last two good builds, and leave all the build version labels that are applied?

     

    I suppose I could add a target to the build script that'll assign a new label to the current build label, and that may work. But more importantly, I'd like to understand the connection between build version labels and the retention policy.

     

    Thanks.

解答

  • Tuesday, 30 September, 2008 12:47Jason Prickett - MSFTMSFT使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆

    Bill is right. That is our default behavior. However, in SP1 we added the ability to keep your labels. Here is how:

     

    The build admin can add a flag to the Web.config file on the Application Tier to specify that labels should not be deleted. Here is an example of what that line in the web.config file would look like:
    <add key="PreserveLabelsOnBuildDeletion" value="True"/>

     

    You may need to restart IIS to force the use of the new Web.config.


    When this value is present, labels are not deleted from Source Control. The default behavior is still the same as RTM; labels get deleted with their corresponding builds.

     

    Hope that helps,

    Jason

     

所有回覆

  • Monday, 29 September, 2008 2:58Bill.WangMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    Hi

    Build retention policy works by deleting old builds. When a build is deleted, the associated label is deleted too.

     

    When retention policy is set, we generally use changeset to track the source code. One of the best practice is adding changeset as part of the assembly version number. When a issue is reported against a particular version, you can extract the changeset number and track back to source code.

     

    For how to set changeset as part of assembly version, see this blog.

  • Tuesday, 30 September, 2008 12:47Jason Prickett - MSFTMSFT使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆

    Bill is right. That is our default behavior. However, in SP1 we added the ability to keep your labels. Here is how:

     

    The build admin can add a flag to the Web.config file on the Application Tier to specify that labels should not be deleted. Here is an example of what that line in the web.config file would look like:
    <add key="PreserveLabelsOnBuildDeletion" value="True"/>

     

    You may need to restart IIS to force the use of the new Web.config.


    When this value is present, labels are not deleted from Source Control. The default behavior is still the same as RTM; labels get deleted with their corresponding builds.

     

    Hope that helps,

    Jason