Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Commit

Permalink
pre-commit run --all-files
Browse files Browse the repository at this point in the history
  • Loading branch information
jpopelka committed Dec 18, 2020
1 parent 5fc22bb commit bd5b576
Show file tree
Hide file tree
Showing 49 changed files with 1,018 additions and 745 deletions.
1 change: 0 additions & 1 deletion .bandit
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[bandit]
skips: B101,B101,B311,B404,B603,B606,B607,C0103
exclude: /docs

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ __pycache__/
.DS_Store

dump.rdb


38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# HOWTO: https://pre-commit.com/#usage
# pip3 install pre-commit
# pre-commit install -t pre-commit -t pre-push

repos:
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
hooks:
- id: pyupgrade
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
- id: prettier
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-merge-conflict
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
args:
- --max-line-length=100
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.790
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
sudo: required
language: bash
services:
- docker
- docker
before_install:
- make image-test
- make image-test
script:
- make test-in-container
- make test-in-container
env:
global:
- secure: Xbg+VWaPf02GSNbkg1kpQer5/i5sc/t5ntIRbKtL4BUkXpAFOHn7Ee88YRl8p6Ob+7qRuDNfzkaxSsW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DGLnh+iLlDZj67lWNd6itee4E7sm+38Uac1oRa4dM+h6jS5lJ+ceO+sezNYR8qVz81XLOlE6h0O8+Um1/QqTro7J31DRewbxv1I0R/ut4by9ANNts75JGuEbPF2CaxaK5rTX/kORTCq0ngEOhpY3Lphe1JNfkqdPmnIBwooKcG+HQkjXRG0MxOVT/SHycvt25FyGP7KkLpxJPFx4OMg59k/k0I487EVwzxXIVuIW0aEFsneTqdhTRMRc4Vq5ADoWAd9DQHP78tGUwppjZ3P3vEVv3ArPPmpNxLfP7igBa0CSULm1dEr3I8A6i5YT1gtPiSYfcQcd/my6RGvyWDzAi3vhAEJfA9DbQHreMEHRCLnYwgOVelRuyti8tzSXi3RaiW9KE6JI599oIgNhxmA2ezhIqNH3pFqMehPtpvN0hsXv1Ek5XLcD3CRokdXfE4DsJiV9eDem0sEnsh5o9FbnR26WvMT7qYJxuVigBZDhkflrMrgbpdlGk=
116 changes: 62 additions & 54 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,101 +1,109 @@
# 0.7.1

* Few bug fixes and base image update.
- Few bug fixes and base image update.

# 0.7.0

**We would like to thank all GSoC applicants for their contribution to this project during the application period!**

## Breaking changes

