How can you do pre-merge testing in trunk based development?



  • Currently, we use a simple branching strategy, with a single main branch and one layer of feature branches; no branches on branches on branches. We also have many pipelines that run against each PR to check the code before it is merged to the main branch, including but not limited to,

    • code quality
    • linting
    • security assurance

    In a trunk-based approach, how does one run these tests before code is merged, without a PR?

    I have seen https://devops.stackexchange.com/q/9855/30208 but it did not fully answer my question. Thanks in advance for your patience with a n00b question πŸ˜„



  • You can still use pull requests with https://trunkbaseddevelopment.com/ . Especially with larger teams, using https://trunkbaseddevelopment.com/short-lived-feature-branches/ , you would open a pull request into the trunk, which would start the build process. Depending on your environment and desire to have rapid merges, you could merge the pull request automatically, perhaps based on things like no new style violations, sufficient code coverage, tests pass, and no new static analysis violations, and defer the human review for later.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2