From 843427dd691811773156e23b9011f269f4c370f3 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Tue, 31 Jan 2023 10:59:01 +0200 Subject: [PATCH 1/4] doc: Write a short introduction about squashing commits Signed-off-by: Donatas Abraitis --- doc/developer/workflow.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/developer/workflow.rst b/doc/developer/workflow.rst index 06a2ccbc0a..88ee358384 100644 --- a/doc/developer/workflow.rst +++ b/doc/developer/workflow.rst @@ -342,6 +342,19 @@ summary of the included patches. The description should provide additional details that will help the reviewer to understand the context of the included patches. +Squash commits +-------------- + +Before merging make sure a PR has squashed the following kinds of commits: + +- Fixes/review feedback +- Typos +- Merges and rebases +- Work in progress + +This helps to automatically generate human-readable changelog messages. + + .. _license-for-contributions: License for Contributions From f05a0c1dde8c1cbe644aa71fc5b9e22ace34eb72 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Tue, 31 Jan 2023 11:16:50 +0200 Subject: [PATCH 2/4] tools: Add commit linter Run under Github Actions, and restrict commit messages, structure, with, etc. Enforce using only our specified prefixes for commit messages. It reduces the work release managers do when _crafting_ release notes. Signed-off-by: Donatas Abraitis --- .github/commitlint.config.js | 44 ++++++++++++++++++++++++++++++++ .github/workflows/commitlint.yml | 19 ++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/commitlint.config.js create mode 100644 .github/workflows/commitlint.yml diff --git a/.github/commitlint.config.js b/.github/commitlint.config.js new file mode 100644 index 0000000000..cf7daab867 --- /dev/null +++ b/.github/commitlint.config.js @@ -0,0 +1,44 @@ +module.exports = { + rules: { + 'header-max-length': [2, 'always', 72], + 'type-case': [2, 'always', 'lower-case'], + 'type-empty': [2, 'never'], + 'type-enum': [ + 2, + 'always', + [ + 'babeld', + 'bfdd', + 'bgpd', + 'doc', + 'docker', + 'eigrpd', + 'fpm', + 'isisd', + 'ldpd', + 'lib', + 'multi', + 'nhrpd', + 'ospf6d', + 'ospfd', + 'pbrd', + 'pimd', + 'pim6d', + 'ripd', + 'ripngd', + 'sharpd', + 'staticd', + 'tests', + 'tools', + 'vtysh', + 'vrrpd', + 'yang', + 'zebra', + 'all', + ], + ], + 'subject-empty': [2, 'never'], + 'subject-full-stop': [2, 'never', '.'], + 'subject-case': [2, 'always', 'sentence-case'], + }, +}; diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000000..a1f273a2ce --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,19 @@ +name: commitlint + +on: + pull_request_target: + types: + - opened + - reopened + +jobs: + lint: + if: github.repository == 'frrouting/frr' + permissions: + contents: read + runs-on: ubuntu-latest + steps: + - name: Check Commit + uses: wagoid/commitlint-github-action@v5 + with: + configFile: .github/commitlint.config.js From 19b8d68cf8ea0dca722b1630edd9e6834a126fc0 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Tue, 31 Jan 2023 12:36:38 +0200 Subject: [PATCH 3/4] doc: Add a documentation about commit conventions Signed-off-by: Donatas Abraitis --- doc/developer/workflow.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/developer/workflow.rst b/doc/developer/workflow.rst index 88ee358384..605525818b 100644 --- a/doc/developer/workflow.rst +++ b/doc/developer/workflow.rst @@ -354,6 +354,19 @@ Before merging make sure a PR has squashed the following kinds of commits: This helps to automatically generate human-readable changelog messages. +Commit Guidelines +----------------- + +There is a built-in commit linter. Basic rules: + +- Commit messages must be prefixed with the name of the changed subsystem, followed + by a colon and a space and start with an imperative verb. + + `Check `_ all + the supported subsystems. + +- Commit messages must start with a capital letter +- Commit messages must not end with a period ``.`` .. _license-for-contributions: From 2be1c4002b5301eff3e37955b87001d18a2c0d5a Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Tue, 31 Jan 2023 13:23:57 +0200 Subject: [PATCH 4/4] doc: Define why my pull request was closed Signed-off-by: Donatas Abraitis --- doc/developer/workflow.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/developer/workflow.rst b/doc/developer/workflow.rst index 605525818b..f496906101 100644 --- a/doc/developer/workflow.rst +++ b/doc/developer/workflow.rst @@ -368,6 +368,20 @@ There is a built-in commit linter. Basic rules: - Commit messages must start with a capital letter - Commit messages must not end with a period ``.`` +Why was my pull request closed? +------------------------------- + +Pull requests older than 180 days will be closed. Exceptions can be made for +pull requests that have active review comments, or that are awaiting other +dependent pull requests. Closed pull requests are easy to recreate, and little +work is lost by closing a pull request that subsequently needs to be reopened. + +We want to limit the total number of pull requests in flight to: + +- Maintain a clean project +- Remove old pull requests that would be difficult to rebase as the underlying code has changed over time +- Encourage code velocity + .. _license-for-contributions: License for Contributions