Skip to content

Commit

Permalink
feat: add openapi compatibility checker (#2016)
Browse files Browse the repository at this point in the history
Co-authored-by: Shubham Naik <[email protected]>
  • Loading branch information
4shub and Shubham Naik authored Nov 7, 2024
1 parent b2dd1ea commit 85e5fe3
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/letta-web-openapi-saftey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Letta Web OpenAPI Compatibility Checker"


on:
push:
branches: [ main ]
pull_request:
branches: [ main ]


jobs:
validate-openapi:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: "3.12"
poetry-version: "1.8.2"
install-args: "-E dev"
- name: Checkout letta web
uses: actions/checkout@v4
with:
repository: letta-ai/letta-web
token: ${{ secrets.PULLER_TOKEN }}
path: letta-web
- name: Run OpenAPI schema generation
run: |
bash ./letta/server/generate_openapi_schema.sh
- name: Setup letta-web
working-directory: letta-web
run: npm ci
- name: Copy OpenAPI schema
working-directory: .
run: cp openapi_letta.json letta-web/libs/letta-agents-api/letta-agents-openapi.json
- name: Validate OpenAPI schema
working-directory: letta-web
run: |
npm run agents-api:generate
npm run type-check
76 changes: 73 additions & 3 deletions .github/workflows/letta-web-safety.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,76 @@ on:


jobs:
check-letta-web-compatibility:
uses: letta-ai/letta-compatibility-workflows/.github/workflows/letta-web-compatibility-tester.yml@main
secrets: inherit
cypress-run:
runs-on: ubuntu-latest
environment: Deployment
# Runs tests in parallel with matrix strategy https://docs.cypress.io/guides/guides/parallelization
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
# Also see warning here https://github.com/cypress-io/github-action#parallel
strategy:
fail-fast: false # https://github.com/cypress-io/github-action/issues/48
matrix:
containers: [ 1 ]
services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres
ports:
- 5433:5432
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout letta web
uses: actions/checkout@v4
with:
repository: letta-ai/letta-web
token: ${{ secrets.PULLER_TOKEN }}
path: letta-web
- name: Turn on Letta agents
env:
LETTA_PG_DB: letta
LETTA_PG_USER: letta
LETTA_PG_PASSWORD: letta
LETTA_PG_PORT: 8888
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: docker compose -f dev-compose.yaml up --build -d
- name: Cypress run
uses: cypress-io/github-action@v6
with:
working-directory: letta-web
build: npm run build:e2e
start: npm run start:e2e
project: apps/letta
wait-on: 'http://localhost:3000' # Waits for above
record: false
parallel: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_PROJECT_KEY: 38nemh
DATABASE_URL: postgres://postgres:postgres@localhost:5433/postgres
REDIS_HOST: localhost
REDIS_PORT: 6379
CYPRESS_GOOGLE_CLIENT_ID: ${{ secrets.CYPRESS_GOOGLE_CLIENT_ID }}
CYPRESS_GOOGLE_CLIENT_SECRET: ${{ secrets.CYPRESS_GOOGLE_CLIENT_SECRET }}
CYPRESS_GOOGLE_REFRESH_TOKEN: ${{ secrets.CYPRESS_GOOGLE_REFRESH_TOKEN }}
LETTA_AGENTS_ENDPOINT: http://localhost:8283
NEXT_PUBLIC_CURRENT_HOST: http://localhost:3000
IS_CYPRESS_RUN: yes
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

0 comments on commit 85e5fe3

Please sign in to comment.