Team Foundation Server 2018 发行说明Team Foundation Server 2018 Release Notes

开发者社区 | 系统要求和兼容性 | 许可条款 | TFS DevOps 博客 | SHA-1 哈希 | 最新 Visual Studio 2019 发行说明Developer Community | System Requirements and Compatibility | License Terms | TFS DevOps Blog | SHA-1 Hashes | Latest Visual Studio 2019 Releases Notes


如果正在从一个非英语的语言版本访问此页,并想要查看最新内容,请访问此“发行说明”页(英文版)。If you are accessing this page from a non-English language version, and want to see the most up-to-date content, please visit this Release Notes page in English. 可以更改此页面的语言,具体方法是单击页脚中的地球图标,然后选择所需语言。You can change the language of this page by clicking the globe icon in the page footer and selecting your desired language.

本文将介绍 Team Foundation Server 2018 的相关信息。In this article, you will find information regarding Team Foundation Server 2018. 单击此按钮下载。Click the button to download.

Download the latest version of Team Foundation Server

要详细了解 Team Foundation Server 2018,请参阅 Team Foundation Server 要求和兼容性页面。To learn more about Team Foundation Server 2018, see the Team Foundation Server Requirements and Compatibility page. 请访问 页面,下载其他 TFS 2018 产品。Visit the page to download other TFS 2018 products.

请参阅 TFS 安装页以获取详细信息。Please see the TFS Install page for more information.

Release Notes Icon 发布日期:2017 年 11 月 15 日Release Date: November 15, 2017

TFS 2018 中的最近更新汇总Summary of What's New in TFS 2018

我们已在 Team Foundation Server 2018 中新增了许多有价值的更新。We have added a lot of new value to Team Foundation Server 2018. 其中一些要点包括:Some of the highlights include:

“TFS 2018 中的新增功能”视频What's New in TFS 2018 video


我们最初将 XAML 生成列为已从 TFS 2018 RTW 和 Update 1 中删除。We had originally listed XAML build as removed from TFS 2018 RTW and Update 1. 但是,这导致过多客户无法升级或在升级已完成后必须与支持人员联系以重新启用它。However, that resulted in too many customers being unable to upgrade or having to contact support to re-enable it after the upgrade completed. 在 TFS 2018 Update 2 中,启用了 XAML 生成,但已不再提供支持。In TFS 2018 Update 2, XAML build is enabled but has been deprecated. 这表示不再对 XAML 生成进行进一步的投入,且 Microsoft 测试管理器 (MTM) 不再支持使用 XAML 生成。This means there is no further investment in XAML Build, and Microsoft Test Manager (MTM) no longer supports using XAML builds. 强烈建议转换为更新的生成定义格式。We highly recommend converting to one of the newer build definition formats. 可继续使用 TFS 2018 Update 2 连接 XAML 控制器和运行 XAML 生成。You may continue to connect your XAML controllers and run XAML builds with TFS 2018 Update 2. 详细信息More info

在 TFS 2018 RTW 中删除的功能Features Removed in TFS 2018 RTW

TFS 2018 中的最近更新详情Details of What's New in TFS 2018

工作项跟踪 Work Item Tracking

Web 上的项目创建向导 Project Creation Wizard on the web

我们改进了通过连接 Web 创建团队项目的体验。We have improved the experience for creating a Team Project from web access. 现在,可以在 Visual Studio 客户端中创建团队项目时使用大多数功能。It now includes most of the features available when you create a Team Project in the Visual Studio client. 使用 Web 界面的优势在于,无需使用匹配的 Visual Studio 版本。The benefit of using the web interface is that you do not need a matching Visual Studio version. 使用 Visual Studio 和 Web 版的区别在于,Web 版不在 SSRS 中预配报表。The difference of using Visual Studio or the web version is that the web version does not provision your reports in SSRS. 如果使用了 Web 版团队项目创建向导,可以对应用程序层运行 tfsconfig 命令,从而预配或更新 SSRS 报表。If you used the web version of the Team Project creation, you can run the tfsconfig command on the Application Tier to provision or update the SSRS reports.

Web 版过程模板管理器Process Template Manager on the web

使用 TFS 2018,可以通过连接 Web 上传过程模板。With TFS 2018, you can use web access to upload your process templates. Web 界面更易于使用,因为无需安装正确的 Visual Studio 版本,即可与过程模板进行交互。The web interface is a much easier experience because you do not have to install the correct version of Visual Studio to interact with your process templates. Visual Studio 2017 Update 4 及更低版本仍显示“过程模板管理器”对话框,尽管我们建议使用 Web 界面。Visual Studio 2017 Update 4 and earlier will still show the Process Template Manager dialog, although we recommend using the web interface. Visual Studio 2017 Update 5 及更高版本会自动重定向到 Web。Visual Studio 2017 Update 5 and later will redirect you to the web automatically.

自定义工作项表单标头 Customize the work item form header

现可通过替换现有控件或隐藏与进程无关的控件来自定义工作项窗体标头区域。You can now customize the work item form header area by replacing the existing controls, or hiding controls, that are not relevant to your process. 这可支持使用自定义团队字段替换区域路径、隐藏迭代(如果团队更专注于看板)以及使用自定义字段替换原因。This will enable replacing Area path with a custom Team field, hiding Iteration if your teams are more Kanban focused, and replacing Reason with a custom field. “状态”字段无法隐藏或替换。The State field cannot be hidden or replaced.


有关详细信息,请参阅 WebLayout 和控件元素文档See the documentation for WebLayout and Control elements for more information.

移动工作项表单 Mobile work item form

我们提供完整的端到端体验,包括已经过优化的工作项观感(图 1)。We have a full end-to-end experience that includes an optimized look and feel for work items (Figure 1). 这样就可以通过手机与分配到的、正在跟踪的、访问过的或最近编辑过的工作项轻松进行交互。It provides an easy way to interact with items that are assigned to you, are following, have visited, or edited recently from your phone.

Mobile work item query
(图 1)移动工作项查询(Figure 1) Mobile work item query

除了改进了外观之外,此体验还优化了所有字段类型的控件(图 2)。Along with the good looks, this experience supports optimized controls for all field types (Figure 2).

Mobile work item form
(图 2)移动工作项表单(Figure 2) Mobile work item form

通过全新的移动导航(图 3),用户可以到达其他任何支持移动导航的 TFS 部分,并在需要与其他中心进行交互时返回到完整桌面版站点。With the new mobile navigation (Figure 3), users can reach any other mobile-ready parts of TFS and get back to the full desktop site in case they need to interact with other hubs.

Mobile navigation
(图 3)移动导航(Figure 3) Mobile navigation

筛选积压工作 (backlog)、看板、冲刺 (sprint) 和查询Filtering on backlogs, Kanban boards, sprints, and queries

我们的所有工作项跟踪网格体验(查询、积压工作 (backlog)、看板、冲刺 (sprint) 积压工作 (backlog) 和测试用例管理)现在都利用常见的一致性筛选组件(图 4)。All of our work item tracking grid experiences (queries, backlogs, Kanban boards, sprints backlogs, and test case management) now make use of our common, consistent filtering component (Figure 4). 除了可以跨显示的列应用关键字筛选器和选择标记之外,还可以按工作项类型、状态和分配目标进行筛选,从而快速获取要找的工作项。Beyond applying a keyword filter across displayed columns and selecting tags, you can also filter on work item types, states, and assigned to, in order to quickly get to the work items you are looking for.

Filtering on query
(图 4)对查询的筛选(Figure 4) Filtering on queries

在看板卡上展开显示空字段Expand to show empty fields on a Kanban card

目前,可以根据需要向看板卡添加其他字段,并在看板设置中隐藏空字段(图 5),让看板保持整齐有序。Today, you have the option to add additional fields to a card and then hide empty fields (Figure 5) in board settings to remove unnecessary clutter from the board. 此功能的缺点是,一旦隐藏空字段,只能通过打开工作项表单来更新此字段。The drawback to this feature was that once an empty field was hidden, the only way to update the field was to open the work item form. 使用看板卡上新增的展开选项,现在不仅可以隐藏看板中的空字段,还可以一键式更新看板卡上的特定字段。With the newly available expand option on Kanban cards, you can now benefit from hiding empty fields across the board, but still have single click access to update a particular field on a card. 只需将鼠标悬停在看板卡上,并使用看板卡底部的倒 V 形图标,即可更新隐藏的字段。Simply hover over the card and look for the down chevron at the bottom of the card to update the hidden field.

Hidden field
(图 5)看板卡上的隐藏字段(Figure 5) Hidden field on Kanban card

单击看板卡底部的倒 V 形图标,即可更新隐藏的字段(图 6)。Click the down chevron at the bottom of the card to update the field (Figure 6).

Update hidden field
(图 6)更新看板卡上的隐藏字段(Figure 6) Update hidden field on Kanban card

阻止保存工作项的扩展Extensions block work item save

工作项表单自定义控件、组和页现在可以阻止保存工作项,以便验证数据,并确保用户在保存工作项表单之前填写所需的全部信息。Work item form custom controls, groups, and pages can now block work item save to validate data and ensure the user fills out any required information before saving the work item form.

内联添加交付计划Inline add on Delivery Plans

关于新功能的灵感随时可能迸发,因此我们简化了向“交付计划”直接添加新功能的流程(图 7)。New feature ideas can arrive at any moment, so we have made it easier to add new features directly to your Delivery Plans (Figure 7). 只需在光标悬停时单击出现的“新建项”,输入名称,然后按 Enter。Simply click the New item button available on hover, enter a name, and hit enter. 随即将使用预期的区域路径和迭代路径创建新功能。A new feature is created with the area path and iteration path you would expect.

Inline add on delivery plans
(图 7)内联添加交付计划(Figure 7) Inline add on delivery plans

版本控制 Version Control

分支 Forks

TFS 2018 现已开始支持 Git 分支(图 8)。TFS 2018 adds support for Git forks (Figure 8). 分叉是存储库的服务器端副本。A fork is a server-side copy of a repository. 使用分叉,可以让大量人员参与存储库,而无需向他们授予直接提交访问权限。Using forks, you can allow a broad range of people to contribute to your repository without giving them direct commit access. 相反,他们将工作提交到自己的存储库分支。Instead, they commit their work to their own fork of the repository. 这样一来,可以先在拉取请求中评审他们的更改,然后再接受将这些更改提交到中央存储库。This gives you the opportunity to review their changes in a pull request before accepting those changes into the central repository.

Git forks
(图 8)Git 分支(Figure 8) Git forks


现支持 Git 虚拟文件系统 (GVFS)。Git Virtual File System (GVFS) is now supported. 通过虚拟化和优化 Git 在该文件系统上的操作方式,GVFS 支持 Git 存储库扩大至数百万文件。GVFS allows Git repositories to scale to millions of files by virtualizing and optimizing how Git operates on the filesystem.

使用 Web 在存储库中创建文件夹Create a folder in a repository using web

现可通过 Web 在 Git 和 TFVC 存储库中创建文件夹(图 9)。You can now create folders through the web in your Git and TFVC repositories (Figure 9). 这会替换目前处于弃用过程的文件夹管理扩展This replaces the Folder Management extension, which will now undergo the process of deprecation.

若要创建文件夹,请在命令栏或上下文菜单中单击“新建”>“文件夹”:To create a folder, click New > Folder in either the command bar or context menu:

New folder option
(图 9)“新建文件夹”选项(Figure 9) New folder option

对于 TFVC,可指定文件夹名称,然后将其签入。For TFVC, you will specify a folder name and then check it in. 对于 Git,由于不允许空文件夹,因此也将需要指定文件名或者编辑文件,然后提交。For Git, because empty folders are not permitted, you will also have to specify a file name, optionally edit the file, then commit it.

此外,对于 Git,“新建文件”对话框(图 10)已改进为接受斜杠,以创建子文件夹。Additionally, for Git, The New file dialog (Figure 10) has been enhanced to accept slashes to create subfolders.

