From 3bfde45e7096dfe81ac47349dfdc579d4f9ac80f Mon Sep 17 00:00:00 2001 From: Vedant Khairnar Date: Thu, 23 May 2024 19:39:38 +0530 Subject: [PATCH 1/8] Initial commit --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..718f352 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# DMP-CMS-Backend-API \ No newline at end of file From 4cdd152ab8895231978169ad648364c848d439c6 Mon Sep 17 00:00:00 2001 From: Karan Trehan Date: Tue, 2 Jul 2024 13:14:52 +0530 Subject: [PATCH 2/8] Update Dockerfile for prod deployment --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 53f495c..f841f72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,12 +11,12 @@ COPY . /app RUN pip install --no-cache-dir -r requirements.txt # Make port 5000 available to the world outside this container -EXPOSE 5000 +EXPOSE 7000 # Define environment variable ENV FLASK_APP=wsgi.py ENV FLASK_RUN_HOST=0.0.0.0 # Run the application -CMD ["flask", "run"] +CMD ["flask", "run", "--host=0.0.0.0", "--port=7000"] From dbf06a4a0e0b1334747c1810f2bc37113760db88 Mon Sep 17 00:00:00 2001 From: Karan Trehan Date: Tue, 2 Jul 2024 13:15:45 +0530 Subject: [PATCH 3/8] Update docker-compose.yml for prod deployment --- docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5d41718..a8bf2ee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,8 +4,9 @@ services: web: build: . ports: - - "5000:5000" + - "7000:7000" environment: FLASK_ENV: ${FLASK_ENV:-development} SUPABASE_URL: ${SUPABASE_URL} SUPABASE_KEY: ${SUPABASE_KEY} + SECRET_KEY: ${SECRET_KEY} From bb7be92af75566328db096f9ab95c5183a8ad03a Mon Sep 17 00:00:00 2001 From: jaanbaaz Date: Mon, 5 Aug 2024 11:44:12 +0530 Subject: [PATCH 4/8] multi-repo feature added --- v2_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2_app.py b/v2_app.py index cd337b2..86929bc 100644 --- a/v2_app.py +++ b/v2_app.py @@ -19,7 +19,7 @@ def get_issues_by_owner_id_v2(owner, issue): url = f"https://github.com/{owner}" # import pdb;pdb.set_trace() - actual_owner = SUPABASE_DB.client.table('dmp_orgs').select('id','name','repo_owner').like('name',owner).execute().data + actual_owner = SUPABASE_DB.client.table('dmp_issues').select('id','name','repo_owner').like('name',owner).execute().data repo_owner =actual_owner[0]['repo_owner'] if actual_owner else "" #create url with repo owner url = f"https://github.com/{repo_owner}" if repo_owner else None From aa48f2ddeb94ffa72f78a7f1a4f4f3992356bec6 Mon Sep 17 00:00:00 2001 From: jaanbaaz Date: Wed, 21 Aug 2024 13:30:42 +0530 Subject: [PATCH 5/8] multiple repo changes --- v2_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2_app.py b/v2_app.py index 86929bc..0e7a967 100644 --- a/v2_app.py +++ b/v2_app.py @@ -19,7 +19,7 @@ def get_issues_by_owner_id_v2(owner, issue): url = f"https://github.com/{owner}" # import pdb;pdb.set_trace() - actual_owner = SUPABASE_DB.client.table('dmp_issues').select('id','name','repo_owner').like('name',owner).execute().data + actual_owner = SUPABASE_DB.client.table('dmp_issues').select('id','repo_owner').ilike('repo_owner', f'%{owner}%').execute().data repo_owner =actual_owner[0]['repo_owner'] if actual_owner else "" #create url with repo owner url = f"https://github.com/{repo_owner}" if repo_owner else None From e0b0e954b6efb47996d9e1dbb91c893b1c86c066 Mon Sep 17 00:00:00 2001 From: jaanbaaz Date: Wed, 21 Aug 2024 13:43:44 +0530 Subject: [PATCH 6/8] Merge branch 'dev' of github.com:Code4GovTech/DMP-CMS-Backend-API into fix/multi-repo --- Dockerfile | 4 ++-- docker-compose.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index f841f72..53f495c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,12 +11,12 @@ COPY . /app RUN pip install --no-cache-dir -r requirements.txt # Make port 5000 available to the world outside this container -EXPOSE 7000 +EXPOSE 5000 # Define environment variable ENV FLASK_APP=wsgi.py ENV FLASK_RUN_HOST=0.0.0.0 # Run the application -CMD ["flask", "run", "--host=0.0.0.0", "--port=7000"] +CMD ["flask", "run"] diff --git a/docker-compose.yml b/docker-compose.yml index a8bf2ee..f3316a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: web: build: . ports: - - "7000:7000" + - "5000:5000" environment: FLASK_ENV: ${FLASK_ENV:-development} SUPABASE_URL: ${SUPABASE_URL} From 5da60ee4cb581e7a65680b7c8f544d6bfb09eddf Mon Sep 17 00:00:00 2001 From: jaanbaaz Date: Wed, 21 Aug 2024 13:44:33 +0530 Subject: [PATCH 7/8] Merge branch 'dev' of github.com:Code4GovTech/DMP-CMS-Backend-API into fix/multi-repo --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index f3316a2..5d41718 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,4 +9,3 @@ services: FLASK_ENV: ${FLASK_ENV:-development} SUPABASE_URL: ${SUPABASE_URL} SUPABASE_KEY: ${SUPABASE_KEY} - SECRET_KEY: ${SECRET_KEY} From 04788cba29a29c1c4a18b513cf101f9834791ba2 Mon Sep 17 00:00:00 2001 From: jaanbaaz Date: Wed, 21 Aug 2024 13:46:34 +0530 Subject: [PATCH 8/8] Merge branch 'dev' of github.com:Code4GovTech/DMP-CMS-Backend-API into fix/multi-repo --- query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query.py b/query.py index 862cfe3..564c202 100644 --- a/query.py +++ b/query.py @@ -42,7 +42,7 @@ def get_issue_owner(name): return response def get_actual_owner_query(owner): - results = DmpIssue.query.filter(DmpIssue.name.like(f'%{owner}%')).all() + results = DmpIssue.query.filter(DmpIssue.repo_owner.like(f'%{owner}%')).all() results = [val.to_dict() for val in results] return results