Skip to content

Commit 571077e

Browse files
chore: sync chatbot dev with staging (#947)
1 parent b188feb commit 571077e

File tree

13 files changed

+86
-76
lines changed

13 files changed

+86
-76
lines changed

.github/workflows/ci-python.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ jobs:
1111
- name: Checkout
1212
uses: actions/checkout@v4
1313
- name: Lint source code
14-
uses: chartboost/ruff-action@v1
14+
uses: astral-sh/ruff-action@v3
15+
with:
16+
version: "0.14.9"
1517
test:
1618
name: Test python
1719
runs-on: ubuntu-latest

.github/workflows/deploy-dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ jobs:
8585
run: |-
8686
helm upgrade \
8787
--wait \
88-
--timeout 10m \
8988
--install \
89+
--timeout 10m \
9090
--namespace website \
9191
--values values.yaml \
9292
api-dev charts/basedosdados-api/.

.github/workflows/deploy-prod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ jobs:
8585
run: |-
8686
helm upgrade \
8787
--wait \
88-
--timeout 10m \
8988
--install \
89+
--timeout 10m \
9090
--namespace website \
9191
--values values.yaml \
9292
api-prod charts/basedosdados-api/.

.github/workflows/deploy-staging.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ jobs:
8585
run: |-
8686
helm upgrade \
8787
--wait \
88-
--timeout 10m \
8988
--install \
89+
--timeout 10m \
9090
--namespace website \
9191
--values values.yaml \
9292
api-staging charts/basedosdados-api/.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ fabric.properties
249249
.DS_Store
250250
/backend/media/
251251
/backend/notebooks/
252+
/backend/static/
252253
/backend/staticfiles/
253254

254255
# Fixture

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ repos:
1919
hooks:
2020
- id: poetry-check
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.2.0
22+
rev: v0.14.9
2323
hooks:
24-
- id: ruff
24+
- id: ruff-check
2525
args: [--fix]
2626
- id: ruff-format
2727
- repo: https://github.com/tconbeer/sqlfmt
28-
rev: v0.20.0
28+
rev: v0.28.2
2929
hooks:
3030
- id: sqlfmt
3131
language_version: python

backend/custom/environment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from os import getenv
44

55
SETTINGS = getenv("DJANGO_SETTINGS_MODULE", "backend.settings")
6-
BACKEND_URL = getenv("BASE_URL_BACKEND", "http://localhost:8000")
6+
BACKEND_URL = getenv("BASE_URL_BACKEND", "https://localhost:8080")
77

88

99
def is_remote():
@@ -43,7 +43,7 @@ def get_backend_url():
4343
return "staging.backend.basedosdados.org"
4444
if is_dev():
4545
return "development.backend.basedosdados.org"
46-
return "localhost:8000"
46+
return "localhost:8080"
4747

4848

4949
def get_frontend_url():

backend/custom/middleware.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,15 @@ def process_template_response(self, request: WSGIRequest, response: TemplateResp
1212
try:
1313
errors = []
1414
context = response.context_data
15-
if "errors" in context:
16-
errors = context["errors"]
17-
elif "form" in context:
18-
errors = context["form"].errors
15+
if context:
16+
if "errors" in context:
17+
errors = context["errors"]
18+
elif "form" in context:
19+
errors = context["form"].errors
1920
if errors:
20-
user = request.user
2121
endpoint = request.get_full_path()
22-
logger.warning(
23-
f"{repr(errors)}",
24-
user=user,
25-
errors=errors,
26-
endpoint=endpoint,
27-
type="validation",
28-
)
29-
except Exception as e:
30-
logger.error(e)
22+
logger.info(f"Validation errors on {request.method} {endpoint}: {repr(errors)}")
23+
except Exception:
24+
logger.exception("Error processing template response in LoggerMiddleware:")
3125
finally:
3226
return response

compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
services:
33
index:
4-
image: elasticsearch:8.17.2 # TODO : upgrade prod to elasticsearch:8.17.2
4+
image: elasticsearch:7.17.3
55
container_name: index
66
environment:
77
- cluster.name=docker-cluster
@@ -61,7 +61,7 @@ services:
6161
command: [poetry, run, /app/start-server-dev.sh]
6262
volumes: [.:/app, $HOME/.basedosdados/credentials:/app/credentials:ro]
6363
ports:
64-
- 8000:8000 # API port
64+
- 8080:80 # API port
6565
- 5678:5678 # Debug port
6666
depends_on:
6767
index:

poetry.lock

Lines changed: 21 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)