GitXplorerGitXplorer
T

algorithms-keeper

public
164 stars
54 forks
8 issues

Commits

List of commits on branch master.
Verified
dbe6a531b71f8c29877df4dac12f124203db27d7

build(deps-dev): bump pytest-asyncio from 0.21.0 to 0.21.1 (#182)

ddependabot[bot] committed 2 years ago
Verified
7981ed01e5277d7be5d6630b398fdbf4a52c2471

build(deps): bump sentry-sdk from 1.27.1 to 1.28.0 (#181)

ddependabot[bot] committed 2 years ago
Verified
2d32aa90d8a84173f309041c197cf03ed3d0c16a

build(deps): bump sentry-sdk from 1.27.0 to 1.27.1 (#180)

ddependabot[bot] committed 2 years ago
Verified
0eac1dd96e29ad5e3b633809d3ae577b1c2fa494

build(deps): bump sentry-sdk from 1.26.0 to 1.27.0 (#179)

ddependabot[bot] committed 2 years ago
Verified
6aa8afba9c4868b08f4f6aeab51e6a852f8c1eb0

build(deps-dev): bump pytest from 7.3.2 to 7.4.0 (#178)

ddependabot[bot] committed 2 years ago
Verified
1699eaa1743f250a48a858ab905e48aa5ae0b142

build(deps): bump sentry-sdk from 1.25.1 to 1.26.0 (#177)

ddependabot[bot] committed 2 years ago

README

The README file for this repository.

algorithms-keeper

CI codecov code style: black Checked with mypy

A bot for TheAlgorithms/Python repository. This bot is based on this tutorial and also inspired by the ones working for the CPython repository which are miss-islington, bedevere and the-knights-who-say-ni. This bot is basically a GitHub app which can be installed in any repository using this link.

NOTE: This bot is highly configured for TheAlgorithms/Python repository. DO NOT INSTALL the bot without reading what it actually does.

What the bot does:

Greet the user for installing the app

Open an issue with the message greeting the user who either installed the app or added a new repository to the installed app and then close the issue.

Add or remove label(s) to pull requests

  • To indicate that some tests are failing for this pull request if it is not present and remove it when all the tests are passing. It does nothing if the tests are already passing. NOTE: This check will be skipped if the pull request is in draft mode.
  • To indicate the stage the pull request is currently at. This is a cycle of two labels which indicates the two stages: The pull request requires a review/re-review, or a maintainer has requested changes for the pull request.
  • To indicate whether the pull request contains merge conflicts or not.

The pull request stages can be best described in a graphviz diagram whose code is in the pull requests module.

Close invalid pull requests

A pull request is considered invalid if:

  • It doesn't contain any description.
  • The user has not ticked any of the checkboxes in the provided pull request template.
  • The file extension is invalid. For now only PRs with extensionless files are closed.

NOTE: These checks will be skipped for any member or owner of the organization and also for the pull request which is in draft mode.

Close additional pull requests by user

A user will be allowed a fix number of pull requests at a time which will be indicated by the MAX_PR_BY_USER constant. This is done to avoid spam pull requests. This can be disabled by updating the constant value to 0: MAX_PR_BY_USER = 0.

NOTE: These checks will be skipped for any member or owner of the organization and also for the pull request which is in draft mode.

Check all Python files in a pull request

All the Python files will be checked for tests [doctest/unittest/pytest], type hints and descriptive class/function/parameter names. Labels will be added and/or removed according to the latest commit in a pull request. The bot will post the review with all the details regarding the missing requirements.

NOTE: These checks will be skipped if the pull request is in draft mode and if the pull request is invalid.

Commands

Some actions of the bot can be triggered using commands:

  • @algorithms-keeper review to trigger the checks for only added pull request files.
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command only modify the labels accordingly.

NOTE: Commands are in BETA and valid only if it is commented on a pull request and only by either a member or owner of the organization.

Logging

Logging is done using the standard library logging module. All the API calls made by the bot are being logged at INFO level and aiohttp.log.access_logger is logging the POST requests made by GitHub for delivering the payload. Other minor events relevant to the repository is also being logged along with using the using Sentry. The logs can be viewed best using the following command (requires Heroku CLI):

heroku logs -a algorithms-keeper -t