New file dialog
(图 10)“新建文件”对话框(Figure 10) New file dialog

文件 MinimapFile minimap

现在查看或编辑文件时可查看文件的 Minimap,快速概览代码(图 11)。You can now view a minimap of a file as you view or edit to give you a quick overview of the code (Figure 11). 若要启用 Minimap,打开“命令面板”(F1 或右键单击),然后选择“切换 Minimap” 。To turn on the minimap, open the Command Palette (F1 or right-click) and select Toggle Minimap.

File minimap
(图 11)文件 minimap(Figure 11) File minimap

括号匹配Bracket matching

现在编辑或查看文件时,左侧会有参考线,可与括号轻松匹配(图 12)。When editing or viewing a file, there are now guidelines on the left side to make it easy to match your brackets (Figure 12).

Bracket matching
(图 12)括号匹配(Figure 12) Bracket matching

切换空格Toggle white space

现在,查看或编辑文件时,可将空格切换为“开”或“关”。You can now toggle white space on and off when viewing or editing a file. 我们仍在开发让你能在比较时切换空格的功能。We are still developing a feature that will allow you to toggle white space when diff'ing. 若要查看空格(图 13),请打开“命令面板”(F1 或右键单击),然后选择“切换空格”,以便区分空格和制表符 。To view white space (Figure 13), open the Command Palette (F1 or right-click) and select Toggle White Space, which allows you to differentiate between spaces and tabs.

Toggle white space
(图 13)切换空格(Figure 13) Toggle white space

设置为对 TFVC 存储库禁用 Web 编辑Setting to turn off web editing for TFVC repos

使用 TFVC 的团队经常在 Visual Studio 中使用签入策略,以确保代码质量。Teams that use TFVC often use check-in policies in Visual Studio to ensure code quality. 不过,由于签入策略是在客户端上强制实施的,因该策略不对接受过 Web 编辑的代码造成任何影响。However, because check-in policies are enforced on the client, code that is edited on the web is not subjected to the same policies.

多个用户曾要求过,能否禁用 Web 编辑,以免受忽略签入策略的更改影响。Several people have asked for a way to disable web-editing to protect against changes that bypass check-in policies. 我们现已支持按项目/存储库对 TFVC 禁用 Web 编辑(即禁用添加、删除、重命名和编辑操作)。We have enabled a way for you to turn off web-editing (adding, deleting, renaming, and editing) for TFVC on a project/repository basis.

要在“文件”页面中禁用 Web 编辑,请依次转到“设置”和“版本控制”(图 14) 。To disallow web-editing from the Files page, go to Settings then Version Control (Figure 14). 单击树中的 TFVC 存储库,转到“选项”透视区域,并取消选中“为此 TFVC 存储库启用 Web 编辑”。Click on the TFVC repo in the tree, navigate to the Options pivot, and uncheck Enable web-editing for this TFVC repository. Web 编辑默认处于启用状态。By default, web-editing is enabled.


从“项目概述”页编辑 README 不受影响。Editing the README from the Project Overview page is unaffected.

Turn off web editing
(图 14)关闭 Web 编辑(Figure 14) Turn off web editing

如果在禁用了 Web 编辑的项目中尝试执行 Web 编辑,则会看到提示禁止进行 Web 编辑的通知(图 15)。If you attempt a web-edit in a project with web-editing disabled, you are notified that web-editing is not allowed (Figure 15).

Web editing not allowed dialog
(图 15)禁用 Web 编辑的对话框(Figure 15) Web editing not allowed dialog

识别过时分支Identify stale branches

通过删除不再需要的分支让存储库保持整齐有序,这样团队就能找到所关心的分支,并在合适的级别收藏分支。Keeping your repository clean by deleting branches you no longer need enables teams to find branches they care about and set favorites at the right granularity. 不过,如果存储库中有大量分支,便很难确定哪些是可以删除的非活动分支。However, if you have lots of branches in your repo, it can be hard to figure out which are inactive and can be deleted. 现可让轻松地识别“过时”分支(即指向 3 个月前的提交的分支)。We have now made it easier to identify "stale" branches (branches that point to commits older than 3 months). 若要查看过时分支,请转到“分支”页上的“过时”透视区域(图 16) 。To see your stale branches, go to the Stale pivot on the Branches page (Figure 16).

Stale branches
(图 16)过时分支(Figure 16) Stale branches

搜索已删除的分支并重新创建Search for a deleted branch and re-create it

如果从服务器中意外删除分支,便很难弄清楚此分支的具体情况。When you accidentally delete a branch from the server, it can be difficult to figure out what happened to it. 现在,可以搜索已删除的分支,并查看此分支的删除者和删除时间,还能根据需要重新创建此分支。Now you can search for a deleted branch, see who deleted it and when, and re-create it if you wish.

若要搜索已删除的分支,请在分支搜索框中输入完整的分支名称。To search for a deleted branch, enter the full branch name into the branch search box. 这将返回与搜索文本匹配的全部现有分支。It will return any existing branches that match that text. 还会看到一个选项,用于在已删除的分支列表中搜索完全匹配项。You will also see an option to search for an exact match in the list of deleted branches. 单击链接即可搜索已删除的分支(图 17)。Click the link to search deleted branches (Figure 17).

Search for deleted branches
(图 17)搜索已删除的分支(Figure 17) Search for deleted branches

如果找到了匹配项,将会看到此分支的删除者和删除时间。If a match is found, you will see who deleted it and when. 还可以还原此分支(图 18)。You can also restore the branch (Figure 18).

Restore deleted branches
(图 18)还原已删除的分支(Figure 18) Restore deleted branches

如果还原此分支,将在它最后指向的提交中重新创建它。Restoring the branch will re-create it at the commit to which is last pointed. 不过,将不会还原策略和权限。However, it will not restore policies and permissions.

在开头有前缀的分支中搜索提交Search for a commit in branches starting with a prefix

如果分支结构采用分层格式,其中所有分支都以文本为前缀,可以使用此功能,在开头有此前缀文本的全部分支中查找提交。If you have branch structure in a hierarchical format where all branches are prefixed with a text, then this feature will help you to find a commit in all the branches starting with that prefix text. 例如,要确定提交是否已被引入所有以“dev”为前缀的分支,只需在搜索框中键入“dev”,再选择“在以‘dev’开头的分支中搜索”即可(图 19)。For example, if you want to see whether a commit made its way to all branches that are prefixed with "dev" then simply type "dev" in the search box and select Search in branches starting with "dev" (Figure 19).

Search for a commit
(图 19)搜索提交(Figure 19) Search for a commit

提交详细信息页上的拉取请求标注更丰富Richer pull request callout on commit details page

提交详细信息页上的拉取请求标注会显示更多相关信息,有助于更好地进行诊断(图 20)。The pull request callout on the commit details page shows more relevant information to better diagnose (Figure 20). 现在,我们还在标注中显示将提交引入任何分支的首个拉取请求,以及与默认分支相关的拉取请求。Now we also show the first pull request that introduced the commit to any branch and the pull request associated with the default branch in the callout.

Pull request callout
(图 20)拉取请求标注(Figure 20) Pull request callout

在“代码”中筛选树状视图Filter tree view in Code

现在,无需滚动浏览提交可能已修改的所有文件,即可找到自己的文件。Now you do not need to scroll through all the files that a commit may have modified to just get to your files. 提交详细信息页、拉取请求页、搁置集详细信息页和变更集详细信息页上的树状视图现在支持筛选文件和文件夹。The tree view on commit details, pull requests, shelveset details, and changeset details page now supports file and folder filtering. 此为智能筛选器,可以在用户按文件夹名称筛选时显示文件夹的子文件,并能在用户按文件名筛选时显示文件的折叠式树状视图,以呈现文件层次结构。This is a smart filter that shows child files of a folder when you filter by folder name and shows a collapsed tree view of a file to display the file hierarchy when you filter by file name.

在提交树上找到文件或文件夹筛选器(图 21)和(图 22) :Find a file or folder filter on commit tree (Figure 21) and (Figure 22):

Find a file or folder
(图 21)查找文件或文件夹(Figure 21) Find a file or folder
Filtered view
(图 22)提交树的筛选视图(Figure 22) Filtered view on commit tree

“分支更新”页现为“推送”Branch updates page is now Pushes

“分支更新”页具有巨大价值。The Branch Updates page has tremendous value. 不过,它已隐藏为“历史记录”中心下的透视区域。However, it was hidden as a pivot under the History hub. “分支更新”页面现在称为“推送”中心(图 23),它位于“代码”下方,就在“提交”、“分支”、“标记”和“拉取请求”的旁边 。Now the branch updates page are visible as a hub called Pushes (Figure 23) under Code, alongside Commits, Branches, Tags, and Pull Requests. 推送页的新 URL 为:\<tfsserverurl\>/\<projectname\>/_git/\<reponame\>/pushesThe new URL for the pushes page is: \<tfsserverurl\>/\<projectname\>/_git/\<reponame\>/pushes. 旧 URL 仍能正常发挥作用。The old URLs will continue to function.

Pushes page
(图 23)推送页(Figure 23) Pushes page

同时,“历史记录”中心现重命名为“提交”(图 24),因为此中心仅显示提交 。At the same time, the History hub is now renamed to Commits (Figure 24) since the hub only shows commits. 用户向我们反馈过,很难排查与提交相关的问题,因为提交列表视图仅在有鼠标悬停时才显示详细时间。We received feedback that people were finding it difficult to troubleshoot commit related issues because the commit list view only showed detailed time on-hover. 现在,跨实例的提交列表视图以 dd/mm/yy hh:mm 格式显示日期和时间。Now the commit list view across your instance will show date and time in dd/mm/yy hh:mm format. 提交页的新 URL 为:\<tfsserverurl\>/\<projectname\>/_git/\<reponame\>/commitsThe new URL for commits page is: \<tfsserverurl\>/\<projectname\>/_git/\<reponame\>/commits. 旧 URL 仍能正常发挥作用。The old URLs will continue to function.

Commits page
(图 24)提交页(Figure 24) Commits page

从“文件”切换到“提交”时保留文件名Retain filename when moving from Files to Commits

用户向我们反馈过,如果在目录中筛选出“代码”中心的“文件”透视区域中的特定文件,稍后又翻转到“历史记录”透视区域,则当提交更改的文件数超过 1,000 个时,文件名将丢失 。We heard feedback from people that when they filter the directory to a particular file in the Files pivot of the Code hub and later flip to the History pivot, the filename does not persist if the commit changed more than 1,000 files. 这样一来,用户需要加载更多文件并筛选内容才能找到文件,影响了工作效率。This resulted in people needing to load more files and filter content to find the file, which impacted productivity. 开发者通常在同一目录中进行工作,并且希望在跟踪更改时一直留在他们工作的目录中。Developers normally work in the same directory and want to persist to the directories they work in as they trace changes. 现在,可以在“代码”中心透视区域之间切换时保留文件名,无论提交更改了多少个文件。Now, we persist the filename as you move between Code hub pivots regardless of the number of files changed in a commit. 也就是说,无需单击“加载更多”,即可找到所需的文件。This means that you do not have to click on Load More to find the file you want.

查看 Git 标记 View Git tags

可以在“标记”页上查看存储库中的所有标记(图 25)。You can view all the tags in your repository on the Tags page (Figure 25). 如果将所有标记作为发布进行管理,则用户可访问“标记”页来简要了解所有产品发布。If you manage all your tags as releases, then a user can visit the tags page to get a bird's-eye view of all the product releases.

View Git tags
(图 25)查看 Git 标记(Figure 25) View Git tags

可以轻松区分轻量级标记和已加批注的标记。You can easily differentiate between a lightweight and an annotated tag. 已加批注的标记在相关提交旁边显示标记器和创建日期,而轻量级标记仅显示提交信息。Annotated tags show the tagger and the creation date alongside the associated commit, while lightweight tags only show the commit information.

删除 Git 标记Delete Git tags

