Skip to content

Commit

Permalink
TEST-#1759: Add commitlint check on pull requests (#1760)
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Petersohn <devin.petersohn@gmail.com>
  • Loading branch information
devin-petersohn authored Jul 22, 2020
1 parent 51c3803 commit 5c1dff6
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if you have questions about contributing.

<!-- Please give a short brief about these changes. -->

- [ ] commit message follows format outlined [here](https://modin.readthedocs.io/en/latest/contributing.html)
- [ ] passes `flake8 modin`
- [ ] passes `black --check modin`
- [ ] signed commit with `git commit -s` <!-- you can amend your commit with a signature via `git commit -amend -s` -->
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
name: ci
on: pull_request
jobs:
lint-commit:
name: lint (commit)
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: "10.x"
- run: npm install --save-dev @commitlint/{config-conventional,cli} commitlint-plugin-jira-rules commitlint-config-jira
- name: Add dependencies for commitlint action
run: echo "::set-env name=NODE_PATH::$GITHUB_WORKSPACE/node_modules"
- run: git remote add upstream https://github.com/modin-project/modin.git
- run: git fetch upstream
- run: npx commitlint --from upstream/master --to HEAD --verbose
lint-black:
name: lint (black)
runs-on: ubuntu-latest
Expand Down Expand Up @@ -68,7 +86,7 @@ jobs:
- run: pip install -r requirements.txt
- run: python -m pytest modin/test/test_publisher.py modin/data_management/test/test_dispatcher.py
test-all:
needs: [lint-flake8, lint-black, test-api, test-headers]
needs: [lint-commit, lint-flake8, lint-black, test-api, test-headers]
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -108,7 +126,7 @@ jobs:
if: matrix.part == 3
- run: bash <(curl -s https://codecov.io/bash)
test-windows:
needs: [lint-flake8, lint-black, test-api, test-headers]
needs: [lint-commit, lint-flake8, lint-black, test-api, test-headers]
runs-on: windows-latest
strategy:
matrix:
Expand Down Expand Up @@ -144,7 +162,7 @@ jobs:
- run: choco install codecov
- run: codecov -f .\coverage.xml -t ${{secrets.CODECOV_TOKEN}}
test-pyarrow:
needs: [lint-flake8, lint-black, test-api, test-headers]
needs: [lint-commit, lint-flake8, lint-black, test-api, test-headers]
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
10 changes: 10 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
plugins: ['commitlint-plugin-jira-rules'],
extends: ['jira'],
rules: {
"header-max-length": [2, "always", 50],
"signed-off-by": [2, "always", "Signed-off-by"],
"jira-task-id-max-length": [0, "always", 10],
"jira-task-id-project-key": [2, "always", ["FEAT", "DOCS", "FIX", "REFACTOR", "TEST"]],
}
}
24 changes: 24 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ commits and push them to GitHub.
If you've pushed your changes to GitHub already you'll need to force push your branch
after this with ``git push -f``.

Commit Message formatting
-------------------------
To ensure that all commit messages in the master branch follow a specific format, we
enforce that all commit messages must follow the following format:

.. code-block:: bash
FEAT-#9999: Add `DataFrame.rolling` functionality, to enable rolling window operations
The ``FEAT`` component represents the type of commit. This component of the commit
message can be one of the following:

* FEAT: A new feature that is added
* DOCS: Documentation improvements or updates
* FIX: A bugfix contribution
* REFACTOR: Moving or removing code without change in functionality
* TEST: Test updates or improvements

The ``#9999`` component of the commit message should be the issue number in the Modin
GitHub issue tracker: https://github.com/modin-project/modin/issues. This is important
because it links commits to their issues.

The commit message should follow a colon (:) and be descriptive and succinct.

Development Dependencies
------------------------

Expand Down

0 comments on commit 5c1dff6

Please sign in to comment.