Skip to content

Commit

Permalink
AutoPR v2
Browse files Browse the repository at this point in the history
Co-authored-by: tjazerzen <erzen.tjaz@gmail.com>
  • Loading branch information
irgolic and tjazerzen committed Aug 25, 2023
1 parent 10e2891 commit a3cf366
Show file tree
Hide file tree
Showing 191 changed files with 38,327 additions and 5,965 deletions.
33 changes: 33 additions & 0 deletions .autopr/triggers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
triggers:
- label_substring: summarize
on_issue: false
on_pull_request: true
run: summarize_pr
- branch_name: main
run: generate_readme_summaries
parameters:
FILE_SUMMARY_PROMPT: |
Write an executive summary of this file, intended for someone seeing it for the first time.
Don't explain simple or trivial things like imports, but do explain what the purpose of the file is.
Be short and concise, especially if the file is empty.
Respond in 1-10 bullet points, prefixed with emojis, with five spaces at the end of each line.
FILE_SUMMARY_INSTRUCTIONS: |
Respond in 1-10 bullet points, prefixed of emojis. Try to pick contextually relevant emojis.
Be short and concise.
An example of the structure I'm expecting:
~~~
💧 line item 1
🚚 line item 2
~~~
PUT FIVE SPACES ON THE END OF EACH ONLINE.
FOLDER_SUMMARY_PROMPT: |
Write a high level overview of this folder, intended for someone seeing it for the first time.
Don't explain simple or trivial things like imports, but do explain what the purpose is of the contents of the folder.
Be high-level, and very concise.
FOLDER_SUMMARY_INSTRUCTIONS: |
Be very concise, and respond in the form of a short paragraph (max 3 sentences).
IGNORE_FILES:
- website
- .github
- .autopr
- tests
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
on:
push:
branches:
- main
issues:
types: [labeled]
issue_comment:
types: [created]
pull_request_target:
types: [labeled]

permissions:
contents: write
Expand All @@ -11,11 +16,6 @@ permissions:

jobs:
autopr:
if: ${{ (github.event_name == 'issues' &&
contains( github.event.label.name, 'AutoPR')) ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains( github.event.comment.body, 'Hey AutoPR')) }}
runs-on: ubuntu-latest
steps:
- name: Install jq
Expand All @@ -37,14 +37,9 @@ jobs:
ref: main
fetch-depth: 1
- name: AutoPR
uses: docker://ghcr.io/irgolic/autopr:latest
uses: irgolic/AutoPR@main
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
base_branch: main
model: gpt-4
context_limit: 8192
min_tokens: 1000
max_tokens: 2000
num_reasks: 2
6 changes: 3 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: [3.9, 3.11]
poetry-version: [1.3.2]
steps:
- name: Checkout repository
Expand All @@ -28,7 +28,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-${{ matrix.poetry-version }}
key: poetry-${{ matrix.python-version }}-${{ matrix.poetry-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
Expand All @@ -41,7 +41,7 @@ jobs:
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
key: pydeps-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: poetry install --with test --no-interaction --no-root
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ __pycache__/
*.diff
!autopr/tests/resources/**/*.diff
*.patch
.ipynb_checkpoints

.python-version

!.vscode/
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
}
]
}
1 change: 1 addition & 0 deletions .vscode/ltex.dictionary.en-US.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AutoPR
25 changes: 25 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"python.testing.pytestArgs": [
"autopr"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"cSpell.words": [
"autopr",
"Pydantic",
"subfolders",
"todos"
],
"yaml.schemas": {
"./trigger_schema.json": [
".autopr/triggers.{yaml,yml}",
".autopr/triggers/*.{yaml,yml}",
"autopr/tests/triggers/*.{yaml,yml}"
],
"./workflow_schema.json": [
".autopr/workflows.{yaml,yml}",
".autopr/workflows/*.{yaml,yml}",
"autopr/tests/workflow_resources/*.{yaml,yml}"
]
}
}
122 changes: 0 additions & 122 deletions CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Rafael Frančišek Irgolič
Copyright (c) 2023 Raphael Francis Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type:
pyright

test:
pytest autopr/tests

schema:
python -m autopr.models.config.entrypoints

all: type test schema
Loading

0 comments on commit a3cf366

Please sign in to comment.