From d11707a9916f65ea9acb0fb82dba228e713a8759 Mon Sep 17 00:00:00 2001 From: Nijanthan <6072170+nijanthanvijayakumar@users.noreply.github.com> Date: Mon, 15 Jul 2024 23:03:39 +1000 Subject: [PATCH 1/3] DOC: CONTRIBUTING.md - add details on precommit & local GitHub Actions setup Add details to `CONTRIBUTING.md` on auto-assigning issues, pre-commit installation, and GitHub Actions local setup using 'act'. * **Auto-assigning issues**: Add a section explaining auto-assigning issues on the comment 'take', referencing the configuration in `.github/workflows/assign-on-comment.yml`. * **Pre-commit installation and execution**: Add a section detailing pre-commit installation and execution, referencing the configuration in `.pre-commit-config.yaml`. * **GitHub Actions local setup using 'act'**: Add a section providing instructions for GitHub Actions local setup using 'act', referencing the configuration in `.github/workflows/ci.yml`. Include instructions for running specific jobs and handling MacBooks with M1 processors. --- CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2fbcb3d4..eeacdd37 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,10 @@ Scan through our [existing issues](https://github.com/MrPowers/quinn/issues) to You can find a list of [good first issues](https://github.com/MrPowers/quinn/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) which can help you better understand code base of the project. +### Auto-assigning issues + +We have a workflow that automatically assigns issues to users who comment 'take' on an issue. This is configured in the `.github/workflows/assign-on-comment.yml` file. + ## Contributing ### Fork the repository @@ -49,6 +53,17 @@ make install_deps To run spark tests you need to have properly configured Java. Apache Spark currently supports mainly only Java 8 (1.8). You can find an instruction on how to set up Java [here](https://www.java.com/en/download/help/download_options.html). When you are running spark tests you should have `JAVA_HOME` variable in your environment which points to the installation of Java 8. +### Pre-commit installation and execution + +We use pre-commit hooks to ensure code quality. The configuration for pre-commit hooks is in the `.pre-commit-config.yaml` file. To install pre-commit, run: +```shell +pip install pre-commit +pre-commit install +``` +To run pre-commit hooks manually, use: +```shell +pre-commit run --all-files +``` ### Running Tests @@ -57,6 +72,26 @@ You can run test as following: ```shell make test ``` + +### GitHub Actions local setup using 'act' + +You can run GitHub Actions locally using the `act` tool. The configuration for GitHub Actions is in the `.github/workflows/ci.yml` file. To install `act`, follow the instructions [here](https://github.com/nektos/act#installation). To run a specific job, use: +```shell +act -j +``` +For example, to run the `test` job, use: +```shell +act -j test +``` +If you need help with `act`, use: +```shell +act --help +``` +For MacBooks with M1 processors, you might have to add the `--container-architecture` tag: +```shell +act -j --container-architecture linux/arm64 +``` + ### Code style This project follows the [PySpark style guide](https://github.com/MrPowers/spark-style-guide/blob/main/PYSPARK_STYLE_GUIDE.md). All public functions and methods should be documented in `README.md` and also should have docstrings in `sphinx format`: From d89cd313d812c6aded93976af2cb1776176f14af Mon Sep 17 00:00:00 2001 From: Niju Vijayakumar Date: Tue, 16 Jul 2024 19:09:23 +1000 Subject: [PATCH 2/3] Update the CONTRIBUTING.md regarding auto-assign issues --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eeacdd37..4cd862d0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ You can find a list of [good first issues](https://github.com/MrPowers/quinn/iss ### Auto-assigning issues -We have a workflow that automatically assigns issues to users who comment 'take' on an issue. This is configured in the `.github/workflows/assign-on-comment.yml` file. +We have a workflow that automatically assigns issues to users who comment 'take' on an issue. This is configured in the `.github/workflows/assign-on-comment.yml` file. When a user comments `take` on the issue, a GitHub Action will be run to assign the issue to the user if it's not already assigned. ## Contributing From c05af322b62f926b40681b9122db39118a1abeb3 Mon Sep 17 00:00:00 2001 From: Niju Vijayakumar Date: Tue, 16 Jul 2024 20:22:42 +1000 Subject: [PATCH 3/3] Change pip to poetry for pre-commit installation According to the review comment, make the pip installs as poetry installs --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4cd862d0..75325696 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,8 +57,8 @@ To run spark tests you need to have properly configured Java. Apache Spark curre We use pre-commit hooks to ensure code quality. The configuration for pre-commit hooks is in the `.pre-commit-config.yaml` file. To install pre-commit, run: ```shell -pip install pre-commit -pre-commit install +poetry shell +poetry run pre-commit install ``` To run pre-commit hooks manually, use: ```shell