Skip to content

Commit 662bcc9

Browse files
committed
refactor: rename STREAMING_SERVERLESS with SERVERLESS | [AntonioMrtz#222]
1 parent d759727 commit 662bcc9

31 files changed

+49
-101
lines changed

.github/disabled_workflows/backend-tests-streaming-serverless.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- 'master-*'
88

99
jobs:
10-
run_tests_streaming_serverless:
10+
run_tests_serverless:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
@@ -35,5 +35,5 @@ jobs:
3535
MONGO_URI: mongodb://root:root@localhost:27017/
3636
SECRET_KEY_SIGN: "f24e2f3ac557d487b6d879fb2d86f2b2"
3737
SERVERLESS_FUNCTION_URL: ${{ secrets.SERVERLESS_FUNCTION_URL }}
38-
ARCH: "STREAMING_SERVERLESS"
38+
ARCH: "SERVERLESS"
3939
ENV_VALUE: "PROD"

AWS-Lambda-API/ruff.toml

Lines changed: 0 additions & 50 deletions
This file was deleted.

Backend/.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ SECRET_KEY_SIGN=f24e2f3ac557d487b6d879fb2d86f2b2
55
SERVERLESS_FUNCTION_URL=https://lambda-url.us-east-1.on.aws/path/
66
# PROD,DEV
77
ENV_VALUE=DEV
8-
# BLOB,STREAMING_SERVERLESS
8+
# BLOB,SERVERLESS
99
ARCH=BLOB

Backend/app/common/PropertiesManager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self) -> None:
3232
self.env_variables = [
3333
AppEnvironment.MONGO_URI_ENV_NAME,
3434
AppEnvironment.SECRET_KEY_SIGN_ENV_NAME,
35-
AppEnvironment.SERVERLESS_STREAMING_URL_ENV_NAME,
35+
AppEnvironment.SERVERLESS_URL_ENV_NAME,
3636
AppEnvironment.ENV_VALUE_ENV_NAME,
3737
]
3838
self._load_env_variables(self.env_variables)

Backend/app/common/app_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class AppArchitecture:
5353
"""App architecture constants"""
5454

5555
ARCH_BLOB = "BLOB"
56-
ARCH_STREAMING_SERVERLESS = "STREAMING_SERVERLESS"
56+
ARCH_SERVERLESS = "SERVERLESS"
5757

5858

5959
class AppEnvironment:
@@ -64,5 +64,5 @@ class AppEnvironment:
6464
DEFAULT_ARCHITECTURE = AppArchitecture.ARCH_BLOB
6565
SECRET_KEY_SIGN_ENV_NAME = "SECRET_KEY_SIGN"
6666
MONGO_URI_ENV_NAME = "MONGO_URI"
67-
SERVERLESS_STREAMING_URL_ENV_NAME = "SERVERLESS_FUNCTION_URL"
67+
SERVERLESS_URL_ENV_NAME = "SERVERLESS_FUNCTION_URL"
6868
ENV_VALUE_ENV_NAME = "ENV_VALUE"

Backend/app/logging/logging_constants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
LOGGING_BASE_SONG_SERVICE = "BASE_SONG_SERVICE"
3939
LOGGING_BASE_SONG_REPOSITORY = "BASE_SONG_REPOSITORY"
4040

41-
LOGGING_SONG_AWS_SERVERLESS_REPOSITORY = "SONG_AWS_SERVERLESS_REPOSITORY"
42-
LOGGING_SONG_AWS_SERVERLESS_SERVICE = "SONG_AWS_SERVERLESS_SERVICE"
43-
LOGGING_SONG_AWS_SERVERLESS_SERVICE_VALIDATIONS = "SONG_AWS_SERVERLESS_SERVICE_VALIDATIONS"
41+
LOGGING_SONG_SERVERLESS_REPOSITORY = "SONG_SERVERLESS_REPOSITORY"
42+
LOGGING_SONG_SERVERLESS_SERVICE = "SONG_SERVERLESS_SERVICE"
43+
LOGGING_SONG_SERVERLESS_SERVICE_VALIDATIONS = "SONG_SERVERLESS_SERVICE_VALIDATIONS"
4444

4545
LOGGING_SONG_BLOB_REPOSITORY = "SONG_BLOB_REPOSITORY"
4646
LOGGING_SONG_BLOB_SERVICE = "SONG_BLOB_SERVICE"