有时,可能需要从远程存储库中删除标记。There can be times when you want to delete a tag from your remote repo. 可能是因为标记名称中有拼写错误,或标记了错误的提交。It could be due to a typo in the tag name, or you might have tagged the wrong commit. 可以在“标记”页面上单击标记的上下文菜单,并选择“删除标记”(图 26),即可轻松地从 Web UI 中删除标记 。You can easily delete tags from the web UI by clicking the context menu of a tag on the Tags page and selecting Delete tag (Figure 26).


应谨慎地删除远程存储库中的标记。Deleting tags on remote repos should be exercised with caution.

Delete git tags
(图 26)删除 Git 标记(Figure 26) Delete Git tags

筛选 Git 标记Filtering Git tags

对于旧存储库,标记数量可能会随着时间的推移而大幅增多;存储库中创建的标记可能还会采用层次结构,令标记查找起来更加困难。For old repositories, the number of tags can grow significantly with time; there can also be repositories that have tags created in hierarchies, which can make finding tags difficult.

如果无法在“标记”页上找到要找的标记,可以使用“标记”页顶部的筛选器,直接搜索标记名称(图 27) 。If you are unable to find the tag that you were looking for on the Tags page, then you can simply search for the tag name using the filter on top of the Tags page (Figure 27).

Filter Git tags
(图 27)筛选 Git 标记(Figure 27) Filter Git tags

Git 标记安全性Git tags security

现在,可以向存储库用户授予精细权限,方便其管理标记。Now you can grant granular permissions to users of the repo to manage tags. 可以向用户授予权限,允许他们从此界面删除或管理标记(图 28)。You can give users the permission to delete tags or manage tags from this interface (Figure 28).

Git tag security
(图 28)Git 标记安全性(Figure 28) Git tag security


有关 Git 标记的详细信息,请阅读 Microsoft DevOps 博客Read more about Git tags at the Microsoft DevOps blog.

完成拉取请求时自动完成工作项 Automatically complete work items when completing pull requests

若将工作项与拉取请求相关联,就可更加轻松地更新所有内容。If you are linking work items to your pull requests, keeping everything up to date just got simpler. 现在,完成拉取请求时,可以选择在拉取请求合并成功后自动完成关联的工作项(图 29)。Now, when you complete a PR, you will have the option to automatically complete the linked work items after the PR has been merged successfully (Figure 29). 若使用策略并将拉取请求设置为自动完成,可看到相同的选项。If you are using policies and set pull requests to auto-complete, you will see the same option. 完成拉取请求后,不用再重新访问工作项来更新状态。No more remembering to revisit work items to update the state once the pull request has completed. 系统会自动完成。This is done for you automatically.

Complete linked work items
(图 29)完成链接的工作项(Figure 29) Complete linked work items

在推送/新迭代发生时重置投票Reset votes on push/new iteration

如果团队决定在 PR 中采用更严格的审批工作流,现在可以在新更改进行推送时重置投票(图 30)。Teams opting for a more strict approval workflow in PRs can now opt-in to reset votes when new changes are pushed (Figure 30). 新设置为“至少需要的审阅者人数”策略下的一个选项。The new setting is an option under the policy to Require a minimum number of reviewers.

Reset votes setting
(图 30)重置投票设置(Figure 30) Reset votes setting

设置此选项后,每当 PR 的源分支更新时,所有审阅者的全部投票都会进行重置。When set, this option will cause all votes from all reviewers to be reset any time the source branch of the PR is updated. 只要投票因此选项而重置,PR 时间线都会记录一个条目(图 31)。The PR timeline will record an entry any time the votes are reset as a result of this option (Figure 31).

Reset votes in timeline
(图 31)重置时间线中的投票(Figure 31) Reset votes in timeline

按文件名筛选拉取请求树Filter pull request tree by file name

在拉取请求中查找特定文件变得空前简单。Finding a specific file in a pull request is easier than ever. 使用“文件”视图中的新筛选器框,用户可以筛选树状视图中的文件列表(图 32)。The new filter box in the Files view lets users filter down the list of files in the tree view (Figure 32).

Find file or folder in pull request
(图 32)查找拉取请求中的文件或文件夹(Figure 32) Find file or folder in pull request

筛选器会匹配拉取请求中文件的任意路径部分,因此可以按文件夹名称、部分路径、文件名或扩展进行搜索(图 33)。The filter matches any part of the path of the files in the pull request, so you can search by folder names, partial paths, file names, or extensions (Figure 33).

Find results
(图 33)查找结果(Figure 33) Find results

更多拉取请求注释筛选选项More pull request comments filtering options

在拉取请求概述和“文件”视图中,现在可以使用相同的注释选项(图 34)。Comments in both the pull request overview and the files view now have the same options (Figure 34). 还可以进行筛选,仅查看自己参与的讨论。You can also filter to see only the discussions you participated in.

PR comment filtering
(图 34)PR 注释筛选(Figure 34) PR comment filtering

在拉取请求详细信息中查看已添加注释的代码与原始版本的差异View original diff for code comments in pull request details

有时,在拉取请求注释引用的代码发生更改后(很多时候是在做出了请求的更改时),就很难理解拉取请求注释了(图 35)。Sometimes, it is hard to make sense out of a PR comment after the code it is referencing has changed (many times, when a requested change has been made) (Figure 35).

View original diff
(图 35)查看原始差异(Figure 35) View original diff

现在如果出现这种情况,可看到一个包含更新编号的徽章,单击该徽章即可查看最初创建注释时的代码(图 36)。When this happens, you will now see a badge with an update number that you can click to see what the code looked like at the time the comment was originally created (Figure 36).

Update badge
(图 36)更新徽章(Figure 36) Update badge

可折叠的拉取请求注释Collapsible pull request comments

代码评审是拉取请求体验的关键所在,因此我们添加了新功能,以便审阅者可以将重心放在代码上。Reviewing code is a critical part of the pull request experience, so we have added new features to make it easier for reviewers to focus on the code. 代码审阅者可以轻松地隐藏注释,以便能够在首次评审新代码时腾出空间(图 37)。Code reviewers can easily hide comments to get them out of the way when reviewing new code for the first time (Figure 37).

Hide comments
(图 37)隐藏注释(Figure 37) Hide comments

隐藏注释(图 38)可以对树状视图隐藏注释,并在文件视图中折叠注释线程:Hiding comments (Figure 38) hides them from the tree view and collapses the comment threads in the file view:

Collapsed comments
(图 38)折叠的注释(Figure 38) Collapsed comments

折叠注释后,单击边距中的图标即可轻松展开注释,再单击一下又可以再次折叠。When comments are collapsed, they can be expanded easily by clicking the icon in the margin, and then collapsed again with another click. 借助工具提示(图 39),可以轻松快速地概览注释,而无需查看整个线程。Tooltips (Figure 39) make it easy to peek at a comment without seeing the entire thread.

Collapsed comment tooltip
(图 39)折叠的注释工具提示(Figure 39) Collapsed comment tooltip

拉取请求说明和注释中的任务列表Task lists in pull request descriptions and comments

准备 PR 或进行注释时,有时会有一些要跟踪的事项,但最终会编辑文本或添加多个注释。When preparing a PR or commenting you sometimes have a short list of things that you want to track but then end up editing the text or adding multiple comments. 使用轻量级任务列表,可以在说明或合并后的一个注释中,作为 PR 创建者或审阅者跟踪待办事项列表的完成进度。Lightweight task lists are a great way to track progress on a list of to-dos as either a PR creator or reviewer in the description or a single, consolidated comment. 单击 Markdown 工具栏,即可开始使用或将格式应用于选定文本(图 40)。Click on the Markdown toolbar to get started or apply the format to selected text (Figure 40).

Task list toolbar
(图 40)任务列表工具栏(Figure 40) Task list toolbar

添加任务列表(图 41)后,只需选中框,即可将项标记为完成。Once you have added a task list (Figure 41), you can simply check the boxes to mark items as completed. 这些项在 Markdown 注释中表示和存储为 [ ][x]These are expressed and stored within the comment as [ ] and [x] in Markdown. 有关详细信息,请参阅 Markdown 指南See Markdown guidance for more information.

Task list
(图 41)任务列表(Figure 41) Task list

可以为拉取请求中的注释点“赞”Ability to "Like" comments in pull requests

单击一下“赞”按钮,即表示支持 PR 注释(图 42)。Show your support for a PR comment with a single click on the like button (Figure 42). 可以将鼠标悬停在此按钮之上,查看已点赞注释的其他所有点赞人员列表。You can see the list of all people that liked the comment by hovering over the button.

Like pull request comments
(图 42)点赞拉取请求注释(Figure 42) Like pull request comments

改进了批准并附加建议时的工作流Improved workflow when approving with suggestions

结合使用“自动完成”选项(图 43)与拉取请求可有效提升工作效率,而又不打断与代码审阅者的积极讨论。Using the auto-complete option (Figure 43) with pull requests is a great way to improve your productivity, but it should not cut short any active discussions with code reviewers. 为了更好地促进这些讨论,现在会在拉取请求设置为自动完成时,提示“批准并附加建议”投票。To better facilitate those discussions, the Approve with suggestions vote will now prompt when a pull request is set to complete automatically. 用户可以根据需要取消自动完成,这样他们的反馈意见就可以被聆听;也可以保持自动完成设置不变,但要求在符合所有策略要求的情况下才自动完成拉取请求。The user will have the option to cancel the auto-complete so that their feedback can be read, or keep the auto-complete set and allow the pull request to be completed automatically when all policies are fulfilled.

Cancel auto-complete dialog
(图 43)取消自动补全对话框(Figure 43) Cancel auto-complete dialog

Git 通知支持路径筛选Path filtering support for Git notifications

现在可以选择收到通知的条件,即仅当团队成员在关心的文件夹中创建拉取请求或推送代码时,而不会收到存储库中所有文件夹的通知。Instead of getting notifications for all folders in a repo, you can now choose to get notified when team members create pull requests or push code in only the folders that you care about. 创建自定义 Git 推送或拉取请求的电子邮件通知订阅时,可以使用新选项,按文件夹路径筛选这些通知(图 44)。When creating custom Git push or Git pull requests email notification subscriptions, you will see a new option to filter these notifications by folder path (Figure 44).

Path filtering for notifications
(图 44)通知的路径筛选(Figure 44) Path filtering for notifications

更新了拉取请求工作流的电子邮件模板Updated email templates for pull request workflows

拉取请求电子邮件警报已刷新,不仅清晰简洁,还可操作(图 45)。Pull request email alerts have been refreshed to make them clear, concise, and actionable (Figure 45). 主题行的开头是拉取请求标题和次要信息(如存储库名称),而 ID 移到了末尾。The subject line now begins with the PR title and secondary information, like the repo name, and ID is deferred to the end. 创建者的姓名已添加到主题中,以便可以更轻松地应用规则,并按 PR 创建者进行筛选。The name of the author has been added to the subject to make it simpler to apply rules and filters based on the person that created the PR.

警报电子邮件正文模板刷新为,先总结警报发送原因,后跟关键的元数据(标题、分支名称和说明)以及主要的号召性用语按钮。The body of the alert emails has a refreshed template that first summarizes why the alert was sent, followed by the critical metadata (title, branch names, and description), and a main call-to-action button. 再往下,电子邮件包含审阅者、文件和提交等更多详细信息。Additional details like the reviewers, files, and commits are included further down the email.

Improved email template
(图 45)改进的电子邮件模板(Figure 45) Improved email template

对于大多数警报,单击号召性用语按钮(图 46)可以在 Web 中查看拉取请求。For most alerts, the call-to-action (Figure 46) is to view the pull request in the web. 不过,收到有关特定注释的通知时,单击号召性用语按钮会直接链接到相应注释,让你能够轻松找到代码和先前对话,了解上下文相关信息。However, when you are notified about a specific comment, the call-to-action will link directly to that comment so you can easily find the code and prior conversation for context.

Email call-to-action
(图 46)电子邮件号召性用语(Figure 46) Email call-to-action

