使用 TFS 2008 启用代码分析,影响最小

发布于 2024-12-05 08:55:57 字数 723 浏览 1 评论 0原文

我们在 TFS 2008 上有一个 .NET Web 应用程序,其中包含 172 个项目,涵盖应用程序的所有 3 层,并使用 Team Build for CI。我们使用VS2010进行开发。

我们希望使用最低推荐规则集激活所有项目的代码分析,并在 TFS 中强制执行签入策略,即代码分析应在签入之前运行一次。但我们希望对开发人员的影响降到最低他们的定期开发检查过程。每次我们在项目属性中启用代码分析时,该项目的正常构建时间都会增加 100%。 我们对代码分析问题进行了分析,尽管对于这个规则集也有很多问题,但它可以分发给所有可以在进行现有增强的同时修复这些问题的开发人员。

所以基本上我们有两种类型的构建:

  1. 正常构建用于检查代码的适当性,在签入代码之前会发生几次。
  2. 在签入之前的最终构建,我们还想检查代码分析。

因此,我们创建了另一个名为“DebugWithCA”的解决方案配置,其项目启用了代码分析,以便开发人员在签入代码之前,将配置从 Debug 切换到 DebugWithCA,构建并修复代码分析问题,然后签入。这样,对于正常构建,开发人员停留在调试解决方案配置中,而不必承担代码分析带来的额外构建时间。

但这似乎也是一种开销,因为我们白天有很多签入(许多开发人员),并且每次签入和切换回来时切换解决方案配置都会变得很痛苦。

有没有更简单的方法来完成我们的要求? 在进行构建时,我们是否可以指定一个快捷键,以便使用代码分析进行构建或使用 VS2010 中的特定解决方案配置进行构建?

We have a .NET web application with 172 projects on TFS 2008 that encompass all 3 tiers of the app and use Team Build for CI. We use VS2010 for development.

We would like to activate code analysis for all projects with Minimum Recommended Rule Set and enforce the check-in policy in TFS that code analysis should be run once before you check in. But we would like to have minimal impact to our developers in regard to their regular development check in process. Every time we enable code analysis in a project's properties, a normal build time for that project shoots up by 100%.
We did an analysis of the code analysis issues and though there a lot of them even for this ruleset, it can be distributed among all developers who can fix them while doing their existing enhancements.

So basically we have two types of builds that we do:

  1. Normal builds to check the propriety of the code which happens several times before we check-in the code.
  2. Final build just before the check-in where we would also like to check for code analysis.

Hence we created another solution configuration called "DebugWithCA" which had its projects enabled for code analysis so that before the developer checks-in the code, he switches the configuration from Debug to DebugWithCA, builds and fixes the code analysis issues and then checks in. So that for normal builds, the developer stays in Debug solution configuration and does not have to bear the additional build time caused by Code Analysis.

But this too seems like an overhead as we have a lot of check-ins during the day (many developers) and switching solution configuration every time you check-in and switching it back becomes a pain.

Is there an easier way to accomplish our requirement?
While doing a build, is there a shortcut key that we can assign so that it builds with Code Analysis or builds with a specific solution configuration in VS2010?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北方。的韩爷 2024-12-12 08:55:57

我可以想到两种实用的方法来解决你的问题。这两个建议都使代码分析脱离了开发人员的关键开发路径/时间。

  1. 在门控签入中激活您的 DebugWithCA 配置。开发人员只需签入代码,构建系统就会确保执行代码分析,并且仅在不违反基本规则的情况下才接受更改。
  2. 更加轻松;只需根据 DebugWithCA 配置执行滚动构建即可。开发人员可以离线发现违规行为。不太受欢迎的选择,但也较少干扰。

I can think of two pragmatical approaches to circumvent your problem. Both suggestions take the code analysis out of the critical development path / time of the developer.

  1. Have your DebugWithCA configuration activated in a Gated Check-in. The developer just checks-in the code and the build system makes sure code analysis is performed and the changes are only accepted when when no essential rules are violated.
  2. Even more relaxed; just perform Rolling Builds based on the DebugWithCA configuration. Developers can pick-up rule violations off-line. Less preferred option, but also less intrusive.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文