Skip to content

Commit

Permalink
Merge branch 'main' into webhook_start
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielluiz authored Jul 4, 2024
2 parents 7d760f7 + f2d949b commit c1e3fa7
Show file tree
Hide file tree
Showing 208 changed files with 1,124 additions and 404 deletions.
35 changes: 35 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
changelog:
categories:
- title: 🚨 Breaking Changes
description: Changes that break existing functionality
labels:
- breaking
- title: ✨ New Features
description: New features and enhancements
labels:
- enhancement
- title: 🐛 Bug Fixes
description: Bug fixes and patches
labels:
- fix
- bug
- title: 📝 Documentation Updates
description: Changes to documentation
labels:
- documentation
- title: 🛠 Maintenance Tasks
description: Maintenance tasks and housekeeping
labels:
- chore
- refactor
- style
- performance
- build
- title: ✅ Tests
description: Changes to tests
labels:
- test
- title: Others
description: Other changes
labels:
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
name: Auto-update
runs-on: ubuntu-latest
steps:
- uses: tibdex/auto-update@v2
- uses: tibdex/auto-update@v2
159 changes: 84 additions & 75 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,90 +8,99 @@ on:
description: "(Optional) Branch to checkout"
required: false
type: string
openai_api_key:
description: "OpenAI API Key"
required: false
type: string
store_api_key:
description: "Store API Key"
required: false
type: string
pull_request:



concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
path-filter:
name: Filter Paths
runs-on: ubuntu-latest
outputs:
python: ${{ steps.filter.outputs.python }}
frontend: ${{ steps.filter.outputs.frontend }}
docs: ${{ steps.filter.outputs.docs }}
tests: ${{ steps.filter.outputs.tests }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch || github.ref }}
- name: Filter Paths
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
python:
- "src/backend/**"
- "src/backend/**.py"
- "pyproject.toml"
- "poetry.lock"
- "**/python_test.yml"
tests:
- "tests/**"
- "src/frontend/tests/**"
frontend:
- "src/frontend/**"
- "**/typescript_test.yml"
docs:
- "docs/**"
test-backend:
needs: path-filter
name: Run Backend Tests
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.tests == 'true' }}
uses: ./.github/workflows/python_test.yml



test-frontend:
needs: path-filter
name: Run Frontend Tests
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.frontend == 'true' || needs.path-filter.outputs.tests == 'true' }}
uses: ./.github/workflows/typescript_test.yml
path-filter:
name: Filter Paths
runs-on: ubuntu-latest
outputs:
python: ${{ steps.filter.outputs.python }}
frontend: ${{ steps.filter.outputs.frontend }}
docs: ${{ steps.filter.outputs.docs }}
tests: ${{ steps.filter.outputs.tests }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch || github.ref }}
- name: Filter Paths
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
python:
- "src/backend/**"
- "src/backend/**.py"
- "pyproject.toml"
- "poetry.lock"
- "**/python_test.yml"
tests:
- "tests/**"
- "src/frontend/tests/**"
frontend:
- "src/frontend/**"
- "**/typescript_test.yml"
docs:
- "docs/**"
test-backend:
needs: path-filter
name: Run Backend Tests
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.tests == 'true' }}
uses: ./.github/workflows/python_test.yml

lint-backend:
needs: path-filter
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.tests == 'true' }}
name: Lint Backend
uses: ./.github/workflows/lint-py.yml
# Run only if there are python files changed
test-frontend:
needs: path-filter
name: Run Frontend Tests
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.frontend == 'true' || needs.path-filter.outputs.tests == 'true' }}
uses: ./.github/workflows/typescript_test.yml
secrets:
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
STORE_API_KEY: "${{ secrets.STORE_API_KEY }}"

test-docs-build:
needs: path-filter
if: ${{ needs.path-filter.outputs.docs == 'true' }}
name: Test Docs Build
uses: ./.github/workflows/docs_test.yml
lint-backend:
needs: path-filter
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.tests == 'true' }}
name: Lint Backend
uses: ./.github/workflows/lint-py.yml
# Run only if there are python files changed

test-docs-build:
needs: path-filter
if: ${{ needs.path-filter.outputs.docs == 'true' }}
name: Test Docs Build
uses: ./.github/workflows/docs_test.yml