已更新用于推送通知的电子邮件模板Updated email templates for push notifications

推送通知已更新,以匹配经优化而变得清晰、简洁和可操作的新电子邮件模板(图 47)。Push notifications have been updated to match the new email templates that are optimized to be clear, concise, and actionable (Figure 47). 主题行有助于清晰区分推送电子邮件,标识分支、存储库和创建者以及汇总推送中包含的提交数。The subject line helps you clearly distinguish push emails, identify the branch, repo, and author, and summarize the number of commits included in the push. 这些更改还使创建规则和筛选器更加简单,从而有助于管理这些电子邮件通知。These changes also make it easier to create rules and filters to help manage these email notifications.

电子邮件正文与其他电子邮件一致,强调发送电子邮件的原因、操作发起人员以及具体内容。The email body is consistent with other emails, emphasizing why the email was sent, who initiated the action, and exactly what happened. 特定于推送警报,包含所有关于存储库、分支、文件和提交的详细信息,以帮助通知收件人更改范围。Specific to push alerts, the details about the repo, branch, files, and commits are all included to help inform the recipients about the scope of the changes. 对推送警报操作的主调用为“查看推送”,这将打开生成警报的特定推送的推送视图。The main call-to-action for push alerts is View Push, which will open the pushes view for the specific push that generated the alert.

Push template
(图 47)推送模板(Figure 47) Push template

Wiki Wiki

每个项目现在都支持自己的 Wiki(图 48)。Each project now supports its own Wiki (Figure 48). 现在,可以方便地编写 Wiki 页,帮助团队成员了解、使用和参与项目。Now you can conveniently write pages that help your team members understand, use, and contribute to your project.

Wiki page
(图 48)PR Wiki 页(Figure 48) PR Wiki page

新 Wiki 的一些主要功能包括:Some of the key features of the new Wiki include:

  • 简化了使用 Markdown 语法进行编辑的体验。Simplified editing experience using markdown syntax.
  • 使用新页,可以指定标题,并添加内容。The new page allows you to specify a title and add content. (图 49)(Figure 49)
Title Wiki
(图 49)PR 标题 Wiki(Figure 49) PR Title Wiki
  • 支持在 Markdown 中使用 HTML 标记(图 50)。Support for HTML tags in markdown (Figure 50).
Wiki HTML tags
(图 50)PR Wiki HTML 标记(Figure 50) PR Wiki HTML tags
  • 方便地重设 Markdown 文件夹中图像的大小(图 51)。Conveniently resize images in the markdown folder (Figure 51).
Image resize
(图 51)调整 PR 图像的大小(Figure 51) PR Image resize
  • 功能强大的页管理窗格,支持对页进行重新排序、重新设置父级和管理。Powerful page management pane that allows you to reorder, re-parent, and manage pages.
  • 对于大型 Wiki,可以按标题筛选页(图 52)。Ability to filter pages by title for large Wikis (Figure 52).
Wiki menu
(图 52)PR Wiki 菜单(Figure 52) PR Wiki menu


详细了解 Wiki 入门Learn more about getting started with Wiki.

使用 Wiki 的次数越多,保存意外更改的可能性就越大。As you use Wiki more, there is a chance you will save unintended changes. 现在,可以还原 Wiki 页修订,具体方法是转到修订详细信息,并单击“还原”按钮(图 53)。Now you can revert a revision to a Wiki page by going to the revision details and clicking on the Revert button (Figure 53).

Wiki revert button
(图 53)PR Wiki 还原按钮(Figure 53) PR Wiki revert button

我们在创建 Wiki 时观察到一种模式:Wiki 页上的表格内容中包含不存在的链接(图 54)。We observed a pattern during Wiki creation where a table of contents on a Wiki page included non-existent links (Figure 54). 用户可能会单击这些链接,尝试创建一个实际页。Users would click on these links in an attempt to create an actual page. 我们以前处理这种情况的方法是发出警告,提示链接断开或页不存在。We previously handled this scenario by giving a warning suggesting that the link was broken, or that the page did not exist. 现在,我们改为支持创建页,将这种情况作为 Wiki 的主要方案进行处理。Now, we are handling this as a mainstream scenario for Wiki, by allowing you to create pages instead.

Create wiki page
(图 54)PR 创建 Wiki 页(Figure 54) PR Create Wiki page

Wiki 页面深层链接Wiki page deep linking