Backend/app/spotify_electron/song/providers/song_collection_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_song_collection() -> Collection:
2222
AppArchitecture.ARCH_BLOB: DatabaseConnectionManager.get_collection_connection(
2323
DatabaseCollection.SONG_BLOB_FILE
2424
),
25-
AppArchitecture.ARCH_STREAMING_SERVERLESS: DatabaseConnectionManager.get_collection_connection( # noqa: E501
25+
AppArchitecture.ARCH_SERVERLESS: DatabaseConnectionManager.get_collection_connection( # noqa: E501
2626
DatabaseCollection.SONG_STREAMING
2727
),
2828
}

Backend/app/spotify_electron/song/providers/song_service_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from app.spotify_electron.song.song_service_constants import (
1313
MODULE_PREFIX_NAME,
1414
SONG_SERVICE_BLOB_MODULE_NAME,
15-
SONG_SERVICE_STREAMING_SERVERLESS_MODULE_NAME,
15+
SONG_SERVICE_SERVERLESS_MODULE_NAME,
1616
)
1717

1818

@@ -27,7 +27,7 @@ def init_service(cls) -> None:
2727
cls.logger = SpotifyElectronLogger(LOGGING_SONG_SERVICE_PROVIDER).getLogger()
2828
cls.song_services = {
2929
AppArchitecture.ARCH_BLOB: SONG_SERVICE_BLOB_MODULE_NAME,
30-
AppArchitecture.ARCH_STREAMING_SERVERLESS: SONG_SERVICE_STREAMING_SERVERLESS_MODULE_NAME, # noqa: E501
30+
AppArchitecture.ARCH_SERVERLESS: SONG_SERVICE_SERVERLESS_MODULE_NAME, # noqa: E501
3131
}
3232
cls.create_song_service()
3333

Backend/app/spotify_electron/song/serverless/song_repository.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import app.spotify_electron.song.providers.song_collection_provider as song_collection_provider
99
from app.logging.logging_constants import (
10-
LOGGING_SONG_AWS_SERVERLESS_REPOSITORY,
10+
LOGGING_SONG_SERVERLESS_REPOSITORY,
1111
)
1212
from app.logging.logging_schema import SpotifyElectronLogger
1313
from app.spotify_electron.genre.genre_schema import Genre
@@ -25,9 +25,7 @@
2525
validate_song_exists,
2626
)
2727

28-
song_repository_logger = SpotifyElectronLogger(
29-
LOGGING_SONG_AWS_SERVERLESS_REPOSITORY
30-
).getLogger()
28+
song_repository_logger = SpotifyElectronLogger(LOGGING_SONG_SERVERLESS_REPOSITORY).getLogger()
3129

3230

3331
def get_song(name: str) -> SongDAO:

Backend/app/spotify_electron/song/serverless/song_serverless_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
API to comunicate with AWS Serverless function that handles song files in Cloud
2+
API to comunicate with Serverless function that handles song files in Cloud
33
"""
44

55
from requests import Response, delete, get, post
@@ -15,7 +15,7 @@ def get_song(song_name: str) -> Response:
1515
song_name (str): song name
1616
"""
1717
response = get(
18-
f"{getattr(PropertiesManager,AppEnvironment.SERVERLESS_STREAMING_URL_ENV_NAME)}",
18+
f"{getattr(PropertiesManager,AppEnvironment.SERVERLESS_URL_ENV_NAME)}",
1919
params={
2020
"nombre": song_name,
2121
},
@@ -34,7 +34,7 @@ def create_song(song_name: str, encoded_bytes: str) -> Response:
3434
"file": encoded_bytes,
3535
}
3636
response = post(
37-
f"{getattr(PropertiesManager,AppEnvironment.SERVERLESS_STREAMING_URL_ENV_NAME)}",
37+
f"{getattr(PropertiesManager,AppEnvironment.SERVERLESS_URL_ENV_NAME)}",
3838
json=request_data_body,
3939
params={"nombre": song_name},
4040
)
@@ -48,7 +48,7 @@ def delete_song(song_name: str) -> Response:
4848
song_name (str): song name
4949
"""
5050
response = delete(
51-
f"{getattr(PropertiesManager,AppEnvironment.SERVERLESS_STREAMING_URL_ENV_NAME)}",
51+
f"{getattr(PropertiesManager,AppEnvironment.SERVERLESS_URL_ENV_NAME)}",
5252
params={
5353
"nombre": song_name,
5454
},

0 commit comments

Comments
 (0)