Skip to content

Commit

Permalink
Merge branch 'main' into issue_178_healy
Browse files Browse the repository at this point in the history
  • Loading branch information
BigOleHealz authored Oct 29, 2024
2 parents 0a26f3f + adfa3a1 commit 68a282c
Show file tree
Hide file tree
Showing 26 changed files with 1,282 additions and 125 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:

STRIPE_API_KEY: ${{ secrets.PROD_STRIPE_API_KEY }}
STRIPE_FREE_TIER_PRICE_ID: ${{ secrets.PROD_STRIPE_FREE_TIER_PRICE_ID }}
STRIPE_PRODUCT_ID_FREE: ${{ secrets.STRIPE_PRODUCT_ID_FREE_PROD }}
STRIPE_PRODUCT_ID_STANDARD: ${{ secrets.STRIPE_PRODUCT_ID_STANDARD_PROD }}

ENV: prod
PRODUCT_ID: ${{ secrets.PROD_PRODUCT_ID }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/stage-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:

STRIPE_API_KEY: ${{ secrets.STAGE_STRIPE_API_KEY }}
STRIPE_FREE_TIER_PRICE_ID: ${{ secrets.STAGE_STRIPE_FREE_TIER_PRICE_ID }}
STRIPE_PRODUCT_ID_FREE: ${{ secrets.STRIPE_PRODUCT_ID_FREE_STAGE }}
STRIPE_PRODUCT_ID_STANDARD: ${{ secrets.STRIPE_PRODUCT_ID_STANDARD_STAGE }}

ENV: stage
PRODUCT_ID: ${{ secrets.STAGE_PRODUCT_ID }}
Expand Down
Binary file modified README.md
Binary file not shown.
12 changes: 10 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ def get_env_var(name: str) -> str:
GITHUB_APP_NAME: str = get_env_var(name="GH_APP_NAME")
GITHUB_APP_USER_ID: int = int(get_env_var(name="GH_APP_USER_ID"))
GITHUB_APP_USER_NAME: str = get_env_var(name="GH_APP_USER_NAME")
GITHUB_CHECK_RUN_FAILURES = [
"startup_failure",
"failure",
"timed_out",
"action_required",
]
GITHUB_ISSUE_DIR = ".github/ISSUE_TEMPLATE"
GITHUB_ISSUE_TEMPLATES: list[str] = ["bug_report.yml", "feature_request.yml"]
GITHUB_NOREPLY_EMAIL_DOMAIN = "users.noreply.github.com"
Expand All @@ -52,7 +58,7 @@ def get_env_var(name: str) -> str:
OPENAI_MAX_TOOL_OUTPUTS_SIZE = 512 * 1024 # in bytes
OPENAI_MAX_TOKENS = 4096
OPENAI_MODEL_ID_O1_PREVIEW = "o1-preview" # https://platform.openai.com/docs/models/o1
# OPENAI_MODEL_ID_O1_MINI = "o1-mini" # https://platform.openai.com/docs/models/o1
OPENAI_MODEL_ID_O1_MINI = "o1-mini" # https://platform.openai.com/docs/models/o1
OPENAI_MODEL_ID_GPT_4O = "gpt-4o" # https://platform.openai.com/docs/models/gpt-4o
OPENAI_ORG_ID: str = get_env_var(name="OPENAI_ORG_ID")
OPENAI_TEMPERATURE = 0.0
Expand All @@ -67,6 +73,8 @@ def get_env_var(name: str) -> str:
# Stripe
STRIPE_API_KEY: str = get_env_var(name="STRIPE_API_KEY")
STRIPE_FREE_TIER_PRICE_ID: str = get_env_var(name="STRIPE_FREE_TIER_PRICE_ID")
STRIPE_PRODUCT_ID_FREE: str = get_env_var(name="STRIPE_PRODUCT_ID_FREE")
STRIPE_PRODUCT_ID_STANDARD: str = get_env_var(name="STRIPE_PRODUCT_ID_STANDARD")

# General
DEFAULT_TIME = datetime(year=1, month=1, day=1, hour=0, minute=0, second=0)
Expand All @@ -75,7 +83,7 @@ def get_env_var(name: str) -> str:
IS_PRD: bool = ENV == "prod"
# Update here too: https://dashboard.stripe.com/test/products/prod_PokLGIxiVUwCi6
FREE_TIER_REQUEST_AMOUNT = 5
ISSUE_NUMBER_FORMAT = "/issue-#"
ISSUE_NUMBER_FORMAT = "/issue-" # DO NOT USE "#" as it is a special character and has to be encoded in URL, like in GitHub API URL
MAX_RETRIES = 3
PER_PAGE = 100
PR_BODY_STARTS_WITH = "Resolves #" # https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
Expand Down
15 changes: 15 additions & 0 deletions config/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from config import STRIPE_PRODUCT_ID_FREE, STRIPE_PRODUCT_ID_STANDARD


SETTINGS = {
"free": {
"name": "Free",
"check_run": False,
"product_id": STRIPE_PRODUCT_ID_FREE,
},
"standard": {
"name": "Standard",
"check_run": True,
"product_id": STRIPE_PRODUCT_ID_STANDARD,
},
}
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def handle_webhook(request: Request) -> dict[str, str]:
)
event_name: str = request.headers.get("X-GitHub-Event", "Event not specified")
print("\n" * 3 + "-" * 70)
print(f"Received event: {event_name} with content type: {content_type}\n")
print(f"Received event: {event_name} with content type: {content_type}")

# Validate if the webhook signature comes from GitHub
await verify_webhook_signature(request=request, secret=GITHUB_WEBHOOK_SECRET)
Expand Down
Loading

0 comments on commit 68a282c

Please sign in to comment.