diff --git a/docs/contributing.md b/docs/contributing.md index 7d0f7b389..3ffaf54c7 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -2,17 +2,36 @@ ## Development flow -* Default development branch is `develop`. Please use it when creating PRs with your features, fixes, documentation updates etc. PRs to `develop` branch should be merged using squash option in GitHub. -* When the release time comes (should be handled by UCC team) - create a PR from `develop` to `main` - * make sure that CI is passing and wait for the review from the team - * PR should be merged using merge commit option in GitHub - * release will be made automatically (both GitHub and PyPI) and bot will push a commit to `main` with all necessary changes (i.e. [like this](https://github.com/splunk/addonfactory-ucc-generator/commit/0c5e6802e1e52c37bf7131baf1b8264e5db30545)) - * after release is done - you need to backport bot's changes to the `develop` branch (i.e. [#974](https://github.com/splunk/addonfactory-ucc-generator/pull/974)) -* If release did not go well and a quick bug fix needs to be released (should be handled by UCC team) - * create a PR to `main` branch with a fix (with tests reproducing and then fixing the issue) - * make sure that CI is passing and wait for the review from the team - * PR should be merged using merge commit option in GitHub - * bug fix PR needs to be backported back to `develop` branch +The instructions below utilize the [GitHub CLI tool](https://cli.github.com/), which you can install via HomeBrew: +```bash +brew install gh +gh auth login +``` + +* The default development branch is `develop`. Use this branch for creating pull requests (PRs) for your features, fixes, documentation updates, etc. PRs to the `develop` branch should be merged using the squash option on GitHub. +* When it's time for a release (handled by the UCC team), create a PR from `develop` to `main` using the following commands: +```bash +gh pr create --title "chore: merge develop into main" --body "" --head develop --base main +# set automerge with merge commit to avoid accidentally squashing PR +gh pr merge develop --auto --merge +``` + +* Ensure CI passes and await team review. +* PR should be merged using **merge commit** option in GitHub (already included in the command) +* Releases are made automatically (both on GitHub and PyPI), and a bot will push a commit to `main` with all necessary changes (i.e. [like this](https://github.com/splunk/addonfactory-ucc-generator/commit/0c5e6802e1e52c37bf7131baf1b8264e5db30545)) +* After the release, backport the bot's changes to the `develop` branch (i.e. [#974](https://github.com/splunk/addonfactory-ucc-generator/pull/974)): + +```bash +gh pr create --title "chore: merge main into develop" --body "" --head main --base develop +# set automerge with merge commit to avoid accidentally squashing PR +gh pr merge main --auto --merge +``` + +* If a release encounters issues requiring a quick bug fix (handled by the UCC team): + * Create a PR to the main branch with the fix, including tests that reproduce and then fix the issue. + * Ensure CI passes and await team review. + * Merge the PR using the merge commit option on GitHub. + * Backport the bug fix PR to the develop branch. ## Build and Test