# https://github.com/langchain-ai/langchain/blob/master/.github/workflows/check_diffs.yml
ci_success:
name: "CI Success"
needs: [test-backend, test-frontend, lint-backend, test-docs-build]
if: |
always()
runs-on: ubuntu-latest
env:
JOBS_JSON: ${{ toJSON(needs) }}
RESULTS_JSON: ${{ toJSON(needs.*.result) }}
EXIT_CODE: ${{!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && '0' || '1'}}
steps:
- name: "CI Success"
run: |
echo $JOBS_JSON
echo $RESULTS_JSON
echo "Exiting with $EXIT_CODE"
exit $EXIT_CODE
# https://github.com/langchain-ai/langchain/blob/master/.github/workflows/check_diffs.yml
ci_success:
name: "CI Success"
needs: [test-backend, test-frontend, lint-backend, test-docs-build]
if: |
always()
runs-on: ubuntu-latest
env:
JOBS_JSON: ${{ toJSON(needs) }}
RESULTS_JSON: ${{ toJSON(needs.*.result) }}
EXIT_CODE: ${{!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && '0' || '1'}}
steps:
- name: "CI Success"
run: |
echo $JOBS_JSON
echo $RESULTS_JSON
echo "Exiting with $EXIT_CODE"
exit $EXIT_CODE
31 changes: 31 additions & 0 deletions .github/workflows/conventional-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Warning, do not check out untrusted code with
# the pull_request_target event.
name: Label PRs with Conventional Commits
on:
pull_request_target:
types: [ opened, edited , reopened]

jobs:
validate-pr:
name: Validate PR
runs-on: ubuntu-latest
outputs:
validate_output: ${{ steps.validate.outputs }}
steps:
- name: Validate the pull request
id: validate
uses: Namchee/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
verbose: true
issue: false

label:
needs: validate-pr
name: Label PR
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.type != 'Bot' && needs.validate-pr.outputs.validate_output == 'true' }}
steps:
- uses: bcoe/conventional-release-labels@v1
with:
type_labels: '{"feat": "enhancement","fix": "bug","docs": "documentation","style": "style","refactor": "refactor","perf": "performance","test": "test","chore": "chore","build": "build"}'
1 change: 0 additions & 1 deletion .github/workflows/docs_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
env:
NODE_VERSION: "21"


jobs:
test-docs-build:
name: Test Docs Build
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/js_autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: autofix.ci

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "src/frontend/**"

Expand Down Expand Up @@ -43,4 +42,4 @@ jobs:
cd src/frontend
npm run format
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
2 changes: 0 additions & 2 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,3 @@ jobs:
run: |
cd src/frontend
npm run check-format
11 changes: 2 additions & 9 deletions .github/workflows/py_autofix.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: autofix.ci
on:
pull_request:
types: [opened, synchronize, reopened, auto_merge_enabled]
paths:
- "poetry.lock"
- "pyproject.toml"
Expand All @@ -12,18 +11,12 @@ env:

jobs:
lint:
name: Run Mypy
name: Run Ruff Check and Format
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
- "3.11"
- "3.10"
steps:
- uses: actions/checkout@v4
- uses: install-pinned/ruff@b52a71f70b28264686d57d1efef1ba845b9cec6c
- run: ruff check --fix-only .
- run: ruff format .

- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
3 changes: 0 additions & 3 deletions .github/workflows/style-check-py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ jobs:
run: echo "::add-matcher::.github/workflows/matchers/ruff.json"
- name: Run Ruff Check
run: poetry run ruff check --output-format=github .



14 changes: 9 additions & 5 deletions .github/workflows/typescript_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ name: Run Frontend Tests

on:
workflow_call:
secrets:
OPENAI_API_KEY:
required: true
STORE_API_KEY:
required: true
workflow_dispatch:
inputs:
branch:
description: "(Optional) Branch to checkout"
required: false
type: string


env:
POETRY_VERSION: "1.8.3"
NODE_VERSION: "21"
Expand All @@ -25,11 +29,11 @@ jobs:
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shardTotal: [10]
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
shardTotal: [14]
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
STORE_API_KEY: ${{ secrets.STORE_API_KEY }}
OPENAI_API_KEY: ${{ inputs.openai_api_key || secrets.OPENAI_API_KEY }}
STORE_API_KEY: ${{ inputs.store_api_key || secrets.STORE_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
Loading

0 comments on commit c1e3fa7

Please sign in to comment.