Skip to content

Commit 3c6d492

Browse files
NRL-1948 Renamed logs to better reflect what's being logged and removed comments
1 parent c982ea8 commit 3c6d492

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ publish-ci-image: ## Publish the CI image
105105

106106
test: check-warn ## Run the unit tests
107107
@echo "Running unit tests"
108-
PYTHONPATH=. poetry run pytest --ignore tests/smoke -k "not beefy" $(TEST_ARGS)
108+
PYTHONPATH=. poetry run pytest --ignore tests/smoke $(TEST_ARGS)
109109

110110
test-features-integration: check-warn ## Run the BDD feature tests in the integration environment
111111
@echo "Running feature tests in the integration environment ${TF_WORKSPACE_NAME}"

layer/nrlf/core/authoriser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_pointer_permissions_v2(
2626
app_id = connection_metadata.nrl_app_id
2727

2828
key = f"{producer_or_consumer}/{app_id}/{ods_code}.json"
29-
logger.log(LogReference.S3PERMISSIONS011, key=key)
29+
logger.log(LogReference.V2PERMISSIONS011, key=key)
3030

3131
file_path = f"{lookup_path}/{key}"
3232

@@ -36,7 +36,7 @@ def get_pointer_permissions_v2(
3636
pointer_permissions = json.load(file)
3737
except Exception as exc:
3838
logger.log(
39-
LogReference.S3PERMISSIONS014,
39+
LogReference.V2PERMISSIONS014,
4040
exc_info=sys.exc_info(),
4141
stacklevel=5,
4242
error=str(exc),
@@ -107,7 +107,7 @@ def parse_permissions_file(
107107
pointer_types = json.load(file)
108108
except Exception as exc:
109109
logger.log(
110-
LogReference.S3PERMISSIONS005, # not s3 tho?
110+
LogReference.S3PERMISSIONS005,
111111
exc_info=sys.exc_info(),
112112
stacklevel=5,
113113
error=str(exc),

layer/nrlf/core/log_references.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class LogReference(Enum):
7070
"WARN", "An unhandled exception occurred whilst handling response headers"
7171
)
7272

73-
# S3 Permissions Lookup Logs
73+
# S3 / Embedded Permissions Lookup Logs
7474
S3PERMISSIONS001 = _Reference("INFO", "Retrieving pointer types from S3 bucket")
7575
S3PERMISSIONS002 = _Reference("INFO", "Retrieved list of pointer types from S3")
7676
S3PERMISSIONS003 = _Reference("WARN", "No permissions file found in S3")
@@ -79,21 +79,22 @@ class LogReference(Enum):
7979
)
8080
S3PERMISSIONS005 = _Reference(
8181
"EXCEPTION",
82-
"An error occurred whilst parsing embedded permissions files from S3",
82+
"An error occurred whilst parsing embedded permissions files",
8383
)
84-
# S3 Permissions Lookup Logs - v2 permissions
85-
S3PERMISSIONS011 = _Reference(
84+
85+
# V2 Embedded Permissions Lookup Logs
86+
V2PERMISSIONS011 = _Reference(
8687
"INFO", "Retrieving v2 pointer permissions from lambda layer"
8788
)
88-
S3PERMISSIONS012 = _Reference(
89+
V2PERMISSIONS012 = _Reference(
8990
"INFO", "Retrieved v2 pointer permissions from lambda layer"
9091
)
91-
S3PERMISSIONS013 = _Reference(
92+
V2PERMISSIONS013 = _Reference(
9293
"WARN", "No v2 permissions file found in lambda layer"
9394
)
94-
S3PERMISSIONS014 = _Reference(
95+
V2PERMISSIONS014 = _Reference(
9596
"EXCEPTION",
96-
"An error occurred whilst retrieving v2 pointer permissions ",
97+
"An error occurred whilst retrieving v2 pointer permissions",
9798
)
9899

99100
# Parse Logs

layer/nrlf/core/tests/test_authoriser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_authoriser_get_v2_permissions_with_pointer_types(mocker):
3838

3939
assert result.get("types") == ["http://snomed.info/sct|736253001"]
4040

41-
spy.assert_called_with(LogReference.S3PERMISSIONS011, key=expected_lookup_key)
41+
spy.assert_called_with(LogReference.V2PERMISSIONS011, key=expected_lookup_key)
4242

4343

4444
def test_authoriser_parse_v2_permission_file_with_no_permission_file(mocker):
@@ -55,4 +55,4 @@ def test_authoriser_parse_v2_permission_file_with_no_permission_file(mocker):
5555

5656
assert metadata_result == {}
5757

58-
spy.assert_any_call(LogReference.S3PERMISSIONS011, key=expected_lookup_key)
58+
spy.assert_any_call(LogReference.V2PERMISSIONS011, key=expected_lookup_key)

0 commit comments

Comments
 (0)