From 309f4ed69d15ed1a96c0513cb08029399ec62666 Mon Sep 17 00:00:00 2001 From: luisfponce Date: Thu, 5 Mar 2026 12:17:02 -0600 Subject: [PATCH 1/2] remove text unrequired from first version - closes #10 --- .github/workflows/cd.yml | 2 +- webapi/api/endpoints/v1/users.py | 2 -- webapi/auth/auth_service.py | 1 - webapi/core/config.py | 4 ++-- webapi/db/redis_connection.py | 5 ----- webapi/main.py | 16 ---------------- webapi/models/__init__.py | 1 - 7 files changed, 3 insertions(+), 28 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 77561ea..3271bb6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -35,7 +35,7 @@ jobs: ENV_SECRET_KEY: ${{ secrets.ENV_SECRET_KEY }} run: | cd webapi - if [ -f bank_db.db ]; then rm -f bank_db.db; fi + if [ -f crud_data_stored.db ]; then rm -f crud_data_stored.db; fi pytest tests/test_release.py -v container-smoke-test: diff --git a/webapi/api/endpoints/v1/users.py b/webapi/api/endpoints/v1/users.py index eff8518..8f1debb 100644 --- a/webapi/api/endpoints/v1/users.py +++ b/webapi/api/endpoints/v1/users.py @@ -10,8 +10,6 @@ router = APIRouter() -# curl -X POST "http://localhost:8000/login?username=lfponcen&password=lfponcen" -v <-- to get the session_token thru the cookie -# curl -b session_token=(gotten from verbose) -X GET "http://localhost:8000" @router.get("", response_model=list[User]) def read_users(phone: Optional[int] = None, skip: int = 0, limit: int = 10, session: Session = Depends(get_session), diff --git a/webapi/auth/auth_service.py b/webapi/auth/auth_service.py index 8e64763..af35b63 100644 --- a/webapi/auth/auth_service.py +++ b/webapi/auth/auth_service.py @@ -35,7 +35,6 @@ def create_access_token(data: dict, expires_delta: Optional[timedelta] = None): return encoded_jwt -# Crear un token def crear_jwt(data: dict): payload = { "exp": datetime.utcnow() + timedelta(hours=1), diff --git a/webapi/core/config.py b/webapi/core/config.py index d50a489..afb73a9 100644 --- a/webapi/core/config.py +++ b/webapi/core/config.py @@ -40,8 +40,8 @@ # MariaDB server # Ensure that the environment variable DB_URL is set to your MariaDB connection string -# Example: export DB_URL="mariadb+mariadbconnector://user:psw@127.0.0.1:3306/bank_db" +# Example: export DB_URL="mariadb+mariadbconnector://user:psw@127.0.0.1:3306/crud_data_stored" DB_URL = os.getenv("DB_URL") if not DB_URL: - DB_URL = "sqlite:///./bank_db.db" # Default to SQLite if no environment variable is set \ No newline at end of file + DB_URL = "sqlite:///./crud_data_stored.db" # Default to SQLite if no environment variable is set \ No newline at end of file diff --git a/webapi/db/redis_connection.py b/webapi/db/redis_connection.py index 37fd297..389d7ad 100644 --- a/webapi/db/redis_connection.py +++ b/webapi/db/redis_connection.py @@ -2,11 +2,6 @@ from core import config -# docker run -d \ -# --name redis-server \ -# -p 6379:6379 \ -# redis/redis-stack:latest - def get_redis(): redis = Redis( diff --git a/webapi/main.py b/webapi/main.py index 07c33a5..04f7abe 100644 --- a/webapi/main.py +++ b/webapi/main.py @@ -27,22 +27,6 @@ openapi_tags=tags_metadata ) -""" -Create a MariaDB container for testing purposes. -You can run this command in your terminal to start a MariaDB server with the specified environment variables -and port mapping. Make sure Docker is installed and running on your machine. -docker run --detach \ - --env MARIADB_USER=pbtest \ - --env MARIADB_PASSWORD=pbtest \ - --env MARIADB_DATABASE=bank_db \ - --env MARIADB_RANDOM_ROOT_PASSWORD=1 \ - --name mariadb-server-test \ - -p 3306:3306 \ - mariadb:latest - -Ensure that the environment variable DB_URL is set to your MariaDB connection string -Example: export DB_URL="mariadb+mariadbconnector://pbtest:pbtest@127.0.0.1:3306/bank_db" -""" @myapp.get("/") def root(): diff --git a/webapi/models/__init__.py b/webapi/models/__init__.py index 09a9abc..bff0f7b 100644 --- a/webapi/models/__init__.py +++ b/webapi/models/__init__.py @@ -1,4 +1,3 @@ -# models/__init__.py from .user import User from .prompts import Prompts From 19ecdcff75d2fd6da0ea64179002ff8da72273b8 Mon Sep 17 00:00:00 2001 From: luisfponce Date: Thu, 5 Mar 2026 14:49:42 -0600 Subject: [PATCH 2/2] chore: revert workflow change --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3271bb6..77561ea 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -35,7 +35,7 @@ jobs: ENV_SECRET_KEY: ${{ secrets.ENV_SECRET_KEY }} run: | cd webapi - if [ -f crud_data_stored.db ]; then rm -f crud_data_stored.db; fi + if [ -f bank_db.db ]; then rm -f bank_db.db; fi pytest tests/test_release.py -v container-smoke-test: