Skip to main content

Python decorator that will automatcially create an issue on GitHub if a decorated function throws an exception

Reason this release was yanked:

old and useless

Project description

gicd

gicd is a Python decorator that will automatcially create an issue on GitHub if a decorated function throws an exception. That's it!

Requirements

  • The GitHub CLI (gh)

Usage

Decorate a function with it:

from gicd import auto_create_issue

@auto_create_issue(repo_owner="zmarffy", repo_name="cli-test-repo", exceptions=(IndexError, ValueError))
def error_prone_function():
    if input("Don't type anything; just hit enter... "):
        raise ValueError("Explosions!")
    print("All good!")

Then call the function:

error_prone_function()

In the off chance that the function raises an exception, it will create a issue in the GitHub repo specified in the decorator.

You can have it do this with all exceptions (default behavior), or, if you specify the exceptions parameter, it will only create an issue when those specific exceptions are thrown.

If you want to integrate this info your own app without having to specify the repo_owner and repo_name keyword arguments in the decorator, you can place a file with a name of your choice in a certain folder, formatted like this example:

zmarffy
cli-test-repo

This is a useful file for installers to create, then.

It would make sense for us to call that file cli-test, in this example case. You can then use the decorator with only the app_name keyword argument, set to the name of the file you created:

@auto_create_issue(app_name="cli-test", exceptions=(IndexError, ValueError))

The folder you place it in is:

OS Folder
Linux /etc/githubreporter/
Windows %PROGRAMDATA%\githubreporter\
macOS /Library/Application Support/githubreporter/

There's really not that much else to say about this tiny, somewhat humorous, tool.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gicd-1.0.3.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

gicd-1.0.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file gicd-1.0.3.tar.gz.

File metadata

  • Download URL: gicd-1.0.3.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for gicd-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b9332468bb25bcf5823c4ef2480fb6be37eb525f260bea59d5e961bcdaf166d9
MD5 4441cb21338de98041081e0a47dc673b
BLAKE2b-256 e143bc1bb03b4bad42ef2dce67bcbbcc1d82f8cc156b200fb1f5bee80b47fcc6

See more details on using hashes here.

File details

Details for the file gicd-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: gicd-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for gicd-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1f70d492beb844523b7256d67089f4a7e032ebbd88af68f55bdeea1f7da4dd39
MD5 1bc2b94ba3841239900a939660b38ee9
BLAKE2b-256 cf1b4ea1f5d734420013b4045eaf947bf1cb2e6f97b3f1fcad6d92ddaaa9d14e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page