Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the automated release process using googleapis/release-please #261

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.10.3"
}
93 changes: 93 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. 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

### Fork the repository
Expand Down Expand Up @@ -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
poetry shell
poetry run pre-commit install
```
To run pre-commit hooks manually, use:
```shell
pre-commit run --all-files
```

### Running Tests

Expand All @@ -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 <job-name>
```
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 <job-name> --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`:
Expand Down Expand Up @@ -124,3 +159,61 @@ When you're finished with the changes, create a pull request, also known as a PR
- Don't forget to link PR to the issue if you are solving one.
- As you update your PR and apply changes, mark each conversation as resolved.
- If you run into any merge issues, checkout this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues.

### Release Process

#### How to Create a Release

- **Update `release-please-config.json`:**
- Remove `"versioning": "prerelease"`.
- Set `"prerelease": false`.

- **Ensure correct version bump:**
- If the latest release is `1.0.0` and the latest pre-release is `1.1.0-rc`, and you want to create a release with the version `1.1.0`:
- Set `"bump-minor-pre-major": true` in `release-please-config.json`.
- Change the version in `.release-please-manifest.json` from `1.1.0-rc` to `1.0.0`.

- **Avoid configurations that cause version/release gaps:**
- If `"bump-minor-pre-major": false` and `.release-please-manifest.json` is `1.1.0-rc`, it will create a major release `2.0.0`.
- If `"bump-minor-pre-major": true` and `.release-please-manifest.json` is `1.1.0-rc`, it will create a minor release `1.2.0`.

- **Key points:**
- Downgrade the version in the version file for minor releases.
- Use `"bump-minor-pre-major": true` for minor releases.
- Use `"bump-minor-pre-major": false` for major releases and set the version to the latest release version.

#### How to Create a Pre-Release

- Update the `release-please-config.json` in the root.
- Set `"prerelease"` to `true`.
- Add the line `"versioning": "prerelease"`.
- Ensure the pre-release type is set to `rc`.
- For example, if the current version is `1.0.0` and the following configs are set:
- `"bump-minor-pre-major": true`
- `"bump-patch-for-minor-pre-major": false`
- The pre-release version will be bumped to `1.1.0-rc`.
- If the configs are set as:
- `"bump-minor-pre-major": false`
- `"bump-patch-for-minor-pre-major": false`
- The pre-release version will be `2.0.0-rc`, i.e., the major version will be bumped.


### Conventional Commit Messages

- **Format**: `<type>[optional scope]: <description>`
- **Type**: Specifies the nature of the change (e.g., `feat`, `fix`, `docs`).
- **Scope**: Optional part that specifies the section of the codebase affected.
- **Description**: A brief summary of the change.
- **Body**: Optional detailed explanation of the change.
- **Footer**: Optional additional information, such as breaking changes or issue references.

#### Example

```plaintext
feat(parser): add support for new data format

Added a new parser to handle the VARIANT data format. This change includes updates to the parser module and corresponding tests.

Closes #123
```
For more information on conventional commit messages, check this site: https://www.conventionalcommits.org/en/v1.0.0/
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,41 +476,41 @@ from quinn.extensions import *

### Column Extensions

**isFalsy()**
**is_falsy()**

Returns `True` if `has_stuff` is `None` or `False`.
Returns a Column indicating whether all values in the Column are False or NULL: `True` if `has_stuff` is `None` or `False`.

```python
source_df.withColumn("is_stuff_falsy", F.col("has_stuff").isFalsy())
```

**isTruthy()**
**is_truthy()**

Returns `True` unless `has_stuff` is `None` or `False`.
Calculates a boolean expression that is the opposite of is_falsy for the given Column: `True` unless `has_stuff` is `None` or `False`.

```python
source_df.withColumn("is_stuff_truthy", F.col("has_stuff").isTruthy())
```

**isNullOrBlank()**
**is_null_or_blank()**

Returns `True` if `blah` is `null` or blank (the empty string or a string that only contains whitespace).
Returns a Boolean value which expresses whether a given column is NULL or contains only blank characters: `True` if `blah` is `null` or blank (the empty string or a string that only contains whitespace).

```python
source_df.withColumn("is_blah_null_or_blank", F.col("blah").isNullOrBlank())
```

**isNotIn()**
**is_not_in()**

Returns `True` if `fun_thing` is not included in the `bobs_hobbies` list.
To see if a value is not in a list of values: `True` if `fun_thing` is not included in the `bobs_hobbies` list.

```python
source_df.withColumn("is_not_bobs_hobby", F.col("fun_thing").isNotIn(bobs_hobbies))
```

**nullBetween()**
**null_between()**

Returns `True` if `age` is between `lower_age` and `upper_age`. If `lower_age` is populated and `upper_age` is `null`, it will return `True` if `age` is greater than or equal to `lower_age`. If `lower_age` is `null` and `upper_age` is populate, it will return `True` if `age` is lower than or equal to `upper_age`.
To see if a value is between two values in a null friendly way: `True` if `age` is between `lower_age` and `upper_age`. If `lower_age` is populated and `upper_age` is `null`, it will return `True` if `age` is greater than or equal to `lower_age`. If `lower_age` is `null` and `upper_age` is populate, it will return `True` if `age` is lower than or equal to `upper_age`.

```python
source_df.withColumn("is_between", F.col("age").nullBetween(F.col("lower_age"), F.col("upper_age")))
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions quinn/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ def is_falsy(col: Column) -> Column:


def is_truthy(col: Column) -> Column:
"""Calculates a boolean expression that is the opposite of isFalsy for the given ``Column`` col.
"""Calculates a boolean expression that is the opposite of is_falsy for the given ``Column`` col.

:param Column col: The ``Column`` to calculate the opposite of isFalsy for.
:param Column col: The ``Column`` to calculate the opposite of is_falsy for.
:returns: A ``Column`` with the results of the calculation.
:rtype: Column
"""
Expand Down
14 changes: 14 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "python",
"prerelease-type": "rc",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": true,
"versioning": "prerelease"
}
}
}
Loading