Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/scripts/test_image
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
set -ex

PROJECT_NAME=bot-example

python -m copier --defaults . $PROJECT_NAME
python -m copier copy --force --trust . $PROJECT_NAME
cd $PROJECT_NAME

docker-compose up -d
docker compose up -d
sleep 10

curl --silent --fail http://localhost:8000/healthcheck || exit 1
curl --show-error --fail http://localhost:8000/healthcheck || exit 1
39 changes: 15 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@ env:
jobs:
test-image:
name: Test app start
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install copier
run: |
pip install copier==7.1.0
pip install copier-templates-extensions
pip install pyyaml-include==1.4.1
# hardcode pydantic version to avoid dependency conflict with copier
pip install pydantic==1.10.2
pip install copier==9.4.0
pip install copier-templates-extensions==0.3.1

- name: Test image
env:
Expand All @@ -37,10 +34,10 @@ jobs:

test-template:
name: Test template
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10"]
python-version: [ "3.8", "3.9", "3.10", "3.11"]

services:
postgres:
Expand Down Expand Up @@ -71,12 +68,9 @@ jobs:

- name: Install copier
run: |
pip install copier==7.1.0
pip install copier-templates-extensions
pip install pyyaml-include==1.4.1
# hardcode pydantic version to avoid dependency conflict with copier
pip install pydantic==1.10.2
python -m copier --defaults . bot-example
pip install copier==9.4.0
pip install copier-templates-extensions==0.3.1
python -m copier copy --trust --force . bot-example


- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -90,7 +84,7 @@ jobs:

- name: Set up cache
id: cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cache/pip
Expand All @@ -116,23 +110,20 @@ jobs:

lint:
name: Lint
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install copier
run: |
pip install copier==7.1.0
pip install copier-templates-extensions
pip install pyyaml-include==1.4.1
# hardcode pydantic version to avoid dependency conflict with copier
pip install pydantic==1.10.2
python -m copier --defaults . bot-example
pip install copier==9.4.0
pip install copier-templates-extensions==0.3.1
python -m copier copy --trust --force . bot-example

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand All @@ -145,7 +136,7 @@ jobs:

- name: Set up cache
id: cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cache/pip
Expand Down
1 change: 1 addition & 0 deletions app/api/routers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configuration of routers for all endpoints."""

from fastapi import APIRouter

from app.api.endpoints.botx import router as bot_router
Expand Down
1 change: 1 addition & 0 deletions app/bot/error_handlers/internal_error.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Handler to work with unexpected errors."""

from uuid import uuid4

from pybotx import Bot, BotShuttingDownError, IncomingMessage
Expand Down
3 changes: 2 additions & 1 deletion app/db/migrations/versions/d6e3a38b1fbd_.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""empty message

Revision ID: d6e3a38b1fbd
Revises:
Revises:
Create Date: 2021-07-09 13:40:29.058513

Doc: https://alembic.sqlalchemy.org/en/latest/tutorial.html#create-a-migration-script
"""

import sqlalchemy as sa
from alembic import op

Expand Down
1 change: 1 addition & 0 deletions app/schemas/enums.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for enums."""

from enum import Enum


Expand Down
1 change: 1 addition & 0 deletions app/services/healthcheck.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Healthcheck service bot."""

from dataclasses import dataclass
from typing import List, Literal, Optional, Union

Expand Down
2 changes: 1 addition & 1 deletion extensions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ContextUpdater(ContextHook):
def hook(self, context):
context["CI"] = os.environ.get("CI", False)

if context["from_ccsteam"]:
if context.get("from_ccsteam", False):
try:
context["PROD_SERVER_HOST"] = os.environ["PROD_SERVER_HOST"]
context["DEV_SERVER_HOST"] = os.environ["DEV_SERVER_HOST"]
Expand Down
Loading
Loading