Skip to content

Commit

Permalink
Merge branch 'master' into improvement_in_web_functionalities
Browse files Browse the repository at this point in the history
  • Loading branch information
ntindle committed Jul 22, 2024
2 parents 24c8c2e + 56b8236 commit 9052105
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 6 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/scripts/check_actions_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import os
import requests
import sys

# GitHub API endpoint
api_url = os.environ["GITHUB_API_URL"]
repo = os.environ["GITHUB_REPOSITORY"]
sha = os.environ["GITHUB_SHA"]

# GitHub token for authentication
github_token = os.environ["GITHUB_TOKEN"]

# API endpoint for check runs for the specific SHA
endpoint = f"{api_url}/repos/{repo}/commits/{sha}/check-runs"

# Set up headers for authentication
headers = {
"Authorization": f"token {github_token}",
"Accept": "application/vnd.github.v3+json"
}

# Make the API request
response = requests.get(endpoint, headers=headers)

if response.status_code != 200:
print(f"Error: Unable to fetch check runs data. Status code: {response.status_code}")
sys.exit(1)

check_runs = response.json()["check_runs"]

# Flag to track if all other check runs have passed
all_others_passed = True

# Current run id
current_run_id = os.environ["GITHUB_RUN_ID"]

for run in check_runs:
if str(run["id"]) != current_run_id:
status = run["status"]
conclusion = run["conclusion"]

if status == "completed":
if conclusion not in ["success", "skipped", "neutral"]:
all_others_passed = False
print(f"Check run {run['name']} (ID: {run['id']}) has conclusion: {conclusion}")
else:
print(f"Check run {run['name']} (ID: {run['id']}) is still {status}.")
all_others_passed = False

if all_others_passed:
print("All other completed check runs have passed. This check passes.")
sys.exit(0)
else:
print("Some check runs have failed or have not completed. This check fails.")
sys.exit(1)
26 changes: 26 additions & 0 deletions .github/workflows/workflow-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PR Status Checker

on:
workflow_run:
workflows: ["*"]
types:
- completed

jobs:
status-check:
name: Check Actions Status
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Check Actions Status
run: python .github/scripts/check_actions_status.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 11 additions & 6 deletions rnd/autogpt_server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,31 @@ The agent server will enable the creation of composite multi-agent systems that

## Setup

To set up the project, follow these steps inside this directory:
We use the Poetry to manage the dependencies. To set up the project, follow these steps inside this directory:

0. Configure Poetry to use .venv in your project directory
0. Install Poetry
```sh
pip install poetry
```

1. Configure Poetry to use .venv in your project directory
```sh
poetry config virtualenvs.in-project true
```

1. Enter the poetry shell
2. Enter the poetry shell

```sh
poetry shell
```

2. Install dependencies
3. Install dependencies

```sh
poetry install
```

3. Generate the Prisma client
4. Generate the Prisma client

```sh
poetry run prisma generate
Expand All @@ -40,7 +45,7 @@ To set up the project, follow these steps inside this directory:
> Then run the generation again. The path *should* look something like this:
> `<some path>/pypoetry/virtualenvs/autogpt-server-TQIRSwR6-py3.12/bin/prisma`

4. Migrate the database. Be careful because this deletes current data in the database.
5. Migrate the database. Be careful because this deletes current data in the database.

```sh
poetry run prisma migrate dev
Expand Down

0 comments on commit 9052105

Please sign in to comment.