Skip to content

Commit fc6740a

Browse files
authored
Merge pull request #66 from smutyala1at/ingest-workflow
Ingest workflow
2 parents 30f696f + 55e83bd commit fc6740a

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

.github/workflows/ingest-docs.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Automate docs ingestion
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- main
8+
paths:
9+
- "apps/docs/**"
10+
11+
jobs:
12+
trigger_ingest:
13+
if: github.event.pull_request.merged == true
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Call backend ingest docs endpoint
17+
run: |
18+
echo "Triggering docs ingestion"
19+
response=$(curl --fail --silent --show-error \
20+
-X POST "${{ secrets.BACKEND_BASE_URL }}/ingest/docs" \
21+
-H "Authorization: Bearer ${{ secrets.INGEST_KEY }}" \
22+
-H "Accept: application/json")
23+
24+
echo "Ingestion response: $response"

apps/meshjs-rag/app/api/v1/ingest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# ENDPOINTS
1919
###########################################################################################################
2020

21-
@router.post("/")
21+
@router.post("/docs")
2222
async def ingest_docs(credentials: HTTPAuthorizationCredentials = Depends(security), supabase: AsyncClient = Depends(get_db_client)):
2323

2424
token = credentials.credentials
@@ -67,7 +67,7 @@ async def ingest_docs(credentials: HTTPAuthorizationCredentials = Depends(securi
6767

6868

6969
@router.post("/packages")
70-
async def ingest_packages(credentials: HTTPAuthorizationCredentials = Depends(security), supabase: AsyncClient = Depends(get_db_client)):
70+
async def ingest_mesh_packages(credentials: HTTPAuthorizationCredentials = Depends(security), supabase: AsyncClient = Depends(get_db_client)):
7171

7272
token = credentials.credentials
7373
if not token or token != os.getenv("ADMIN_KEY"):
@@ -110,7 +110,7 @@ async def ingest_packages(credentials: HTTPAuthorizationCredentials = Depends(se
110110

111111

112112
@router.post("/aiken-docs")
113-
async def ingest_packages(credentials: HTTPAuthorizationCredentials = Depends(security), supabase: AsyncClient = Depends(get_db_client)):
113+
async def ingest_aiken_docs(credentials: HTTPAuthorizationCredentials = Depends(security), supabase: AsyncClient = Depends(get_db_client)):
114114

115115
token = credentials.credentials
116116
if not token or token != os.getenv("ADMIN_KEY"):

0 commit comments

Comments
 (0)