From 974bc2e2d19af8ff2d5f03dd96779e8e4a7d6afb Mon Sep 17 00:00:00 2001 From: Guthrie Price Date: Sat, 1 Jul 2023 11:04:40 -0700 Subject: [PATCH 1/2] Add fields to make ticket simpler to resolve --- README.md | 5 ++++- issue_router/main.py | 9 +++++++-- issue_router/models.py | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3f8688b..a9dd7fa 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,15 @@ Route issues from Translator UI to Translator Services ## How to: POST to `/create_issue` with the following values: -- `url`: url where issue happened +- `title`: one line description of what happened +- `url`: NCATS UI url where the issue happened +- `arax_url`: ARAX UI url for the ars pk - `ars_pk`: pk given from ARS - `description`: a short summary of the issue - `reproduction_steps`: a list of steps one could do to reproduce the issue - `screenshots`: a list of base64 encoded images that show the issue - `type`: bug or feature request +- `submitter`: identification of the issue creator You will get back a response containing the following values: - `url`: the github url of the created issue diff --git a/issue_router/main.py b/issue_router/main.py index 27fb813..551ace6 100644 --- a/issue_router/main.py +++ b/issue_router/main.py @@ -11,7 +11,7 @@ app = FastAPI( title='Translator Issue Router', description='Post GitHub issues to Translator services.', - version='0.1.1', + version='0.1.2', contact={ 'email': 'max@covar.com', 'name': 'Max', @@ -57,12 +57,17 @@ async def create_issue(request: CreateIssueRequest): try: screenshots = upload_screenshots(request.screenshots) data = { - 'title': request.description, + 'title': {request.title}, 'body': f""" ## Type: {request.type} +## Submitter: {request.submitter} ## URL: {request.url} +## ARAX URL: {request.arax_url} ## ARS PK: {request.ars_pk} +## Description: +{request.description} + ## Steps to reproduce: {request.reproduction_steps} diff --git a/issue_router/models.py b/issue_router/models.py index 9721793..a78c443 100644 --- a/issue_router/models.py +++ b/issue_router/models.py @@ -4,7 +4,10 @@ class CreateIssueRequest(BaseModel): """Schema for a /create_issue request.""" + title: str url: str + submitter: str + arax_url: str ars_pk: str description: str reproduction_steps: str From 311a45cccda1be7ef649026394322256e240043b Mon Sep 17 00:00:00 2001 From: Guthrie Price Date: Tue, 11 Jul 2023 11:18:44 -0700 Subject: [PATCH 2/2] make submitter optional --- issue_router/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/issue_router/models.py b/issue_router/models.py index a78c443..697674c 100644 --- a/issue_router/models.py +++ b/issue_router/models.py @@ -6,7 +6,7 @@ class CreateIssueRequest(BaseModel): """Schema for a /create_issue request.""" title: str url: str - submitter: str + submitter: Optional[str] = "Anonymous" arax_url: str ars_pk: str description: str