Skip to content

Commit

Permalink
Merge branch 'dev' into feature/env-based-marketplace
Browse files Browse the repository at this point in the history
  • Loading branch information
aarushik93 authored Dec 2, 2024
2 parents c07aa72 + 30bb9a3 commit 8b4f9ed
Show file tree
Hide file tree
Showing 114 changed files with 2,936 additions and 1,136 deletions.
24 changes: 21 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ updates:
interval: "weekly"
open-pull-requests-limit: 10
target-branch: "dev"
commit-message:
prefix: "chore(libs/deps)"
prefix-development: "chore(libs/deps-dev)"
groups:
production-dependencies:
dependency-type: "production"
Expand All @@ -26,6 +29,9 @@ updates:
interval: "weekly"
open-pull-requests-limit: 10
target-branch: "dev"
commit-message:
prefix: "chore(backend/deps)"
prefix-development: "chore(backend/deps-dev)"
groups:
production-dependencies:
dependency-type: "production"
Expand All @@ -38,14 +44,16 @@ updates:
- "minor"
- "patch"


# frontend (Next.js project)
- package-ecosystem: "npm"
directory: "autogpt_platform/frontend"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
target-branch: "dev"
commit-message:
prefix: "chore(frontend/deps)"
prefix-development: "chore(frontend/deps-dev)"
groups:
production-dependencies:
dependency-type: "production"
Expand All @@ -58,14 +66,17 @@ updates:
- "minor"
- "patch"


# infra (Terraform)
- package-ecosystem: "terraform"
directory: "autogpt_platform/infra"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
target-branch: "dev"
commit-message:
prefix: "chore(infra/deps)"
prefix-development: "chore(infra/deps-dev)"

groups:
production-dependencies:
dependency-type: "production"
Expand All @@ -78,14 +89,16 @@ updates:
- "minor"
- "patch"


# market (Poetry project)
- package-ecosystem: "pip"
directory: "autogpt_platform/market"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
target-branch: "dev"
commit-message:
prefix: "chore(market/deps)"
prefix-development: "chore(market/deps-dev)"
groups:
production-dependencies:
dependency-type: "production"
Expand Down Expand Up @@ -146,6 +159,9 @@ updates:
interval: "weekly"
open-pull-requests-limit: 1
target-branch: "dev"
commit-message:
prefix: "chore(platform/deps)"
prefix-development: "chore(platform/deps-dev)"
groups:
production-dependencies:
dependency-type: "production"
Expand All @@ -166,6 +182,8 @@ updates:
interval: "weekly"
open-pull-requests-limit: 1
target-branch: "dev"
commit-message:
prefix: "chore(docs/deps)"
groups:
production-dependencies:
dependency-type: "production"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/classic-autogpt-docker-cache-clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- id: build
name: Build image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: classic/
file: classic/Dockerfile.autogpt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/classic-autogpt-docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- id: build
name: Build image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: classic/
file: classic/Dockerfile.autogpt
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:

- id: build
name: Build image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: classic/
file: classic/Dockerfile.autogpt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/classic-autogpt-docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- id: build
name: Build image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: classic/
file: Dockerfile.autogpt
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
branches: [ "master", "release-*", "dev" ]
pull_request:
branches: [ "master", "release-*", "dev" ]
merge_group:
schedule:
- cron: '15 4 * * 0'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/platform-backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
paths:
- ".github/workflows/platform-backend-ci.yml"
- "autogpt_platform/backend/**"
merge_group:

concurrency:
group: ${{ format('backend-ci-{0}', github.head_ref && format('{0}-{1}', github.event_name, github.event.pull_request.number) || github.sha) }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/platform-frontend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
paths:
- ".github/workflows/platform-frontend-ci.yml"
- "autogpt_platform/frontend/**"
merge_group:

defaults:
run:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/platform-market-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
paths:
- ".github/workflows/platform-market-ci.yml"
- "autogpt_platform/market/**"
merge_group:

concurrency:
group: ${{ format('backend-ci-{0}', github.head_ref && format('{0}-{1}', github.event_name, github.event.pull_request.number) || github.sha) }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/repo-workflow-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Repo - PR Status Checker
on:
pull_request:
types: [opened, synchronize, reopened]
merge_group:

jobs:
status-check:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/scripts/check_actions_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@

CHECK_INTERVAL = 30


def get_environment_variables() -> Tuple[str, str, str, str, str]:
"""Retrieve and return necessary environment variables."""
try:
with open(os.environ["GITHUB_EVENT_PATH"]) as f:
event = json.load(f)

sha = event["pull_request"]["head"]["sha"]
# Handle both PR and merge group events
if "pull_request" in event:
sha = event["pull_request"]["head"]["sha"]
else:
sha = os.environ["GITHUB_SHA"]

return (
os.environ["GITHUB_API_URL"],
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,5 @@ ig*
.github_access_token
LICENSE.rtf
autogpt_platform/backend/settings.py
/.auth
/autogpt_platform/frontend/.auth
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
from typing import NamedTuple
import secrets
import hashlib
import secrets
from typing import NamedTuple


class APIKeyContainer(NamedTuple):
"""Container for API key parts."""

raw: str
prefix: str
postfix: str
hash: str


class APIKeyManager:
PREFIX: str = "agpt_"
PREFIX_LENGTH: int = 8
Expand All @@ -19,9 +22,9 @@ def generate_api_key(self) -> APIKeyContainer:
raw_key = f"{self.PREFIX}{secrets.token_urlsafe(32)}"
return APIKeyContainer(
raw=raw_key,
prefix=raw_key[:self.PREFIX_LENGTH],
postfix=raw_key[-self.POSTFIX_LENGTH:],
hash=hashlib.sha256(raw_key.encode()).hexdigest()
prefix=raw_key[: self.PREFIX_LENGTH],
postfix=raw_key[-self.POSTFIX_LENGTH :],
hash=hashlib.sha256(raw_key.encode()).hexdigest(),
)

def verify_api_key(self, provided_key: str, stored_hash: str) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions autogpt_platform/autogpt_libs/autogpt_libs/auth/depends.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fastapi

from .middleware import auth_middleware
from .models import User, DEFAULT_USER_ID, DEFAULT_EMAIL
from .config import Settings
from .middleware import auth_middleware
from .models import DEFAULT_USER_ID, User


def requires_user(payload: dict = fastapi.Depends(auth_middleware)) -> User:
Expand Down
Loading

0 comments on commit 8b4f9ed

Please sign in to comment.