* **Releasing to Fedora is now deprecated.** We removed Fedora functionality in favor of the new project [packit](https://packit.dev/).
- **Releasing to Fedora is now deprecated.** We removed Fedora functionality in favor of the new project [packit](https://packit.dev/).

## New features

* Dry-run mode! Now you can try release process without making actual changes. Thanks to @Aniket-Pradhan.
* You can now use new issue titles, when you are making new release:
* `new major release`
* `new minor release`
* `new patch release` , Thanks to @shresthagrawal.
* Release bot can now handle Github webhooks. Thanks to @marusinm.
* You can now specify name of your PyPI project in configuration, in case it is different than repo name. Thanks to @Elias999.
* Releasing to PyPI is now *optional*. Thanks to @Aniket-Pradhan.
* You can explicitly specify `clone_url` in Release bot configuration file. Thanks to @Z0Marlin.
* Support also for `version` variable (besides the `__version__`). Thanks to @Toaster192.
- Dry-run mode! Now you can try release process without making actual changes. Thanks to @Aniket-Pradhan.
- You can now use new issue titles, when you are making new release:
- `new major release`
- `new minor release`
- `new patch release` , Thanks to @shresthagrawal.
- Release bot can now handle Github webhooks. Thanks to @marusinm.
- You can now specify name of your PyPI project in configuration, in case it is different than repo name. Thanks to @Elias999.
- Releasing to PyPI is now _optional_. Thanks to @Aniket-Pradhan.
- You can explicitly specify `clone_url` in Release bot configuration file. Thanks to @Z0Marlin.
- Support also for `version` variable (besides the `__version__`). Thanks to @Toaster192.

## Fixes and docs
* Tutorial on how to make your first release with release-bot locally. Thanks to @marusinm.
* Contribution guide is now more newcomers-friendly. Thanks to @Z0Marlin.
* Support for installing release-bot from arch user repository. Thanks to @Aniket-Pradhan.
* Release-bot now checks for tag instead of release name, when checking latest release. Thanks to @shresthagrawal.

- Tutorial on how to make your first release with release-bot locally. Thanks to @marusinm.
- Contribution guide is now more newcomers-friendly. Thanks to @Z0Marlin.
- Support for installing release-bot from arch user repository. Thanks to @Aniket-Pradhan.
- Release-bot now checks for tag instead of release name, when checking latest release. Thanks to @shresthagrawal.

# 0.6.1

* Bot ignores 'python_versions' in release-conf and builds an sdist and a py3 wheel.
- Bot ignores 'python_versions' in release-conf and builds an sdist and a py3 wheel.

# 0.6.0

* Jenkinsfile and Contribution guide have been added.
* Metadata from setup.py have been moved to setup.cfg.
* README.md has been updated.
* A way to authenticate as a Github App has been added.
* Bot works in the upstream git repo instead of downloading zip.
* Bot adds a link to Bodhi (to Github comment) when fedora builds are successful.
* Base images have been bumped to F29.
* Some tests have been fixed.
- Jenkinsfile and Contribution guide have been added.
- Metadata from setup.py have been moved to setup.cfg.
- README.md has been updated.
- A way to authenticate as a Github App has been added.
- Bot works in the upstream git repo instead of downloading zip.
- Bot adds a link to Bodhi (to Github comment) when fedora builds are successful.
- Base images have been bumped to F29.
- Some tests have been fixed.

# 0.5.0

* You can specify github labels in release-conf.yaml configuration file
- You can specify github labels in release-conf.yaml configuration file
which should be applied on a pull request created by release bot.
* Documentation is updated and is more clear now.
* The bot no longer tries to release old versions again.
- Documentation is updated and is more clear now.
- The bot no longer tries to release old versions again.

# 0.4.1

* Fix wrong PR description
* Fix pytest fixture warnings
* Fix git credentials for Fedora releasing
- Fix wrong PR description
- Fix pytest fixture warnings
- Fix git credentials for Fedora releasing

# 0.4.0

* Allow self-releasing on issue
* Fix code style issues
* Add more tests on github & bot itself
* Ability to do initial release + fixes
* Fix minor issues from code review, change how release-conf is loaded
* Fix code style issues
* Add ability to make PRs with version change based on release issue
* Update config files from kwaciaren
* Use bandit/pylintrc file from kwaciaren
* [.s2i/bin/run] Don't use --keytab if there's no such file
* Use absolute imports
- Allow self-releasing on issue
- Fix code style issues
- Add more tests on github & bot itself
- Ability to do initial release + fixes
- Fix minor issues from code review, change how release-conf is loaded
- Fix code style issues
- Add ability to make PRs with version change based on release issue
- Update config files from kwaciaren
- Use bandit/pylintrc file from kwaciaren
- [.s2i/bin/run] Don't use --keytab if there's no such file
- Use absolute imports

# 0.3.8
* Fedora-related bug fixes

- Fedora-related bug fixes

# 0.3.7
* Fix KeyError

- Fix KeyError

# 0.3.6
* Fix KeyError

- Fix KeyError

# 0.3.5
* Request/Limit openshift resources

- Request/Limit openshift resources

# 0.3.2
* Iterate over PRs in descending order
* Use nss_wrapper to create/use custom passwd file
* Add status comments to PR

- Iterate over PRs in descending order
- Use nss_wrapper to create/use custom passwd file
- Add status comments to PR

# 0.3.0
* Structure code into classes
* bug fixes, bug fixes, bug fixes

- Structure code into classes
- bug fixes, bug fixes, bug fixes

# 0.1.1
* Fix changelog parsing
* Bump up version because of PyPi

- Fix changelog parsing
- Bump up version because of PyPi

# 0.1.0

* Initial release.
- Initial release.
51 changes: 25 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Before creating bug reports, please check a [list of known issues](https://githu
If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/user-cont/release-bot/issues/new).
Be sure to include a **descriptive title and a clear description**. Ideally, please provide:

* version of release-bot you are using (`pip freeze | grep release-bot`)
- version of release-bot you are using (`pip freeze | grep release-bot`)

* the command you executed with output
- the command you executed with output

If possible, add a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.

Expand All @@ -35,9 +35,9 @@ If you would like to contribute code to the `release-bot` project, this section

### Is this your first contribution?

Never contributed to an open-source project before? No problem! We're excited that you are considering `release-bot` for your first contribution!
Never contributed to an open-source project before? No problem! We're excited that you are considering `release-bot` for your first contribution!

Please take a few minutes to read GitHub's guide on [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/). It's a quick read, and it's a great way to introduce yourself to how things work behind the scenes in open-source projects.
Please take a few minutes to read GitHub's guide on [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/). It's a quick read, and it's a great way to introduce yourself to how things work behind the scenes in open-source projects.

### Dependencies

Expand All @@ -51,14 +51,13 @@ We are maintaining whole project documentation inside [README.md](/README.md).

When you are contributing to changelog, please follow these suggestions:

* The changelog is meant to be read by everyone. Imagine that an average user
- The changelog is meant to be read by everyone. Imagine that an average user
will read it and should understand the changes. `docker_image.mount() via .get_archive()` is
not very descriptive. `DockerImage class now utilizes get_archive() from
docker-py for its mount() method.` is a more friendly description.
* Every line should be a complete sentence. Either tell what is the change that the tool is doing or describe it precisely:
* Bad: `Use search method in label regex`
* Good: `Colin now uses search method when...`
* And finally, with the changelogs we are essentially selling our projects:
not very descriptive. `DockerImage class now utilizes get_archive() from docker-py for its mount() method.` is a more friendly description.
- Every line should be a complete sentence. Either tell what is the change that the tool is doing or describe it precisely:
- Bad: `Use search method in label regex`
- Good: `Colin now uses search method when...`
- And finally, with the changelogs we are essentially selling our projects:
think about a situation that you met someone at a conference and you are
trying to convince the person to use the project and that the changelog
should help with that.
Expand All @@ -74,18 +73,18 @@ When you are contributing to changelog, please follow these suggestions:

### Requirements for Pull Requests

* Please create Pull Requests against the `master` branch.
* Please make sure that your code complies with [PEP8](https://www.python.org/dev/peps/pep-0008/).
* One line should not contain more than 100 characters.
* Make sure that new code is covered by a test case (new or existing one).
* We don't like [spaghetti code](https://en.wikipedia.org/wiki/Spaghetti_code).
* All the tests in the test-suite have to pass.
- Please create Pull Requests against the `master` branch.
- Please make sure that your code complies with [PEP8](https://www.python.org/dev/peps/pep-0008/).
- One line should not contain more than 100 characters.
- Make sure that new code is covered by a test case (new or existing one).
- We don't like [spaghetti code](https://en.wikipedia.org/wiki/Spaghetti_code).
- All the tests in the test-suite have to pass.

## Development Environment

### Requirements

Currently, the development environment can be set up on __Linux__, and __MacOS__.
Currently, the development environment can be set up on **Linux**, and **MacOS**.
We support two methods for setting up the environment.

1. Docker method (using containers)
Expand Down Expand Up @@ -114,7 +113,7 @@ make image-test

It builds a Docker image using your local repository, with release-bot installed in it. This may take some time when building for the first time.

To check if the build was successful, run `docker images`. If the build was successful, an image named `release-bot-tests` will be present in the output list.
To check if the build was successful, run `docker images`. If the build was successful, an image named `release-bot-tests` will be present in the output list.

#### Testing new changes

Expand All @@ -124,7 +123,7 @@ To test any new changes you made in the code, first build a test image using the
docker run -it -v ${PWD}:/home/test-user/app/ -v path/to/conf.yaml:/home/test-user/conf.yaml -e PYTHONPATH=/home/test-user/app release-bot-tests /bin/bash
```

* `path/to/conf.yaml` is the absolute path of the configuration file in your machine.
- `path/to/conf.yaml` is the absolute path of the configuration file in your machine.

A terminal in the container will open up. Now run the bot using the command

Expand All @@ -149,7 +148,7 @@ You can also run specific tests by setting `TEST_TARGET` variable equal to test
make test-in-container TEST_TARGET=tests/test_github.py
```

__Note:__ You may need to specify your token in the above command depending on test you are running. We recommend to specify it with every test.
**Note:** You may need to specify your token in the above command depending on test you are running. We recommend to specify it with every test.

### Direct Installation

Expand Down Expand Up @@ -181,11 +180,11 @@ We have an integration test suite in release bot which creates a new project on
github and tries the functionality in there. It may easily happen that a bunch
of test repositories will be left out in your account:

* We have a script which is able to delete all of these, please check
`./hack/clean-testing-github-repos`. We suggest reading out the sources
first before using it.
* The prerequisite for both, the integration tests and the script mentioned
above, is to have a token which is able to delete projects.
- We have a script which is able to delete all of these, please check
`./hack/clean-testing-github-repos`. We suggest reading out the sources
first before using it.
- The prerequisite for both, the integration tests and the script mentioned
above, is to have a token which is able to delete projects.

Thank you!

Expand Down
1 change: 0 additions & 1 deletion DCO
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ By making a contribution to this project, I certify that:
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Loading

0 comments on commit bd5b576

Please sign in to comment.