Skip to content

Commit

Permalink
feat: remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
a00012025 committed Sep 28, 2024
2 parents 97cc90b + f3fd439 commit 702d311
Show file tree
Hide file tree
Showing 181 changed files with 18,873 additions and 2,261 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Build-and-test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-test:
Expand Down Expand Up @@ -31,6 +36,6 @@ jobs:
- id: test
name: Test dev docker
run: |
docker run --rm codiumai/pr-agent:test pytest -v
docker run --rm codiumai/pr-agent:test pytest -v tests/unittest
54 changes: 54 additions & 0 deletions .github/workflows/code_coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Code-coverage

on:
workflow_dispatch:
# push:
# branches:
# - main
pull_request:
branches:
- main

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- id: checkout
uses: actions/checkout@v2

- id: dockerx
name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- id: build
name: Build dev docker
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile
push: false
load: true
tags: codiumai/pr-agent:test
cache-from: type=gha,scope=dev
cache-to: type=gha,mode=max,scope=dev
target: test

- id: code_cov
name: Test dev docker
run: |
docker run --name test_container codiumai/pr-agent:test pytest tests/unittest --cov=pr_agent --cov-report term --cov-report xml:coverage.xml
docker cp test_container:/app/coverage.xml coverage.xml
docker rm test_container
- name: Validate coverage report
run: |
if [ ! -f coverage.xml ]; then
echo "Coverage report not found"
exit 1
fi
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/docs-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: docs-ci
on:
push:
branches:
- main
- add-docs-portal
paths:
- docs/**
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: pip install "mkdocs-material[imaging]"
- run: pip install mkdocs-glightbox
- run: mkdocs gh-deploy -f docs/mkdocs.yml --force
46 changes: 46 additions & 0 deletions .github/workflows/e2e_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: PR-Agent E2E tests

on:
workflow_dispatch:
# schedule:
# - cron: '0 0 * * *' # This cron expression runs the workflow every night at midnight UTC

jobs:
pr_agent_job:
runs-on: ubuntu-latest
name: PR-Agent E2E GitHub App Test
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- id: build
name: Build dev docker
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile
push: false
load: true
tags: codiumai/pr-agent:test
cache-from: type=gha,scope=dev
cache-to: type=gha,mode=max,scope=dev
target: test

- id: test1
name: E2E test github app
run: |
docker run -e GITHUB.USER_TOKEN=${{ secrets.TOKEN_GITHUB }} --rm codiumai/pr-agent:test pytest -v tests/e2e_tests/test_github_app.py
- id: test2
name: E2E gitlab webhook
run: |
docker run -e gitlab.PERSONAL_ACCESS_TOKEN=${{ secrets.TOKEN_GITLAB }} --rm codiumai/pr-agent:test pytest -v tests/e2e_tests/test_gitlab_webhook.py
- id: test3
name: E2E bitbucket app
run: |
docker run -e BITBUCKET.USERNAME=${{ secrets.BITBUCKET_USERNAME }} -e BITBUCKET.PASSWORD=${{ secrets.BITBUCKET_PASSWORD }} --rm codiumai/pr-agent:test pytest -v tests/e2e_tests/test_bitbucket_app.py
12 changes: 10 additions & 2 deletions .github/workflows/pr-agent-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
name: PR-Agent

on:
pull_request:
issue_comment:
# pull_request:
# issue_comment:
workflow_dispatch:

permissions:
issues: write
Expand All @@ -24,4 +25,11 @@ jobs:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
OPENAI_ORG: ${{ secrets.OPENAI_ORG }} # optional
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PINECONE.API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE.ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }}
GITHUB_ACTION_CONFIG.AUTO_DESCRIBE: true
GITHUB_ACTION_CONFIG.AUTO_REVIEW: true
GITHUB_ACTION_CONFIG.AUTO_IMPROVE: true



5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
.idea/
.lsp/
.vscode/
venv/
pr_agent/settings/.secrets.toml
__pycache__
dist/
*.egg-info/
build/
review.md
.DS_Store
docs/.cache/
6 changes: 6 additions & 0 deletions .pr_agent.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pr_reviewer]
enable_review_labels_effort = true
enable_auto_approval = true

[config]
model="claude-3-5-sonnet"
57 changes: 0 additions & 57 deletions CONFIGURATION.md

This file was deleted.

3 changes: 2 additions & 1 deletion Dockerfile.github_action
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM python:3.10 as base

WORKDIR /app
ADD pyproject.toml .
RUN pip install . && rm pyproject.toml
ADD requirements.txt .
RUN pip install . && rm pyproject.toml requirements.txt
ENV PYTHONPATH=/app
ADD pr_agent pr_agent
ADD github_action/entrypoint.sh /
Expand Down
Loading

0 comments on commit 702d311

Please sign in to comment.