Getting started with a new repository can be daunting, especially if you are new to the project. Having a standard set of pull request workflows can help you get started and make sure you are following the same process as everyone else on the team.
A few standard workflows helps developers see a consistent process across all repositories. This makes it easier for developers to get started with a new repository and makes it easier for developers to move between repositories as the feedback they get from each pull request is consistent.
Below are some standard workflows that you can use in your repositories.
This workflow uses the microsoft/PR-Metrics action to update each pull request with information that helps ensure engineers keep PRs to an appropriate size with appropriate test coverage, while informing reviewers of the expected time commitment for a thorough review of the code.
Figure: PR Metrics gives warnings with suggested actions
You can find the workflow at SSWConsulting/SSW.GitHub.Template/.github/workflows/pr-metrics.yml
Tip: This action is customizable to cater for repositories where different file extensions are considered "code" and how to size the PR.
At SSW, SSW Dory emails people about their open PRs. Use this workflow for repos that don't have Dory.
Pull requests that sit open for days turn into merge debt: they drift from the main branch, pick up conflicts, and get harder to review. A scheduled reminder nudges the author to finish the pull request or close it.
This workflow uses the actions/stale action. Once a day it:
Stale label and posts a comment linking to the merge debt ruleAdd this workflow as .github/workflows/pr-manage-stale.yml:
name: "PR - Manage Stale PRs"on:schedule:# https://crontab.guru/#0_20_*_*_* - At 20:00 every day (UTC)- cron: '0 20 * * *'workflow_dispatch:permissions:contents: readissues: readpull-requests: writejobs:review-reminder:runs-on: ubuntu-lateststeps:- uses: actions/stale@v10with:days-before-issue-stale: -1 # don't mark issues as staledays-before-pr-stale: 3days-before-close: -1 # don't close issues/PRsexempt-draft-pr: trueignore-updates: truestale-pr-message: |Hi there!This PR has been here a while.[Did you know you should avoid merge debt?](https://www.ssw.com.au/rules/merge-debt)Please review and merge or close.Thanks!