feat: change the release and staging branching model by behnazh · Pull Request #900 · jenstroeger/python-package-template

Summary:

This pull request refactors the current branching model to improve development and address several challenges associated with using staging as the default base branch for pull requests. With this update, main will serve as the base branch for pull requests, containing active development changes, while releases will be triggered upon merging pull requests into the newly created release branch.

Requirement:

A new protected branch, named release, should be created if it doesn't already exist. This branch will be configured with security settings and essential checks to ensure the integrity and stability of the release process.

Reasons for the Change:

  • Security scanning tool compatibility: most security tools scan the default branch, which is main in this project. However, if staging is used as the base branch for pull requests and main is reserved for releases, security reports would only apply after a release is made. This delay makes it harder to address security issues promptly.

  • Development workflow efficiency: for changes like modifications to issue or pull request templates that need to be in effect immediately, using main as the default development branch allows those changes to take effect without waiting for a release.

  • Contributor onboarding: it has been difficult to explain to new contributors that they should create a pull request against staging instead of main. By making main the primary development branch, we aim to avoid this confusion in the future, ensuring a more intuitive workflow for new contributors.

  • Simplify release workflows for multi-release projects: instead of going through multiple release branches in a waterfall manner, the new approach enables a streamlined release pipeline where main can be merged directly into all release branches. This makes hotfix releases faster and more efficient.

  • Project activity visibility: if main does not contain the latest development activities, the project may appear inactive or abandoned, even if work is happening in staging. This restructuring ensures main reflects ongoing work and activity, presenting the project as more active and up-to-date.

  • Quick recognition for new contributors: contributors making their first submission often don't want to wait for a release to be listed as contributors in the project. By having main as the development branch, contributions are reflected immediately, providing quicker recognition for new contributors.