Skip to content

Commit

Permalink
Merge pull request #14 from notdodo/fix_logging
Browse files Browse the repository at this point in the history
fix: lambda logging, add ci
  • Loading branch information
notdodo authored Sep 21, 2024
2 parents 582331a + be46725 commit 7cb5b6e
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @notdodo
40 changes: 40 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: 2
updates:
- package-ecosystem: docker
directory: /
schedule:
interval: monthly
time: "12:00"
day: wednesday
groups:
erfiume-docker:
patterns:
- "*"
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
time: "12:00"
day: wednesday
- package-ecosystem: pip
directory: /pulumi
schedule:
interval: monthly
time: "12:00"
day: wednesday
groups:
pulumi:
dependency-type: "production"
pulumi-dev:
dependency-type: "development"
- package-ecosystem: pip
directory: /app
schedule:
interval: monthly
time: "12:00"
day: wednesday
groups:
app:
dependency-type: "production"
app-dev:
dependency-type: "development"
22 changes: 22 additions & 0 deletions .github/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Python CI
on:
push:

concurrency:
group: ghas-erfiume-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
python-ci-app:
uses: notdodo/github-actions/.github/workflows/[email protected]
with:
poetry-version: latest
python-version: 3.12
working-directory: "./app"

python-ci-pulumi:
uses: notdodo/github-actions/.github/workflows/[email protected]
with:
poetry-version: latest
python-version: 3.12
working-directory: "./pulumi"
5 changes: 2 additions & 3 deletions app/erfiume/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Module to start and configure logging.
"""

import logging
from aws_lambda_powertools import Logger

logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
logger = Logger(service="erfiume", level="INFO", child=True)
4 changes: 3 additions & 1 deletion app/erfiume/tgbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ async def fetch_bot_token() -> str:
return boto3.client(
service_name="secretsmanager",
endpoint_url=("http://localhost:4566" if environment != "production" else None),
).get_secret_value(SecretId="telegram-bot-token",)["SecretString"]
).get_secret_value(
SecretId="telegram-bot-token",
)["SecretString"]


async def start(update: Update, _: ContextTypes.DEFAULT_TYPE) -> None:
Expand Down
60 changes: 30 additions & 30 deletions app/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions app/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.12"
aws-lambda-powertools = "^2.43.1"
httpx = "^0.27.2"
aioboto3 = "^13.1.1"
python-telegram-bot = "^21.5"
poetry-dotenv-plugin = "^0.2.0"
python = "^3.12"
python-telegram-bot = "^21.5"

[tool.poetry.group.dev.dependencies]
aws-lambda-powertools = "^2.43.1"
awscli-local = "^0.22.0"
boto3-stubs = { version = "1.35.5", extras = ["dynamodb", "secretsmanager"] }
mypy = "^1.10.1"
Expand Down

0 comments on commit 7cb5b6e

Please sign in to comment.