Wiki 现支持页内和跨页深层链接部分,这对创建目录非常有用。Wiki now supports deep linking sections within a page and across pages, which is extremely useful for creating a table of contents. 可使用以下语法引用同一页面或不同页面的标题:You can reference a heading in the same page or another page by using the following syntax:

  • 同一页面:[text to display](#section-name)Same page: [text to display](#section-name)
  • 不同页面:[text to display](/page-name#section-name)Another page: [text to display](/page-name#section-name)

市场上的 Wiki 扩展现已弃用。The Wiki extension on the Marketplace is now deprecated. 如果是现有 Wiki 扩展用户,可以使用此迁移工具,将 Wiki 页迁移到新 Wiki。If you are an existing Wiki extension user, then you can migrate your Wiki pages to the new Wiki using this migration tool. 详细了解如何将现有 Wiki 页迁移到新 WikiLearn more about how to migrate your existing Wiki pages to the new Wiki.

包管理 Package Management

包管理体验更新Package Management experience updates

包 URL 现在支持使用包名称和版本,而不使用 GUID。Package URLs now work with the package name and version, rather than using GUIDs. 这样,可以更轻松地手动创建包 URL(图 55)。This makes it easier to hand-craft package URLs (Figure 55). 格式为:\<tfsserverurl\>/\<project|team\>/_packaging?feed=\<feed\>&package=\<package\>&version=\<version\>&protocolType=\<NuGet|Npm|Maven\>&_a=packageThe format is: \<tfsserverurl\>/\<project|team\>/_packaging?feed=\<feed\>&package=\<package\>&version=\<version\>&protocolType=\<NuGet|Npm|Maven\>&_a=package.

Package URL
(图 55)PR 包 URL(Figure 55) PR Package URL

现在可以对所有源用户隐藏已删除的包版本(图 56)(不用再为包添加删除线!)。You can now hide deleted package versions (Figure 56) from all feed users (no more strikethrough packages!).

Hide deleted packages
(图 56)隐藏已删除的包(Figure 56) Hide deleted packages

在包详细信息页上执行的任何操作,现在都可以通过包列表的上下文菜单执行。Any action that you could perform on the package details page can now be performed from the context menu in the list of packages.

包列表新增了“上次推送时间”列(图 57),内含人性化日期,以便用户可以轻松找到最近更新的包。The package list contains a new Last pushed column (Figure 57) with humanized dates so you can easily find recently-updated packages.

Last pushed column
(图 57)上一个推送的列(Figure 57) Last pushed column

Maven 包 Maven packages

我们现已开始支持在 TFS 2018 中托管 Maven 项目(图 58)。We have launched support for hosting Maven artifacts in TFS 2018 (Figure 58). 使用 Maven 项目,Java 开发者可无缝共享代码和组件。Maven artifacts enable Java developers to share code and components seamlessly. 请查看我们的入门指南,了解如何使用包管理源共享 Maven 项目。Check out our getting started guide for how to share Maven artifacts using Package Management.

Maven packages
(图 58)Maven 包(Figure 58) Maven packages

新增统一的 NuGet 任务New unified NuGet task

我们已将“NuGet 还原”、“NuGet 包装程序”和“NuGet 发布服务器”任务合并到统一的 NuGet 生成任务中,以便与生成任务库的其余部分更好地保持一致;新任务默认使用 NuGet 4.0.0。We have combined the NuGet Restore, NuGet Packager, and NuGet Publisher task into a unified NuGet build task to align better with the rest of the build task library; the new task uses NuGet 4.0.0 by default. 因此,我们弃用了旧任务,并建议用户在方便时迁移到新增的 NuGet 任务。Accordingly, we have deprecated the old tasks, and we recommend moving to the new NuGet task as you have time. 此更改与下面所述的一系列改进保持一致,只有在使用合并的任务时,这些改进才生效。This change coincides with a wave of improvements outlined below that you will only be able to access by using the combined task.

在改进期间,我们还发布了新任务“NuGet 工具安装程序”,它用于控制 PATH 上可用的以及 NuGet 新任务所使用的 NuGet 版本。As part of this work, we have also released a new NuGet Tool Installer task that controls the version of NuGet available on the PATH and used by the new NuGet task. 因此,若要使用最新版 NuGet,只需在生成开始时添加“NuGet 工具安装程序”任务即可(图 59)。So, to use a newer version of NuGet, just add a NuGet Tool Installer task at the beginning of your build (Figure 59).

Nuget task
(图 59)NuGet 任务(Figure 59) NuGet task

NuGet“允许跳过重复项”选项NuGet "Allow duplicates to be skipped" option

许多 NuGet 客户向我们反馈过,生成的一组包中只有一些可能有更新(即更新后的版本号)。We heard from many NuGet customers that they generate a set of packages, only some of which may have updates (and therefore updated version numbers). NuGet 生成任务新增了“允许跳过重复项”选项,在任务尝试将包推送到已在使用此版本的 VSTS/TFS 源时,此选项让任务能够继续执行 。The NuGet build task has a new Allow duplicates to be skipped option that enables the task to continue if it tries to push packages to a VSTS/TFS feed where the version is already in use.

npm 生成任务更新npm build task updates

无论是在 Windows、Linux 还是在 Mac 上生成 npm 项目,都可以无缝使用新增的 NPM 生成任务。Whether you are building your npm project on Windows, Linux, or Mac, the new NPM build task works seamlessly. 我们还调整了此任务,以便用户可以更轻松地运行 npm install 和 npm publish。We have also reorganized the task to make both npm install and npm publish easier. 对于 install 和 publish,我们简化了凭据获取操作,这样项目的 .npmrc 文件中列出的注册表凭据就可以安全地存储在服务终结点中 。For install and publish, we have simplified credential acquisition so that credentials for registries listed in your project's .npmrc file are safely stored in a service endpoint. 或者,如果使用的是 VSTS/TFS 源,则可通过选取器可以选择一个源,然后生成具备生成代理所用必要凭据的 .npmrcAlternatively, if you are using a VSTS/TFS feed, we have a picker that allows you select a feed, and then generates a .npmrc with requisite credentials that are used by the build agent.

Maven 现在支持已验证的源Maven now supports authenticated feeds

与 NuGet 和 npm 不同,Maven 生成任务以前无法与已验证的源配合使用。Unlike NuGet and npm, the Maven build task did not previously work with authenticated feeds. 我们已更新 Maven 任务,让用户能够轻松使用 VSTS/TFS 源(图 60)。We have updated the Maven task so you can work easily with VSTS/TFS feeds (Figure 60).

dotnet task
(图 60)dotnet 任务(Figure 60) dotnet task

.Net 任务支持已验证的源(Web 项目)dotnet task supports authenticated feeds, web projects

.Net 任务的下一个主版本 (2.x) 实现了许多反馈请求,并修复了我们一直在跟踪的一组 bug。The next major version of the dotnet task (2.x) addresses many of your feedback requests and fixes a set of bugs we have tracked for a while. 这包括:This includes the following:

  1. 首先,.Net 现支持已验证的包源(如包管理),因此无需再使用 NuGet 任务即可从私有包源还原包。First, dotnet now supports authenticated package sources like Package Management, so you do not need to use the NuGet task anymore to restore packages from private package sources.
  2. “项目路径”字段的行为已在 2.0 版任务中发生变化。The behavior of Path to project(s) field has changed in the 2.0 version of the task. 在旧版任务中,如果找不到与指定模式匹配的项目文件,任务常常会记录警告,然后成功完成。In previous versions of the task, if the project file(s) matching the specified pattern were not found, the task used to log a warning and then succeed. 在这种情况下,有时可能会很难理解,为什么生成已成功,但依赖项并未还原。In such scenarios it can sometimes be challenging to understand why the build succeeded but dependencies were not restored. 现在,如果找不到与指定模式匹配的项目文件,任务会失败。Now the task fails if the project file(s) matching the specified pattern are not found. 这不仅与其他任务的行为保持一致,而且还易于理解和使用。This is in line with the behavior of other tasks and is easy to understand and use.
  3. 在旧版任务的 publish 命令中,任务将所有文件放入以项目文件名命名的文件夹中,从而修改输出路径,即使传递的是明确的输出路径,也不例外。In previous versions of the task's publish command, the task modified the output path by putting all the files in a folder that was named after the project file name, even when you passed an explicit output path. 这样,很难将命令链接在一起。This makes it hard to chain commands together. 现在可以控制输出路径文件。Now you have control over the output path file.

我们还发布了新任务“.Net 工具安装程序”,它用于控制 PATH 上可用的以及 dotnet 新任务所使用的 dotnet 版本。We have also released a new dotnet Tool Installer task that controls the version of dotnet available on the PATH and used by the new dotnet task. 因此,若要使用最新版 .Net,只需在生成开始时添加“.Net 工具安装程序”任务即可。So, to use a newer version of dotnet, just add a dotnet Tool Installer task at the beginning of your build.

在帐户/集合之外工作Working outside your account/collection

现在可以更轻松地在 TFS 服务器或 VSTS 帐户之外使用源(图 61),无论是其他 VSTS 帐户或 TFS 服务器中的包管理源,还是非包管理源(如、Artifactory 或 MyGet)(图 60)。It is now easier to work with feeds (Figure 61) outside your TFS server or VSTS account, whether they are Package Management feeds in another VSTS account or TFS server or non-Package Management feeds like, Artifactory, or MyGet (Figure 60). 借助 NuGet 和 npm 的专用服务终结点类型,可以轻松地输入正确的凭据,并能跨包下载和包推送操作无缝使用生成任务。Dedicated Service Endpoint types for NuGet and npm make it easy to enter the correct credentials and enable the build tasks to work seamlessly across package download and package push operations.

Feeds to use
(图 61)要使用的源(Figure 61) Feed to use

VSTS/TFS 源选取器Feed picker for VSTS/TFS feeds

我们一直建议签入配置文件(例如,NuGet.Config、.npmrc 等),以便源存储库可以记录包的源位置。We always recommend checking in a configuration file (e.g. NuGet.Config, .npmrc, etc.) so that your source repository has a record of where your packages came from. 不过,我们也收到一些反馈意见,了解到这样做并不理想的一系列情形。因此,我们新增了“使用此 VSTS/TFS 源中的包”选项,以便用户能够选择源,并自动生成用于相应生成步骤的配置文件(图 62)。However, we have heard a set of scenarios where this isn't ideal, so we have added a new Use packages from this VSTS/TFS feed option that allows you to select a feed and automatically generate a configuration file that is used for that build step (Figure 62).

Feed picker
(图 62)源选取器(Figure 62) Feed picker

生成和发布 Build and Release

XAML 生成 XAML Builds

在 TFS 2015 中,我们引入了基于 Web 的跨平台生成系统。In TFS 2015, we introduced a web-based, cross-platform build system. TFS 2018 RTW 或 Update 1 中不支持 XAML 生成,但已在 TFS 2018 Update 2 中重新启用 XAML 生成。XAML builds are not supported in TFS 2018 RTW or Update 1, but we have re-enabled XAML builds in TFS 2018 Update 2. 建议迁移 XAML 生成We encourage you to migrate your XAML builds. 如果尚未准备好进行迁移并需要继续使用 XAML 生成,请升级到 TFS 2018 Update 2。If you are not ready to migrate and need to continue using XAML builds, please upgrade to TFS 2018 Update 2.

升级到 TFS 2018 RTW 或 Update 1 后:When you upgrade to TFS 2018 RTW or Update 1:

  • 如果团队项目集合中有任何 XAML 生成数据,则会收到有关删除 XAML 生成功能的警告。If you have any XAML build data in your team project collection, you will get a warning about the removal of XAML build features.

  • 可以查看已完成的 XAML 生成,但无法将新生成排入队列。You can view completed XAML builds, but you will not be able to queue new ones.

  • TFS 2018 中没有新版本的 XAML 生成控制器或代理。There's no new version of the XAML build controller or agent in TFS 2018.

升级到 TFS 2018 Update 2 后:When you upgrade to TFS 2018 Update 2:

  • 如果团队项目集合中有任何 XAML 生成数据,则会收到有关弃用 XAML 生成功能的警告。If you have any XAML build data in your team project collection, you will receive a warning about the deprecation of XAML build features.

  • 需要使用 Visual Studio 或团队资源管理器 2017 编辑 XAML 生成定义或将新的 XAML 生成排入队列。You need to use Visual Studio or Team Explorer 2017 to edit XAML build definitions or to queue new XAML builds.

  • 如需创建新的 XAML 生成代理,需要使用 TFS 2015 生成代理安装程序安装它们。If you need to create new XAML build agents, you need to install them using the TFS 2015 build agent installer.


有关我们的 XAML 生成弃用计划的说明,请参阅博客文章 Evolving TFS/Team Services build automation capabilities(不断发展的 TFS/Team Services 生成自动化功能)。For an explanation of our XAML build deprecation plan, see the Evolving TFS/Team Services build automation capabilities blog post.

导出和导入生成定义 Export and import build definitions

生成定义在内部实现为 .json 文件,因此你可在文件历史记录中查看更改详细信息。Build definitions are implemented internally as .json files, so you can see details on changes in the file's history. 虽然已可以克隆生成定义并据此生成模板,但许多用户仍希望获取 CI 生成逻辑的副本,并将它重用于其他团队项目。You can already clone and make templates from your build definitions, but many users have wanted to take a copy of their CI build logic and reuse it in another team project. 这是 UserVoice 上的十大请求之一。This was a top-ten request on UserVoice.

我们很高兴向大家宣布,现在图 63 和图 64 所示功能已成为现实 !We are pleased to announce that this is now possible (Figure 63) and (Figure 64)!

Export build definition
(图 63)导出生成定义(Figure 63) Export build definition
Import build definition
(图 64)导入生成定义(Figure 64) Import build definition

扩展中包含生成模板Extensions with build templates

使用生成模板,可以为用户创建基线,以便开始定义生成过程。Build templates let you create a baseline for users to get started with defining their build process. 目前,我们提供大量现成的生成模板。虽然可以将新模板上传到帐户中,但扩展创建者以前却永远无法将新模板添加到扩展中。We ship a number of them in the box today and while you could upload new ones to your account, it was never possible for extension authors to include new templates as part of an extension. 现在可以在扩展中添加生成模板。You can now include build templates in your extensions. 例如:For example:

{  "id": "Template1", 
   "type": "ms.vss-build.template", 
   "targets": [ "ms.vss-build.templates" ], 
   "properties": { "name": "Template1" } }

有关完整示例,请访问 the full example, see


可以使用此功能,跨所有团队项目提供和共享同一个自定义模板。You can use this capability to offer and share the same custom template across all your team projects.

弃用扩展中的任务Deprecate a task in an extension

现在可以弃用扩展中的任务。You can now deprecate a task in your extension. 为此,必须将以下变量添加到最新版任务中:To make it work, you must add the following variable to the latest version of your task:

"deprecated": true

当用户搜索弃用的任务(图 65)时,我们将这些任务推送到最后,并将它们整合到默认折叠的可折叠部分下。When the user searches for deprecated tasks (Figure 65), we push these tasks to the end and group them under a collapsible section that is collapsed by default. 如果定义已经使用弃用的任务,我们会显示弃用的任务徽章,建议用户切换到替换任务。If a definition is already using a deprecated task, we show a deprecated task badge to encourage users to switch to the replacement.

Deprecated task badge
(图 65)弃用的任务徽章(Figure 65) Deprecated task badge

可以在任务说明中提及替换任务,从而帮助用户了解替换任务(图 66)。You can help your users learn about the replacement task by mentioning it in the task description (Figure 66). 然后,说明会指导用户通过任务目录和现有生成/发布定义,按正确方式使用任务。The description then points users using the task in the right direction from both the task catalog and the existing build/release definitions.

Deprecated task description
(图 66)弃用的任务说明(Figure 66) Deprecated task description

允许参与的生成部分控制部分公开范围Let contributed build sections control section visibility

以前,如果使用包含生成任务和生成摘要部分的扩展,即使未在相应生成中使用生成任务,也会看到生成摘要部分。Previously, if you were using an extension that had build tasks and build summary sections, you would see the build summary section even if you were not using the build task in that build. 现在,可以在扩展代码中添加以下代码行,并将值设置为 true 或 false,从而选择在生成摘要页中隐藏或显示相应部分:Now, you can choose to hide or show that section in the build summary page by adding the following line in your extension code and setting the value to true or false:

VSS.getConfiguration().setSectionVisibility("$(publisherId).$(extensionId).$(sectionId)", false);

请查看 Microsoft vsts-extension-samples 存储库中的示例。View the sample included in the Microsoft vsts-extension-samples repository.

变量组支持Variable group support

已经可以在发布定义中使用变量组,现在也可以在生成定义中使用变量组。Variable groups have been available to use in release definitions, and now they are ready to be used in build definitions, too. 详细了解如何创建变量组Learn more about creating a variable group. 这是根据项目级生成/发布变量和生成定义中的变量组的相关建议进行开发和优先处理。This has been developed and prioritized based on related suggestions for project-level build/release variables and variable groups in build definitions.

使用 Apple 证书等安全文件Work with secure files such as Apple certificates

我们添加了具有常规用途的安全文件库(图 67)。We have added a general-purpose secure files library (Figure 67).

Secure files library
(图 67)安全文件库(Figure 67) Secure files library

使用安全文件库,可以在服务器上存储签名证书、Apple 预配配置文件、Android 密钥存储文件和 SSH 密钥等文件,而无需将它们提交到源存储库。Use the secure files library to store files such as signing certificates, Apple Provisioning Profiles, Android Keystore files, and SSH keys on the server without needing to commit them to your source repository.

安全文件的内容已加密,只能在生成或发布过程中通过任务引用它们。The contents of secure files are encrypted and can only be used during build or release processes by referencing them from a task. 根据安全设置,安全文件可用于团队项目中的多个生成和发布定义。Secure files are available across multiple build and release definitions in the team project based on security settings. 安全文件遵循库安全模型。Secure files follow the Library security model.

我们还添加了一些 Apple 任务来利用这项新功能:We have also added some Apple tasks that leverage this new feature:

暂停生成定义Pause build definitions

现可暂停或禁用生成定义。You can now pause or disable build definitions. 如果计划更改生成定义且希望在完成之前避免任何新生成排队,只需禁用生成定义即可。If you plan to make changes to your build definition and you want to avoid queuing any new builds until you are done, simply disable the build definition. 同样,如果计划升级代理计算机,可选择暂停生成定义,这会使 VSTS 依然接受新的生成请求,但将其保留在队列中而不运行,直到继续生成定义。Similarly, if you plan to upgrade agent machines, you can choose to pause a build definition, which enables VSTS to still accept new build requests but hold them in queue without running until you resume the definition.

任务输入验证支持Task input validations support

有时候,在生成定义任务中键入参数容易出现错误。Typing the parameters in build definition tasks can sometimes be error prone. 通过任务输入验证,任务创建者可确保指定适当的值。With task input validation, task authors can ensure appropriate values are specified. 验证表达式遵循用于任务条件的常见表达式语法,除了任务条件支持的常用函数外,还可使用任何受支持的函数,包括 URL、IPV4、电子邮件、数字范围、sha1、长度或匹配。Validation expressions follow the familiar expression syntax used for task conditions and can use any of the supported functions besides the general functions supported by task conditions, including URL, IPV4, email, number range, sha1, length, or match.


有关目标和使用情况的更多信息,请访问 vsts-tasks 存储库页面Read more about the goals and usage on the vsts-tasks repo page.

全新的发布定义编辑器 New Release Definition Editor

我们一直在不断更新生成和发布体验。我们已重新设计发布定义编辑器以提供更加直观的体验,消除了一些痛点并添加了新功能。Continuing on our journey of refreshing the Build and Release experiences, we have re-imagined the release definition editor to provide a more intuitive experience, fix some pain points, and add new capabilities. 新编辑器的最强大功能之一是能可视化呈现环境部署的进展情况。One of the most powerful features of the new editor is its ability to help you visualize how deployments to your environments would progress. 除此之外,审批、环境属性和部署设置现在都可视情况使用,配置起来非常容易。In addition to this, approvals, environment properties, and deployment settings are now in-context and easily configurable.

管道的可视化效果Visualization of the pipeline

编辑器中的管道(图 68)提供了一个图形视图,用于呈现部署在发布中的进展。The pipeline (Figure 68) in the editor provides a graphical view of how deployments progress in a release. 项目供发布使用,然后会部署到环境中。The artifacts are consumed by the release and deployed to the environments. 环境的布局和链接反映了为每个环境定义的触发器设置。The layout and linking of the environments reflects the trigger settings defined for each environment.

(图 68)发布管道(Figure 68) Release pipeline
可视情况使用的配置 UIIn context configuration UI

项目、发布触发器、部署前和部署后审批、环境属性和部署设置现在都可视情况使用,配置起来非常容易(图 69)。Artifacts, release triggers, pre-deployment and post-deployment approvals, environment properties, and deployment settings are now in-context and easily configurable (Figure 69).

Release configuration
(图 69)发布配置(Figure 69) Release configuration
开始使用部署模板Getting started with deployment templates

所有内置部署模板均具备进程参数,用户可通过指定最重要的参数,更轻松地开始使用,无需深入了解任务的情况(图 70)。All in-built deployment templates are equipped with process parameters that simplifies the process for users to get started by specifying the most important parameters without needing to go deep into the tasks (Figure 70).

Deployment templates
(图 70)部署模板(Figure 70) Deployment templates
简化发布和环境变量管理Simplified management of release and environment variables

使用“列表”视图快速添加发布或环境变量,使用“网格”视图跨范围并排比较和编辑变量(图 71) 。Use the List view to quickly add release or environment variables and the Grid view to compare and edit variables across scopes side-by-side (Figure 71). 此外,可在这两种视图中使用筛选器和关键字搜索来管理要处理的变量集。Additionally, you can use the filter and keyword search to manage the set of variables to work with in both the views.

Simplified management of variables
(图 71)简化的变量管理(Figure 71) Simplified management of variables
改进了任务和阶段编辑器Improved task and phase editor

全新的生成定义编辑器中的所有增强功能现也适用于发布定义编辑器(图 72)。All the enhancements in the new build definition editor are now available in the release definition editor, as well (Figure 72). 可以搜索任务,并使用“添加”按钮或拖放操作进行添加。You can search for tasks and add them by either using the Add button or by using drag/drop. 可以使用拖放操作,重新排列或克隆任务。You can reorder or clone tasks using drag/drop.

Task editor
(图 72)任务编辑器(Figure 72) Task editor
变量组、保留策略和“选项”选项卡Variable groups, Retention, and Options tabs

现在可以关联/取消关联到变量组(图 73),并为各个环境设置保留策略,同时还能在“选项”选项卡中修改发布定义级设置(如发行版号格式)。此外,还可以将环境保存为部署模板、设置环境级权限,并在“任务”选项卡中对阶段重新排序。You can now link/unlink to variable groups (Figure 73), set retention policy for individual environments, and modify release definition-level settings such as release number format from the Options tab. You can also save an environment as a deployment template, set environment level permissions, and re-order phases within the Tasks tab.

Variable groups
(图 73)变量组(Figure 73) Variable groups

执行环境级操作可另存为模板并设置安全性(图 74)。Use environment level operations to save as template and set security (Figure 74).

Environment menu
(图 74)环境菜单(Figure 74) Environment menu

使用部署组的虚拟机部署 Virtual Machine Deployment using Deployment Groups

Release Management 现在支持现成可靠的多计算机部署。Release Management now supports robust out-of-the-box multi-machine deployment. 现在,可以安排跨多台计算机进行部署,并执行滚动更新,同时确保整个应用程序的高可用性。You can now orchestrate deployments across multiple machines and perform rolling updates while ensuring high availability of the application throughout.

基于代理的部署功能依赖相同的生成和部署代理。Agent-based deployment capability relies on the same build and deployment agents. 不过,不同于现行方法(在代理池中的一组代理服务器上安装生成和部署代理,并促使部署到远程目标服务器),可以直接在每个目标服务器上安装代理,并促使滚动部署到这些服务器。However, unlike the current approach where you install the build and deployment agents on a set of proxy servers in an agent pool and drive deployments to remote target servers, you install the agent on each of your target servers directly and drive rolling deployments to those servers. 可以在目标计算机上使用完整的任务目录。You can use the full task catalog on your target machines.

部署组(图 75)是一个目标(计算机)逻辑组,其中每个目标上都安装了代理。A deployment group (Figure 75) is a logical group of targets (machines) with agents installed on each of them. 部署组表示物理环境,如单盒开发、多计算机 QA 和用于 UAT/Prod 的计算机场。它们还指定物理环境的安全性上下文。Deployment groups represent your physical environments, such as single-box Dev, multi-machine QA, and a farm of machines for UAT/Prod. They also specify the security context for your physical environments.

Deployment groups
(图 75)部署组(Figure 75) Deployment groups

可以对向其注册了代理的任何虚拟机使用此功能。You can use this against any virtual machine that you register our agent with. 我们还支持一个可在虚拟机启动时自动安装代理的 Azure 虚拟机扩展,这让用户很方便就可向 Azure 进行注册。We have also made it very easy to register with Azure with support for an Azure virtual machine extension that auto-installs the agent when the virtual machine spins up. 注册 Azure 虚拟机时,会自动继承标记。Tags are automatically inherit on the Azure virtual machine when it is registered.

拥有部署组后,只需配置要我们在相应部署组上执行的操作即可(图 76)。Once you have a deployment group, you simply configure what you want us to execute on that deployment group (Figure 76). 可以使用标记控制在哪些计算机上运行什么部署,并控制滚动部署的速度快慢。You can control what gets run on which machines using tags and control how fast or slow the rollout happens.

Configure deployment groups
(图 76)配置部署组(Figure 76) Configure deployment groups

运行部署时,日志显示跨整个目标计算机组的部署进展情况(图 77)。When the deployment is run, the logs show the progression across the entire group of machines you are targeting (Figure 77).

Deployment group progress
(图 77)部署组进度(Figure 77) Deployment group progress

此功能现已集成到 Release Management。This feature is now an integrated part of Release Management. 不需要其他许可证。No additional licenses are required.

改进了部署组 UIImproved Deployment Groups UI

我们一直在不断更新生成和发布体验。我们已重新设计部署组页面,使其可提供更加简洁直观的体验(图 78) 。Continuing our journey of refreshing the Build and Release experiences, we have now re-imagined our deployment groups pages to make it a more clean and intuitive experience (Figure 78). 从登录页面可查看部署组中目标的运行状况。From the landing page, you can view the health of the targets in the deployment group. 还可管理各个部署组的安全性,或者跨部署组设置默认权限。You can also manage security for an individual deployment group, or set default permissions across deployment groups.

Deployment groups UI
(图 78)部署组 UI(Figure 78) Deployment groups UI

对于部署组中的目标,可以查看摘要、最近部署和目标的功能(图 79)。For a target within a deployment group, you can view a summary, recent deployments, and the target's capabilities (Figure 79). 可以对目标设置标记,控制每个目标上的运行内容。You can set tags on the target, and control what is run on each target. 我们将在即将发布的版本中添加部署组筛选器支持。We are adding filter support for deployment groups in upcoming releases.

Deployment groups UI tags
(图 79)部署组 UI 标记(Figure 79) Deployment groups UI tags

任务组引用Task group references

使用任务组,可以定义一组能够添加到生成或发布定义的任务(图 80)。Task groups let you define a set of tasks that you can add to your build or release definitions (Figure 80). 如果需要在多个生成或发布中使用同一组任务,这就非常方便。This is handy if you need to use the same grouping of tasks in multiple builds or releases. 为了帮助用户跟踪任务组的使用者,现在支持查看引用任务组的生成定义、发布定义和任务组(图 79)。To help you track the consumers of a task group, you now have a view into the build definitions, release definitions, and task groups that reference your task group (Figure 79).

Task group references
(图 80)任务组引用(Figure 80) Task group references

尝试删除仍被引用的任务组时,我们会发出警告,并提供指向此页的链接。When you try to delete a task group that is still referenced, we warn you and give you a link to this page.

任务组版本控制Task group versioning

更改任务组时,可能会觉得这样做有风险,因为更改会应用于使用任务组的所有定义。When making changes to task groups, it can feel risky because the change is effective to all definitions that use the task group. 通过任务组版本控制,现在可以组建和预览任务组版本,在能够切换前,仍向最重要的定义提供稳定版本。With task group versioning, now you can draft and preview task group versions while still offering stable versions to your most important definitions until you are ready to switch. 经过一些组建和迭代后,可以发布稳定版本。发布时,如果更改属于重大更改,可以选择将任务组发布为预览版(新主版本)。After some drafting and iteration, you can publish a stable version and, while publishing, if the changes are breaking in nature, you can choose to publish the task group as preview (a new major version). 也可以直接发布为更新后的稳定版本(图 81)。Alternatively, you can publish it directly as an updated stable version (Figure 81).

当任务组的新主版本(或预览版)可用时,定义编辑器会通知用户有新版本。When a new major (or preview) version of the task group is available, the definition editor will advise you that there is a new version. 如果主版本是预览版,甚至还会看到内容为“试一试”的消息。If that major version is preview, you even see a "try it out" message. 当任务组不再是预览版时,使用此版本的定义会自动更新(遵循主要通道)(图 82)。When the task group comes out of preview, definitions using it are auto-updated, sliding along that major channel (Figure 82).

Save as draft
(图 81)将任务组另存为草稿(Figure 81) Save task group as draft
Publish task group as preview
(图 82)将任务组作为预览版发布(Figure 82) Publish task group as preview

任务组导入和导出Task group import and export

虽然可以在项目中重用任务组,但我们知道,跨项目和帐户重新创建任务组可能会非常痛苦。Although task groups have enabled reuse within a project, we know that recreating a task group across projects and accounts can be painful. 现在,借助任务组导入/导出功能(图 83),可将任务组导出为 JSON 文件并在所需位置导入,就像我们对发布定义所做的那样。With task group import/export (Figure 83), as we have done for release definitions, now you can export as a JSON file and import where you want it. 我们还启用了嵌套的任务组,导出时它们会先展开。We have also enabled nested task groups, which first expand when they are exported.

Export task group
(图 83)导出任务组(Figure 83) Export task group

服务器端(无代理)任务中的多配置支持Multi Configuration support in Server Side (Agentless) tasks

通过为服务器端(无代理)任务指定变量乘数(图 84),现在可以在并行运行的多个配置上的阶段中运行一组相同的任务。By specifying variable multipliers for server side (agentless) tasks (Figure 84), you can now run the same set of tasks in a phase on multiple configurations, which run in parallel.

Multi configuration of agentless tasks
(图 84)无代理任务的多个配置(Figure 84) Multi configuration of agentless tasks

手动干预任务中的变量支持Variables Support in Manual Intervention task

手动干预任务(图 85)现在支持在任务运行时向用户显示的说明文本中使用变量,以便用户可以继续执行发布过程或拒绝它。The Manual Intervention task (Figure 85) now supports the use of variables within the instruction text shown to users when the task runs, at the point where the user can resume execution of the release process or reject it. 可添加发布中定义的任何可用变量,这些值在通知以及发送给用户的电子邮件中使用(图 86)。Any variables defined and available in the release can be included, and the values are used in the notifications as well as in the email sent to users (Figure 86).

Manual intervention task
(图 85)手动干预任务(Figure 85) Manual intervention task
Manual intevention pending dialog
(图 86)手动干预待定对话框(Figure 86) Manual intervention pending dialog

根据源分支控制部署到环境的发布Control releases to an environment based on the source branch

发布定义可以配置为,在新建发布时(通常是在源生成成功后)自动触发部署。A release definition can be configured to trigger a deployment automatically when a new release is created, typically after a build of the source succeeds. 不过,不妨仅部署来自特定源分支的生成,而不是在任何生成成功时部署。However, you may want to deploy only builds from specific branches of the source, rather than when any build succeeds.

例如,不妨将所有生成部署到开发和测试环境,但只将特定的生成部署到生产环境。For example, you may want all builds to be deployed to Dev and Test environments, but only specific builds deployed to Production. 以前,需要为此维护两个发布管道,一个用于开发和测试环境,另一个用于生产环境。Previously you were required to maintain two release pipelines for this purpose, one for the Dev and Test environments and another for the Production environment.

Release Management 现在支持对每个环境使用项目筛选器。Release Management now supports the use of artifact filters for each environment. 也就是说,可指定在满足部署触发器条件(如生成成功和新建发布)时向每个环境部署哪些发布。This means you can specify the releases that are deployed to each environment when the deployment trigger conditions (such as a build succeeding and creating a new release) are met. 在环境“部署条件”对话框(图 87)的“触发器”部分,选择触发向相应环境进行新部署的项目条件,如生成的源分支和标记。In the Trigger section of the environment Deployment conditions dialog (Figure 87), select the artifact conditions such as the source branch and tags for builds that will trigger a new deployment to that environment.

Deployment conditions dialog
(图 87)部署条件对话框(Figure 87) Deployment conditions dialog

此外,“发布摘要”页(图 88)现在会弹出提示,指明所有“未启动”部署处于这种状态的原因,并建议如何或何时启动部署。In addition, the Release Summary page (Figure 88) now contains a pop-up tip that indicates the reason for all "not started" deployments to be in that state, and suggests how or when the deployment will start.

Release summary tip
(图 88)发布摘要提示(Figure 88) Release summary tip

作为项目源的 Git 存储库的发布触发器Release Triggers for Git repositories as an artifact source

Release Management 现在支持,为与同一帐户中任何团队项目中的发布定义相关联的 Git 存储库,配置持续部署触发器(图 89)。Release Management now supports configuring a continuous deployment trigger (Figure 89) for Git repositories linked to a release definition in any of the team projects in the same account. 这样就可以在对存储库进行新提交时自动触发发布。This lets you trigger a release automatically when you make a new commit to the repository. 还可以指定提交会触发发布的 Git 存储库分支。You can also specify a branch in the Git repository for which commits will trigger a release.

Release triggers
(图 89)发布触发器(Figure 89) Release triggers

发布触发器:持续部署推送到 Git 存储库的更改Release Triggers: Continuous deployment for changes pushed to a Git repository

Release Management 一直支持在生成完成时配置持续部署。Release Management has always provided the capability to configure continuous deployment when a build completes. 不过,现在还可以对 Git 推送配置持续部署。However, now you can also configure continuous deployment on Git Push. 也就是说,可以将 GitHub 和 Team Foundation Git 存储库作为项目源与发布定义相关联,再自动为不是通过生成制作的 Node.JS 和 PHP 等应用程序触发发布,因此无需适用于持续部署的生成操作。This means that you can link GitHub and Team Foundation Git repositories as artifact sources to a release definition, and then trigger releases automatically for applications such as Node.JS and PHP that are not generated from a build and so do not need a build action for continuous deployment.

环境触发器中的分支筛选器Branch filters in environment triggers

在新的发布定义编辑器中,现可为特定环境指定项目条件。In the new release definition editor you can now specify artifact conditions for a particular environment. 通过使用项目条件,可以更加精细地控制哪些项目应部署到特定环境。Using these artifact conditions, you will have more granular control on which artifacts should be deployed to a specific environment. 例如,对于生产环境,可能需要确保仅部署从主分支产生的生成。For example, for a production environment you may want to make sure that builds generated only from the main branch are deployed. 需要对你认为应满足此条件的所有项目设置此筛选器。This filter needs to be set for all artifacts that you think should meet this criterion.

也可对链接到发布定义的每个项目添加多个筛选器(图 90)。You can also add multiple filters for each artifact that is linked to the release definition (Figure 90). 仅当成功满足所有项目条件时,才对此环境触发部署。Deployment is triggered to this environment only if all the artifact conditions are successfully met.

Branch filters
(图 90)分支筛选器(Figure 90) Branch filters

增强了服务器端任务Enhancements to server-side tasks

我们对服务器端任务(在服务器阶段内运行的任务)进行了两项增强。We have made two enhancements to server-side tasks (tasks that run within a server phase).

我们新增了一个任务,可在自动管道中调用任何常规 HTTP REST API(图 91)。We have added a new task that invokes any generic HTTP REST API (Figure 91) as part of the automated pipeline. 例如,可用于使用 Azure 函数调用特定的处理,并等待它完成。For example, it can be used to invoke specific processing with an Azure function, and wait for it to be completed.

(图 91)REST API 任务(Figure 91) REST API task

我们还向所有服务器端任务添加了“控制选项”(图 92)部分。We have also added a Control options (Figure 92) section to all server-side tasks. 任务行为现在包括设置“已启用”、“出错时继续”、“始终运行”和“超时”选项。Task behavior now includes setting the Enabled, Continue on error, Always run, and Timeout options.

Task control options
(图 92)任务控件选项(Figure 92) Task control options

代码中心内的发布状态徽章Release status badge in Code hub

目前,若要确定是否已将提交部署到客户生产环境中,请先确定哪个生成使用此提交,再检查部署该生成的所有发布环境。Today, if you want to know whether a commit is deployed to your customer production environment, you first identify which build consumes the commit and then check all the release environments where this build is deployed. 现在,操作大大简化了。“代码”中心状态徽章中集成了部署状态,可以列出代码已部署到的环境。Now this experience is much easier with the integration of the deployment status in the Code hub status badge to show the list of environments that your code is deployed to. 对于每个部署,状态都会发布到已部署的最新提交。For every deployment, status is posted to the latest commit that was part of the deployment. 如果将提交部署到多个发布定义(包含多个环境),每个提交都会在徽章中记录一个条目,并显示针对每个环境的状态(图 93)。If a commit is deployed to multiple release definitions (with multiple environments) then each has an entry in the badge, with status shown for each environment (Figure 93). 这提升了已部署的代码提交的可跟踪性。This improves the traceability of code commit to deployments.

Release status badge
(图 93)发布状态徽章(Figure 93) Release status badge

默认情况下,创建发布定义时,部署状态会针对所有环境进行发布。By default, when you create a release definition, deployment status is posted for all environments. 不过,可以有选择地选择应在状态徽章中显示哪些环境的部署状态(例如,仅显示生产环境的部署状态)(图 94)。However, you can selectively choose the environments whose deployment status should be displayed in the status badge (e.g. only show production environments) (Figure 94).

Deployment options dialog
(图 94)部署选项对话框(Figure 94) Deployment options dialog

增强了添加项目时使用的“生成定义”菜单Enhancements to Build definition menu when adding artifacts

将生成项目添加到发布定义时,现在可以查看定义及其文件夹组织信息,并轻松选择所需的定义(图 95)。When adding build artifacts to a release definition, you can now view the definitions with their folder organization information and simplify choosing the desired definition (Figure 95). 这样,可以很容易区分不同文件夹中同名的生成定义。This makes it easy to differentiate the same build definition name but in different folders.

Add artifact
(图 95)添加项目(Figure 95) Add artifact

定义列表的筛选依据为是否包含筛选词。The list of definitions is filtered based on those that contain the filter term.

将发布定义还原为旧版Revert your release definition to older version

目前,如果发布定义已更新,便无法直接还原为旧版。Today, if a release definition is updated, you cannot directly revert to a previous version. 唯一的方法是,查看发布定义历史记录,找出更改的差异,再手动编辑发布定义。The only way is to look into the release definition history to find the diff of the changes, and then manually edit the release definition. 现在,使用“还原定义”功能(图 96),可以选择并还原为发布定义“历史记录”选项卡中的任意旧版发布定义。Now, using the Revert Definition feature (Figure 96), you can choose, and revert back to any older version of a release definition from the release definition History tab.

Revert release definition
(图 96)还原发布定义(Figure 96) Revert release definition

个性化发布通知Personalized notifications for releases

发布通知现已与 VSTS 通知设置体验集成。Release notifications are now integrated with the VSTS notification settings experience. 现在,这些管理版本自动获取有关挂起的操作(审核或手动干预)以及重要部署故障的通知。Those managing releases are now automatically notified of pending actions (approvals or manual interventions) and important deployment failures. 通过导航至配置文件菜单下的“通知”设置并将“发布订阅”切换为“关闭”可关闭这些通知 。You can turn off these notifications by navigating to the Notification settings under the profile menu and switching off Release Subscriptions. 通过创建自定义订阅还可订阅其他通知。You can also subscribe to additional notifications by creating custom subscriptions. 管理员可通过“团队”下的“通知”设置和“帐户”设置控制团队和组的订阅 。Admins can control subscriptions for teams and groups from the Notification settings under Team and Account settings.

发布定义创建者不再需要手动发送关于审核和部署完成的电子邮件。Release definition authors no longer need to manually send emails for approvals and deployment completions.

对于具有多个发布利益干系人的大型帐户以及除审核者、发布创建者和环境所有者之外希望接收通知的人员,这尤为有用(图 97)。This is especially useful for large accounts that have multiple stakeholders for releases, and for those other than the approver, release creator, and environment owner that might want to be notified (Figure 97).

Release notifications
(图 97)发布通知(Figure 97) Release notifications


有关详细信息,请参阅管理发布通知一文。See the post for managing release notifications for more information.

测试 Testing

不再支持 Microsoft 测试管理器中的实验室中心和自动测试流 Removing support for Lab Center and automated testing flows in Microsoft Test Manager

随着 Build Management 和 Release Management 的发展,TFS 2018 不再支持 XAML 生成,因此我们要更新有关结合使用 Microsoft 测试管理器 (MTM) 与 TFS 的支持。With the evolution of Build and Release Management, XAML builds are no longer supported in TFS 2018 and consequently we are updating support for using Microsoft Test Manager (MTM) with TFS. 自 TFS 2018 起,TFS 不再支持在 MTM 中使用测试中心/实验室中心进行自动测试。Using Test Center/Lab Center in MTM for automated testing is no longer supported by TFS, starting with TFS 2018. 如果尚未准备从 XAML 生成和实验室中心迁移,则不应升级到 TFS 2018。If you are not ready to migrate away from XAML builds and Lab Center, you should not upgrade to TFS 2018.

请阅读以下内容,了解升级到 TFS 2018 的影响:Please see the impact of upgrading to TFS 2018 below:

实验室中心:Lab Center:
  • 不再受支持:No longer supported:
    • 无法向 TFS 注册用于创建和管理实验室环境的 Test Controller。Test Controllers cannot be registered with TFS for creating and managing Lab environments.
    • 向 TFS 注册的任何现有 Test Controller 离线,现有实验室环境显示为“未就绪”。Any existing Test Controllers registered with TFS will go offline and existing Lab environments will appear as 'Not Ready'.
  • 推荐备用方案:Recommended alternative:
自动测试:Automated Testing:
手动测试:Manual Testing:
  • 继续完全支持所有手动测试方案。All manual testing scenarios continue to be fully supported. 虽然可以结合使用 MTM 与 TFS 2018 进行手动测试,但实验室环境不能用于运行手动测试。While manual tests can be run using MTM with TFS 2018, Lab Environments cannot be used to run manual tests.
  • 对于所有手动测试方案,我们强烈建议将 TFS 连接到 Web 以使用测试中心For all manual testing scenarios, we strongly recommend using the Test hub in TFS web access.

根据探索测试团队向我们提供的反馈意见,我们一直在改进可跟踪性链接,同时从测试和反馈扩展提交 bug、任务或测试用例。Based on the feedback we received from teams doing exploratory testing, we are improving traceability links while filing bugs, tasks, or test cases from the Test & Feedback extension. 对于探索需求时创建的 bug 和任务,现在使用与需求相同的区域路径和迭代(而不是团队默认值)进行创建。Bugs and tasks created while exploring requirements are now created with the same area path and iteration as that of the requirement instead of team defaults. 对于探索需求时创建的测试用例,它们现在使用“测试 <-> 测试方”链接(而不是“父级 <-> 子级”链接)进行链接,以便将创建的测试用例自动添加到以需求为依据的测试套件。Test cases created while exploring requirements will now be linked with a Tests <-> Tested By link instead of the Parent <-> Child link so that the test cases you create are automatically added to requirement based test suites. 最后,在没有具体了解任何需求时创建的工作项被提交到团队的默认迭代中,而不是当前迭代中,这样在冲刺 (sprint) 计划完成后,就没有任何新工作项进入当前迭代了。Finally, work items created while not specifically exploring any requirement are filed in the team's default iteration instead of the current iteration so that no new work items come into the current iteration after the sprint planning is complete.

筛选测试中心内的“测试计划和套件”中的测试用例工作项Filters for Test Case work items in Test Plans and Suites in Test Hub

除了可以筛选“结果”、“配置”和“测试程序”等“测试”字段之外,现在还可以筛选“标题”、“状态”和“分配到”(图 98)等测试用例工作项字段 。In addition to the filters on Test fields like Outcome, Configuration, and Tester, you can now filter on Test Case work item fields like Title, State, and Assigned To (Figure 98).

Test case filters
(图 98)测试用例筛选器(Figure 98) Test case filters

“发布环境”和“测试运行”的测试趋势图Test trend charts for Release Environments and Test Runs

我们现已开始支持“测试结果趋势”小组件(图 99)中的“发布环境”,这样用户便可以在 VSTS 仪表板上跟踪测试环境的状态。We are adding support for Release Environments in the Test Result Trend widget (Figure 99) so that you can track status of test environments on VSTS dashboards. 就像在“生成”中处理测试结果一样,现在可以创建趋势图,针对“发布环境”显示测试通过率、总数、通过或未通过测试和测试持续时间。Like the way you to do for test results in Build, you can now create trend charts showing test pass rate, count of total, passed or failed tests, and test duration for Release Environments. 还可以使用“测试运行”标题筛选器,从图表中筛选出环境内的特定测试运行。You can also filter the charts to a specific test run within an environment with the Test Run title filter.

Test trend chart
(图 99)测试趋势图表(Figure 99) Test trend chart

“测试运行”和“测试结果”注释的 Markdown 格式支持Markdown formatting support for Test Run and Test Result comments

我们现已开始支持使用 Markdown 语法设置“测试运行”和“测试结果”注释的格式。We are adding support for formatting Test Run and Test Result comments with markdown syntax. 可以使用此功能,在注释中创建格式化文本或指向 URL 的快速链接。You can use this feature to create formatted text or quick links to URLs in your comments. 可以使用“更新分析”更新“结果摘要”页中的“测试结果”注释,并使用“测试”中心内的“更新注释”更新“运行摘要”页中的“测试运行”注释。You can update Test Result comments in the Result Summary page with Update analysis and Test Run comments in the Run Summary page with Update comments in Test hub.

在“生成”/“发布”摘要页或“测试”中心内分析测试结果时,现在可以将现有 bug 与未通过测试相关联。While analyzing the test result in the Build or Release summary page or in the Test hub, you can now associate an existing bug to a failed test. 当测试由于已知原因而未通过且 bug 已提交时,这就非常有用。This is helpful when a test is failing for a known reason that has a bug already filed.

上传附件以测试运行和测试结果Upload attachments to test runs and test results

现在可将屏幕截图和日志文件等文件作为其他信息附加,以测试运行或测试结果。You can now attach files such as screenshots and log files to test runs or test results as additional information. 目前仅通过 Microsoft 测试管理器 (MTM) 客户端提供此功能,因此必须在 VSTS/TFS 的“测试”中心和 MTM 客户端之间切换上下文。Up to this point, this capability was only available through the Microsoft Test Manager (MTM) client, forcing you to switch context between the Test hub in VSTS/TFS and the MTM client.

测试批处理Test batching

在生成/发布管理的 Visual Studio 测试任务中,为实现高效执行,可以选择控制测试的分组(批处理)方式。In the Visual Studio test task in Build/Release management, options are available to control how tests should be grouped (batched) for efficient execution. 测试可按两种方式分组:Tests can be grouped in two ways:

  1. 基于参与运行的测试和代理数量,这种方式仅将测试分组为具有指定大小的批次数。Based on the number of tests and agents participating in the run, which simply groups tests into a number of batches of a specified size.
  2. 基于过去的测试运行时间,这种方法使用过去的运行时间创建测试批,从而使每个批具有大致相等的运行时间(图 100)。Based on past running time of tests, which considers past running time to create batches of tests such that each batch has approximately equal running time (Figure 100). 对快速运行的测试一起进行批处理,而单独的批可能会需要更长的时间运行测试。Quick running tests are batched together while longer running tests may belong to a separate batch. 此选项可与多代理阶段设置结合,将总测试时间降至最短。This option can be combined with the multi-agent phase setting to reduce the total test time to a minimum.
Test batching
(图 100)测试批处理(Figure 100) Test batching

使用 VSTest 任务运行 webtestRun webtests using the VSTest task

通过使用 Visual Studio 测试任务,现可在 CI/CD 管道中运行 webtest(也称为 Web 性能测试)。Using the Visual Studio test task, webtests, also known as web performance tests, can now be run in the CI/CD pipeline. 可通过指定要在任务程序集输入中运行的测试来运行 Webtest。Webtests can be run by specifying the tests to run in the task assembly input. 还可通过选择任务中的测试计划/测试套件运行其“关联自动化”链接到 webtest 的任何测试用例工作项(图 101)。Any test case work item that has an “associated automation” linked to a webtest, can also be run by selecting the test plan/test suite in the task (Figure 101).

Test selection
(图 101)测试选项(Figure 101) Test selection

Webtest 结果以测试结果附件形式提供(图 102)。Webtest results are available as an attachment to the test result (Figure 102). 可下载此结果以在 Visual Studio 中进行脱机分析。This can be downloaded for offline analysis in Visual Studio.

Test summary
(图 102)测试摘要(Figure 102) Test summary

此功能依赖于 Visual Studio 测试平台的更改,并且需要在生成/发布代理上安装 Visual Studio 2017 Update 4。This capability is dependent on changes in the Visual Studio test platform and requires that Visual Studio 2017 Update 4 is installed on the build/release agent. 使用 Visual Studio 的以前版本无法运行 Webtest。Webtests cannot be run using prior versions of Visual Studio.

同样,可使用“运行功能测试”任务运行 webtest。Similarly, webtests can be run using the Run Functional Test task. 此功能依赖于测试代理的更改,将在 Visual Studio 2017 Update 5 中提供。This capability is dependent on changes in the Test Agent, that will be available with the Visual Studio 2017 Update 5.


有关如何结合使用此功能和负载测试的示例,请参阅使用 Visual Studio 和 VSTS 在云中加载测试应用快速入门See the Load test your app in the cloud using Visual Studio and VSTS quickstart as an example of how you can use this together with load testing.

测试计划和测试套件的图表小组件Chart widget for test plans and test suites

以前可在“测试”中心为测试计划和套件创建图表并将其固定到仪表板。Previously, you could create charts for test plans and suites in Test hub and pin them to dashboard. 现已添加一个小组件,该组件支持从仪表板上的小组件目录为测试计划和套件创建图表。We have now added a widget that enables creating charts for test plans and suites from the widget catalog on the dashboard. 可以创建测试创作状态或测试执行状态的图表。You can create charts for test authoring status or test execution status. 此外,图表上需要显示大量数据时,通过从小组件添加图表可以创建更大的图表(图 103)。Moreover, adding charts from the widget allows you to create larger charts when you have more data to be shown on a chart (Figure 103).

Chart widget
(图 103)图表小组件(Figure 103) Chart widget

增添了对使用 Chrome 浏览器的桌面应用的屏幕截图和注释支持,以进行手动测试。Screenshot and annotation support for desktop apps with Chrome browser for manual tests

我们将添加对一条手动测试热门建议的支持,即从“测试”中心的“Web 测试运行程序”捕获桌面应用程序屏幕截图 。We are adding support for one of the top suggestions from manual testing - capturing screenshots of desktop applications from the Web Test Runner in Test hub. 到目前为止,必须使用“Microsoft 测试管理器”中的“测试运行程序”捕获桌面应用的屏幕截图 。Until now, you had to use Test Runner in Microsoft Test Manager to capture screenshots of desktop apps. 使用此功能需要安装测试和反馈扩展You need to install the Test & Feedback extension to use this functionality. 我们即将推出对 Chrome 浏览器的支持,并在不久后推出对 Firefox 的支持。We are rolling out support for the Chrome browser, and Firefox will follow shortly thereafter.

停用适用于 SharePoint 的 TFS 扩展 Discontinuing TFS Extension for SharePoint

TFS 2018 及更高版本不再支持适用于 SharePoint 的 TFS 扩展。TFS 2018 and later versions will no longer support the TFS Extension for SharePoint. 此外,用于配置 TFS 服务器与 SharePoint 服务器集成的屏幕,已从 Team Foundation 管理控制台中删除。Additionally, the screens used to configure integration between a TFS Server and a SharePoint server have been removed from the Team Foundation Administration Console.


如果从配置为与 SharePoint 集成的先前版本升级到 TFS 2018,升级后需要禁用 SharePoint 集成,否则 TFS SharePoint 站点将加载失败。If you are upgrading to TFS 2018 from a previous version configured to integrate with SharePoint, you will need to disable the SharePoint integration after upgrade, or your TFS SharePoint sites will fail to load.

我们已创建一个解决方案,通过该方案可在 SharePoint 服务器上禁用集成。We have created a solution that allows you to disable integration on the SharePoint server. 有关详细信息,请参阅有关 TFS/SharePoint 集成的未来的文章。For more information, please see the post on the future of our TFS/SharePoint Integration.

停用团队聊天室 Discontinuing Team Rooms

新式开发团队主要依靠协作。Modern development teams heavily depend on collaboration. 团队成员希望(且需要)有地方来监视活动(通知),并进行讨论(聊天)。People want (and need) a place to monitor activity (notifications) and talk about it (chat). 几年前,我们认识到这种趋势,并着手构建团队聊天室,以支持实现这些方案。A few years back, we recognized this trend and set out to build the Team Room to support these scenarios. 自那以后,市场中出现了更多协作解决方案。Since that time, we have seen more solutions to collaborate emerge in the market. 最突出的是,Slack 的兴起。Most notably, the rise of Slack. 近期,我们宣布推出 Microsoft TeamsAnd more recently, the announcement of Microsoft Teams.

有这么多优质的解决方案可与 TFS 和 Visual Studio Team Services 完美集成,我们在 1 月宣布,计划从 TFS 2018 和 Visual Studio Team Services 中删除团队聊天室功能。With so many good solutions available that integrate well with TFS and Visual Studio Team Services, we announced in January the plans to remove our Team Room feature from both TFS 2018 and Visual Studio Team Services.

我们做得怎么样?How are we doing?

我们期待你的宝贵意见和建议!We would love to hear from you! 可以通过开发者社区门户报告并跟踪问题,并能在 Stack Overflow 上了解相关建议。You can report a problem and track it through Developer Community and get advice on Stack Overflow.

Top of Page