Skip to content

Commit

Permalink
Merge branch 'master' into ENG-2508
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar-composio authored Dec 13, 2024
2 parents 66c8c8b + 518695f commit 3ac09d8
Show file tree
Hide file tree
Showing 367 changed files with 38,834 additions and 15,817 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/python @angrybayblade @tushar-composio
/js @himanshu-dixit @plxity
88 changes: 60 additions & 28 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ jobs:
os: [ubuntu-latest]
python-version: ["3.10"]
timeout-minutes: 10
concurrency:
group: 'test:lock-check:${{ github.ref }}'
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@master
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Pipenv install requirements and check it can be locked
Expand All @@ -42,18 +45,17 @@ jobs:
os: [ubuntu-latest]
python-version: ["3.10"]
timeout-minutes: 30
concurrency:
group: 'test:linter_checks:${{ github.ref }}'
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@master
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install --user --upgrade setuptools
pip install tox==4.6.3
pip install 'tox>=4.21,<5' tox-uv
- name: Code style check
run: |
tox -e black-diff
Expand All @@ -69,58 +71,92 @@ jobs:
run:
working-directory: ./python
continue-on-error: False
needs:
- lock_check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11"]
timeout-minutes: 20
concurrency:
group: 'test:common:${{ matrix.python-version }}:${{ github.ref }}'
cancel-in-progress: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@master
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install --user --upgrade setuptools
pip install tox==4.6.3
pip install 'tox>=4.21,<5' tox-uv
- name: Unittests
run: |
export COMPOSIO_API_KEY=${{ secrets.COMPOSIO_API_KEY_STAGING }}
export COMPOSIO_BASE_URL=${{ secrets.COMPOSIO_BASE_URL_STAGING }}
export FLY_API_TOKEN=${{ secrets.FLY_API_TOKEN }}
export E2B_API_KEY=${{ secrets.E2B_API_KEY_STAGING }}
tox -e test -- -m 'not e2e'
tox -e test -- -m 'not e2e and not swe'
- if: matrix.python-version == '3.10'
name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

swe:
defaults:
run:
working-directory: ./python
continue-on-error: False
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
timeout-minutes: 20
concurrency:
group: 'test:swe:${{ matrix.python-version }}:${{ github.ref }}'
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install 'tox>=4.21,<5' tox-uv
- name: Unittests
run: |
export COMPOSIO_API_KEY=${{ secrets.COMPOSIO_API_KEY_STAGING }}
export COMPOSIO_BASE_URL=${{ secrets.COMPOSIO_BASE_URL_STAGING }}
export FLY_API_TOKEN=${{ secrets.FLY_API_TOKEN }}
export E2B_API_KEY=${{ secrets.E2B_API_KEY_STAGING }}
tox -e test -- -m 'swe'
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

e2e:
defaults:
run:
working-directory: ./python
continue-on-error: False
needs:
- lock_check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
Expand All @@ -136,16 +172,12 @@ jobs:
sudo systemctl start docker
sudo systemctl enable docker
- uses: actions/setup-python@master
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install --user --upgrade setuptools
pip install tox==4.6.3
pip install 'tox>=4.21,<5' tox-uv
- name: Build docker images
run: |
cd dockerfiles
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ jobs:
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run Tests
Expand All @@ -85,17 +85,12 @@ jobs:
COMPOSIO_BASE_URL: ${{ inputs.base_url || secrets.COMPOSIO_BASE_URL || 'https://backend.composio.dev/api' }}
# TODO(@kaavee): Add Anthropic API key
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
python -m pip install --upgrade pip pipenv pytest
python -m pip install plugins/${{matrix.package}}
python -m pip install '.[all]'
python -m pip install 'numpy<2' python-dotenv
python -m pip install unstructured
COMPOSIO_BASE_URL=${{ env.COMPOSIO_BASE_URL }} COMPOSIO_API_KEY=${{ env.COMPOSIO_API_KEY }} COMPOSIO_LOGGING_LEVEL='debug' composio apps update
COMPOSIO_BASE_URL=${{ env.COMPOSIO_BASE_URL }} COMPOSIO_API_KEY=${{ env.COMPOSIO_API_KEY }} COMPOSIO_LOGGING_LEVEL='debug' PLUGIN_TO_TEST=${{matrix.package}} CI=false pytest -vv tests/test_example.py
COMPOSIO_BASE_URL=${{ env.COMPOSIO_BASE_URL }} COMPOSIO_API_KEY=${{ env.COMPOSIO_API_KEY }} COMPOSIO_LOGGING_LEVEL='debug' PLUGIN_TO_TEST=${{matrix.package}} CI=false pytest -vv tests/test_load_tools.py
- name: Slack Notification on Failure
Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/examples_js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: JS Example Tests

on:
workflow_call:
inputs:
working-directory:
required: false
type: string
api_key:
required: false
type: string
base_url:
required: false
type: string
author:
required: false
type: string
commit_message:
required: false
type: string
dont_notify:
required: false
type: boolean
workflow_dispatch:
inputs:
working-directory:
required: false
type: string
api_key:
required: false
type: string
base_url:
required: false
type: string
author:
required: false
type: string
commit_message:
required: false
type: string

jobs:
run-js-tests:
name: Run JS Example Tests
defaults:
run:
working-directory: ${{ inputs.working-directory }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: ["18"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
run: npm install -g pnpm

- name: Install Dependencies
run: |
pnpm install @ai-sdk/openai ai composio-core dotenv zod
- name: Run Tests
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
JULEP_API_KEY: ${{secrets.JULEP_API_KEY}}
JULEP_API_URL: ${{secrets.JULEP_API_URL}}
LISTENNOTES_API_KEY: ${{secrets.LISTENNOTES_API_KEY}}
COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY_RELEASE }}
COMPOSIO_BASE_URL: 'https://backend.composio.dev'
run: |
pnpm exec jest tests/test_examples.test.js
- name: Slack Notification on Failure
if: ${{ failure() && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'release') && !contains(github.event.head_commit.message, 'Release') && !inputs.dont_notify }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_TECH_WEBHOOK }}
SLACK_TITLE: "JS Example Tests Failed"
SLACK_MSG_AUTHOR: ${{ inputs.author || github.actor }}
SLACK_MESSAGE: "<@Apoorv> <@kaavee> ${{ inputs.commit_message || github.event.head_commit.message }}"
SLACK_LINK_NAMES: "true"
SLACK_COLOR: "failure"
SLACK_USERNAME: "GitHub Actions Bot"
SLACK_ICON_EMOJI: ":x:"
SLACK_FOOTER: "Failed Example Tests | GitHub Actions"
42 changes: 42 additions & 0 deletions .github/workflows/lint_js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check Linting and Formatting (JS)

on:
push:
paths:
- '**/*.js'
- '**/*.ts'
pull_request:
paths:
- '**/*.js'
- '**/*.ts'

jobs:
lint-and-prettify:
runs-on: ubuntu-latest

defaults:
run:
working-directory: js

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install pnpm
run: npm install -g pnpm

- name: Install packages in js folder
run: pnpm install --frozen-lockfile

- name: Run ESLint
run: pnpm run eslint
continue-on-error: false

- name: Run Prettier
run: pnpm run prettier:check
continue-on-error: false
21 changes: 21 additions & 0 deletions .github/workflows/pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: PR Title check

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 3ac09d8

Please sign in to comment.