{ "info": { "author": "Mark Davidoff", "author_email": "markddavidoff@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# pull_request_auto_labeler\nAutomatically label Github pull requests based on elements of the PR title. \nDefault configuration expects Jira style ticket code(PROJ-100) in PR title\n\nThis labeler does the following:\n - get all open Pull Requests for all the repositories for an organization/user\n - check each PR to see if it has any matching a Jira style ticket code in the title (PROJ-100)\n - apply a label to the Pull Request matching the uppercase version of the project codes from the title (PROJ)\n\n[![PyPI version](https://badge.fury.io/py/pull-request-auto-labeler.svg)](https://badge.fury.io/py/pull-request-auto-labeler)\n\n## Installation\nIf you want to run this as a cron, you can install from pypi with pip:\n`pip install pull-request-auto-labeler`\n\nBut if you're going to set this up as an AWS Lambda, you'll want the `serverless.yaml`, `serverless-requirements.txt` and `handler.py` so you might as well pull the source.\n\n## Setup\nSet the following enviornment vars:\n\n- **[Required] GITHUB_API_TOKEN:** A Github API Token which has access to read the repositories you want \nand modify \npull requests. \nIf you don't have one you see the guide [here](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)\n- **[Required] ORGANIZATION:** the name of the github organization/username that you want to check PRs for.\n- *[Optional] LABEL_EXTRACTING_REGEX:* Regex expression which will be applied on the PR title using python's\n `re.findall`. \n - This regex expression should have one matching group which returns the portion of the title which\n should be used as a label. i.e. if the regex finds PROJ-100, the matching group should be PROJ\n - Since we're using `re.findall` this can have multiple matches on the title, but each\n match must have only one group.\n - Default is `\\s*[\\[]*([a-zA-Z0-9]{2,})[-|\\s][0-9]+` which matches: `PROJ-100`, `[PROJ-100]`, `B2C-1`, `Proj 100`.\n\n## Running from command line\n`python auto_labeler.py`\n\n## Running as a Cron on AWS Lambda\n\nFor convenience I've included setup instructions to run this as a cron using aws lambda made easy by the [serverless](https://serverless.com/framework/docs/) toolkit. If you haven't used serverless, I have a getting started with serverless guide [here](https://gist.github.com/markddavidoff/0bbfcdfc29bbbdedc8b57e062987b480) \n\n### Install serverless plugins\n*serverless-python-requirements*\n\n*Its pretty annoying to add external requirements to a lambda when deploying manually. You have to build the wheels\nfor the packages on an aws linux ami and include those in the zip that you upload. Luckily, there's a serverless plugin\nto make that all super easy.*\n```\nsls plugin install -n serverless-python-requirements\n```\n\n### Setup serverless for this project\n- Copy the `serverless.yaml`, `serverless-requirements.txt` and `handler.py` files in this repo to wherever you're using this, or simply download this repo and use that as your source \n- tweak any provider params you need to to match your setup\n- Set the run frequency (update under `functions>lambdaCron>events>schedule`)\n\n### Deploy to AWS\n`sls deploy`\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/markddavidoff/pull_request_auto_labeler", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pull-request-auto-labeler", "package_url": "https://pypi.org/project/pull-request-auto-labeler/", "platform": "", "project_url": "https://pypi.org/project/pull-request-auto-labeler/", "project_urls": { "Homepage": "https://github.com/markddavidoff/pull_request_auto_labeler" }, "release_url": "https://pypi.org/project/pull-request-auto-labeler/0.12/", "requires_dist": [ "github3.py (==1.2.0)", "tqdm (==4.33.0)" ], "requires_python": "", "summary": "Automatically label Github pull requests based on elements of the PR title. Expects Jira style ticket code(PROJ-100) in PR title", "version": "0.12" }, "last_serial": 5732098, "releases": { "0.10": [ { "comment_text": "", "digests": { "md5": "8913a7949ef8d91a0250c3eea9cca00b", "sha256": "889c3048a2865d63152131b1b86d216e623492d57e5c7b027504bdc186834cc5" }, "downloads": -1, "filename": "pull_request_auto_labeler-0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "8913a7949ef8d91a0250c3eea9cca00b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4800, "upload_time": "2019-08-16T20:09:32", "url": "https://files.pythonhosted.org/packages/ef/da/7dcc178d6b10ec438d06d3162cf0252d3fae4ed72f7386e4210034bd0bd2/pull_request_auto_labeler-0.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e1a6c35216121e4543605f4e195e234", "sha256": "6008c7d26b587f0b6f35f8db07ccad3932e6f1df5670f9d9fb5321fdc04011ee" }, "downloads": -1, "filename": "pull_request_auto_labeler-0.10.tar.gz", "has_sig": false, "md5_digest": "2e1a6c35216121e4543605f4e195e234", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3305, "upload_time": "2019-08-16T20:09:34", "url": "https://files.pythonhosted.org/packages/67/af/beada714b50528461ec0e36c62e7945b1c7179f42ae582bb649d542a67bb/pull_request_auto_labeler-0.10.tar.gz" } ], "0.11": [ { "comment_text": "", "digests": { "md5": "256c883c2fe08dddad697e4c69008af9", "sha256": "4af423973c4e7a0bbf862a24bcc6de2bb87300352ce2414940282461a8a2ad79" }, "downloads": -1, "filename": "pull_request_auto_labeler-0.11-py3-none-any.whl", "has_sig": false, "md5_digest": "256c883c2fe08dddad697e4c69008af9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5300, "upload_time": "2019-08-21T00:03:53", "url": "https://files.pythonhosted.org/packages/ae/e5/5c2760855447a7ee78e1a38407030811ebcc2138950cabc89e618a553cd8/pull_request_auto_labeler-0.11-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4cc536f597f97dbf802fa023ed0d9de1", "sha256": "8042359ddae8d9a496f70ab0ca6c6b6d2ef53af09caac7ee1c8556c145101a54" }, "downloads": -1, "filename": "pull_request_auto_labeler-0.11.tar.gz", "has_sig": false, "md5_digest": "4cc536f597f97dbf802fa023ed0d9de1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3824, "upload_time": "2019-08-21T00:03:54", "url": "https://files.pythonhosted.org/packages/ea/b5/0b33511d6fa01da43de81a1763c5aca59673cb56873e004e9286dd04f59a/pull_request_auto_labeler-0.11.tar.gz" } ], "0.12": [ { "comment_text": "", "digests": { "md5": "70d3832e938e7b8159ca6bd50fa525ef", "sha256": "d4d448a7159359ab83ce6aaa7c17f380f1411a4f97aee7564ee130f7d8ad7a1c" }, "downloads": -1, "filename": "pull_request_auto_labeler-0.12-py3-none-any.whl", "has_sig": false, "md5_digest": "70d3832e938e7b8159ca6bd50fa525ef", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5309, "upload_time": "2019-08-26T17:16:00", "url": "https://files.pythonhosted.org/packages/2d/82/9ff70a597ed9e9e21419b93f05e0a2b946fa53f861f0b06b413df97a2a08/pull_request_auto_labeler-0.12-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db05de96c66b0908aaaafecfa02830ce", "sha256": "8fd37424e5ce835cbb6d4a9a74b947c883734c078d03b71996f3c31d67953a67" }, "downloads": -1, "filename": "pull_request_auto_labeler-0.12.tar.gz", "has_sig": false, "md5_digest": "db05de96c66b0908aaaafecfa02830ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3833, "upload_time": "2019-08-26T17:16:01", "url": "https://files.pythonhosted.org/packages/99/24/79b946e820cf84972a050e816ac146ac0fabe835a1d40a3999649adeef67/pull_request_auto_labeler-0.12.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "489bc951b776b5f32837b9a01087d7aa", "sha256": "a86ed3300ce41ac03ea1f637adfca2dbc244f044d235c1c2d632205f4130351f" }, "downloads": -1, "filename": "pull_request_auto_labeler-0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "489bc951b776b5f32837b9a01087d7aa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4784, "upload_time": "2019-08-16T20:04:23", "url": "https://files.pythonhosted.org/packages/81/56/f582667b274a72a7853a6cb85bc24fe0b44e9f5f44db356fad460eab55b1/pull_request_auto_labeler-0.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3422fdd9ef07e932ce5f92165df1c570", "sha256": "63fa34cdb4f99916b0cd0d134b2b059b9d4d2029294431f8d7d1187fba6e6478" }, "downloads": -1, "filename": "pull_request_auto_labeler-0.9.tar.gz", "has_sig": false, "md5_digest": "3422fdd9ef07e932ce5f92165df1c570", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3344, "upload_time": "2019-08-16T20:04:25", "url": "https://files.pythonhosted.org/packages/24/82/739dc4a7093a49de4b07db366b3015196d77d4e70ceb2d177a01d92e0177/pull_request_auto_labeler-0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "70d3832e938e7b8159ca6bd50fa525ef", "sha256": "d4d448a7159359ab83ce6aaa7c17f380f1411a4f97aee7564ee130f7d8ad7a1c" }, "downloads": -1, "filename": "pull_request_auto_labeler-0.12-py3-none-any.whl", "has_sig": false, "md5_digest": "70d3832e938e7b8159ca6bd50fa525ef", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5309, "upload_time": "2019-08-26T17:16:00", "url": "https://files.pythonhosted.org/packages/2d/82/9ff70a597ed9e9e21419b93f05e0a2b946fa53f861f0b06b413df97a2a08/pull_request_auto_labeler-0.12-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db05de96c66b0908aaaafecfa02830ce", "sha256": "8fd37424e5ce835cbb6d4a9a74b947c883734c078d03b71996f3c31d67953a67" }, "downloads": -1, "filename": "pull_request_auto_labeler-0.12.tar.gz", "has_sig": false, "md5_digest": "db05de96c66b0908aaaafecfa02830ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3833, "upload_time": "2019-08-26T17:16:01", "url": "https://files.pythonhosted.org/packages/99/24/79b946e820cf84972a050e816ac146ac0fabe835a1d40a3999649adeef67/pull_request_auto_labeler-0.12.tar.gz" } ] }