You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSTS集成CI/CD的Git Flow流程咨询及工具集成疑问

Git Flow + VSTS CI/CD Integration: Answers & Best Practices

Hey there, let's unpack your Git Flow + VSTS CI/CD questions clearly—this stuff can feel overwhelming at first, but once you align the branches with your pipeline stages, it all falls into place. Here's a breakdown tailored to your needs:

Core Questions Answered

1. Does integration release start from the develop branch?

Absolutely. The develop branch is Git Flow's integration backbone—it's where all completed feature/* branches get merged. For your VSTS CI/CD pipeline, you should configure an automatic trigger: every time code is pushed or merged into develop, kick off an integration build, run unit/integration tests, and deploy to your staging/integration test environment. This ensures new changes don't break the existing integrated codebase.

2. Which branch should UAT releases come from? Is it master?

Nope, never use master for UAT. In standard Git Flow, UAT releases should originate from a release/* branch. Here's how it works:

  • When develop has all the features ready for user testing, create a release/x.y.z branch (e.g., release/1.2.0) from develop.
  • This branch is dedicated to UAT: any bugs found during testing get fixed directly in the release branch, not back in develop.
  • Your VSTS pipeline can auto-deploy this release branch to your UAT environment as soon as it's created.

3. Does production release start from the master branch?

Yes, 100%. The master branch in Git Flow is your single source of truth for production-ready code. Every code change in master should have gone through integration testing, UAT, and formal approval. In VSTS, set up a trigger that fires when code is merged into master (or when a version tag like v1.2.0 is pushed) to kick off your production deployment pipeline. This guarantees that only validated, stable code reaches production.

4. Where should static analysis tools like SonarQube be integrated?

Static analysis should run at multiple checkpoints to catch issues early, but focus on these key branches:

  • feature/* branches: Enforce Sonar checks as part of your PR process in VSTS. Require that any PR to develop passes Sonar's quality gates (e.g., no critical vulnerabilities, minimum code coverage) before it can be merged. This stops bad code from entering the integration pipeline.
  • develop and release/* branches: Auto-run Sonar analysis every time code is pushed. For develop, this ensures the integrated codebase maintains quality; for release/*, it confirms no new issues were introduced during UAT bug fixes.
  • Optional: master branch: Run a final Sonar scan as a safety net before production deployment, though if your earlier checks are solid, this is mostly a redundant (but reassuring) step.

Here's a streamlined, production-ready workflow tailored to your scenario:

  • Feature Development:
    • Developers create feature/[feature-name] branches from develop.
    • On PR submission to develop, VSTS triggers: code review checks, unit tests, Sonar analysis, and a preview build.
    • Only after all quality gates pass is the PR merged into develop.
  • Integration Validation:
    • Merge into develop triggers VSTS to build, run integration tests, and deploy to your integration test environment.
    • Monitor this environment to ensure the integrated codebase is stable.
  • UAT Phase:
    • When ready for UAT, create a release/x.y.z branch from develop.
    • VSTS auto-deploys this branch to UAT; any bugs are fixed directly in the release branch, with deployments re-triggered on each fix.
  • Production Release:
    • Once UAT passes, merge release/x.y.z into master and tag the commit with v.x.y.z.
    • VSTS detects the merge/tag and triggers production deployment.
    • Merge the release branch back into develop to sync bug fixes with the integration backbone.
  • Hotfixes for Production:
    • For urgent production bugs, create a hotfix/x.y.z-hotfix1 branch from master.
    • Fix the bug, test it in a dedicated hotfix test environment (or UAT), then merge back into master (with a new tag) and develop.
    • VSTS triggers production deployment for the hotfix tag.

内容的提问来源于stack exchange,提问作者Vipin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:52:45