Skip to content

Commit 2210a5a

Browse files
authored
Merge pull request #564 from NHSDigital/release/2025-04-01
Release/2025 04 01
2 parents 00461af + 3e50e73 commit 2210a5a

File tree

20 files changed

+74
-83
lines changed

20 files changed

+74
-83
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2025-04-01
4+
- [PI-848] Add info box to swaager explaining prodID usage in non-prod envs
5+
- [PI-870] Sonarcloud fixes
6+
37
## 2025-03-31
48
- [PI-835] Clean up deployment policies
59
- [PI-861] Remove SDS secret access

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025.03.31
1+
2025.04.01

changelog/2025-04-01.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [PI-848] Add info box to swaager explaining prodID usage in non-prod envs
2+
- [PI-870] Sonarcloud fixes

infrastructure/swagger/02_info.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ info:
1010
name: MIT
1111
url: https://github.com/NHSDigital/connecting-party-manager/blob/main/LICENCE.md
1212
description: |
13+
<div class="nhsd-m-emphasis-box nhsd-m-emphasis-box--emphasis nhsd-!t-margin-bottom-6" aria-label="Highlighted Information">
14+
<div class="nhsd-a-box nhsd-a-box--border-blue">
15+
<div class="nhsd-m-emphasis-box__image-box">
16+
<figure class="nhsd-a-image">
17+
<picture class="nhsd-a-image__picture">
18+
<img src="http://digital.nhs.uk/binaries/content/gallery/icons/info.svg?colour=231f20" alt="" style="object-fit:fill">
19+
</picture>
20+
</figure>
21+
</div>
22+
<div class="nhsd-m-emphasis-box__content-box">
23+
<div data-uipath="website.contentblock.emphasis.content" class="nhsd-t-word-break"><p class="nhsd-t-body">Product IDs created in non-production environments follow the same format as production, but are only valid in the environment in which they were created.</p></div>
24+
</div>
25+
</div>
26+
</div>
27+
<hr class="nhsd-a-horizontal-rule">
28+
1329
## Overview
1430
1531
Use this API to access the Connecting Party Manager (CPM) service - an internal service for registering and managing details of IT systems and applications that connect to our APIs – sometimes known as ‘connecting parties’ and referred to herein as ‘products’.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "connecting-party-manager"
3-
version = "2025.03.31"
3+
version = "2025.04.01"
44
description = "Repository for the Connecting Party Manager API and related services"
55
authors = ["NHS England"]
66
license = "LICENSE.md"

src/api/tests/feature_tests/environment.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,6 @@ def before_feature(context: Context, feature: Feature):
8282
name=feature.name,
8383
description=" ".join(feature.description),
8484
)
85-
cpm_scenarios = [
86-
"Create Product Team - success scenarios",
87-
"Create Product Team - failure scenarios",
88-
"Read Product Team - success scenarios",
89-
"Read Product Team - failure scenarios",
90-
"Delete Product Team - success scenarios",
91-
"Delete Product Team - failure scenarios",
92-
"Create CPM Product - success scenarios",
93-
"Create CPM Product - failure scenarios",
94-
"Read CPM Product - success scenarios",
95-
"Read CPM Product - failure scenarios",
96-
"Delete CPM Product - success scenarios",
97-
"Delete CPM Product - failure scenarios",
98-
"Search Products - success scenarios",
99-
"Search Products - failures scenarios",
100-
]
10185
if context.test_mode is TestMode.INTEGRATION:
10286
table = "dynamodb_cpm_table_name.value"
10387
context.table_name = read_terraform_output(table)

src/api/tests/feature_tests/steps/context.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from contextlib import AbstractContextManager
22
from dataclasses import dataclass
3+
from typing import Optional
34

45
from behave.model import Table
56
from behave.runner import Context as BehaveContext
@@ -17,19 +18,19 @@
1718
@dataclass
1819
class Context(BehaveContext):
1920
base_url: str
20-
headers: dict[str, dict[str, str]] = None
21-
response: Response = None
22-
table: Table = None
23-
test_mode: TestMode = None
24-
table_name: str = None
25-
session: AbstractContextManager = None
26-
dynamodb_client: DynamoDBClient = None
27-
workspace: str = None
28-
environment: str = None
29-
workspace_type: str = None
30-
api_key: str = None
31-
notes: dict[str, str] = None
32-
postman_endpoint: str = None
21+
headers: Optional[dict[str, dict[str, str]]]
22+
response: Optional[Response]
23+
table: Optional[Table]
24+
test_mode: Optional[TestMode]
25+
table_name: Optional[str]
26+
session: Optional[AbstractContextManager]
27+
dynamodb_client: Optional[DynamoDBClient]
28+
workspace: Optional[str]
29+
environment: Optional[str]
30+
workspace_type: Optional[str]
31+
api_key: Optional[str]
32+
notes: Optional[dict[str, str]]
33+
postman_endpoint: Optional[str]
3334

3435
postman_collection: PostmanCollection = None
3536
postman_feature: PostmanItem = None

src/api/tests/feature_tests/steps/requests.py

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json as _json
2-
import time
32
from contextlib import contextmanager
43
from dataclasses import dataclass
54
from unittest import mock
@@ -9,7 +8,6 @@
98
from domain.response.aws_lambda_response import AwsLambdaResponse
109
from event.json import json_loads
1110
from requests import HTTPError, Response, request
12-
from requests.exceptions import SSLError
1311

1412
from api.tests.feature_tests.steps.data import DUMMY_CONTEXT
1513
from api.tests.feature_tests.steps.endpoint_lambda_mapping import (
@@ -35,21 +33,6 @@ def _parse_url(base_url: str, endpoint: str) -> str:
3533
return url
3634

3735

38-
@contextmanager
39-
def retry_on_ssl_error(sleep_time: int = 3, max_retries=5):
40-
retries = 0
41-
while True:
42-
try:
43-
yield
44-
except SSLError:
45-
if retries == max_retries:
46-
raise
47-
time.sleep(sleep_time)
48-
retries += 1
49-
finally:
50-
break
51-
52-
5336
def make_request(
5437
base_url: str,
5538
http_method: str,
@@ -62,10 +45,9 @@ def make_request(
6245
json = body if type(body) is dict else None
6346
data = None if type(body) is dict else body
6447

65-
with retry_on_ssl_error():
66-
response = request(
67-
method=http_method, url=url, headers=headers, json=json, data=data
68-
)
48+
response = request(
49+
method=http_method, url=url, headers=headers, json=json, data=data
50+
)
6951

7052
if raise_for_status:
7153
try:

src/layers/api_utils/api_step_chain/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from types import ModuleType
22

3-
from api_utils.versioning.constants import VERSIONING_STEP_ARGS
3+
from api_utils.versioning.constants import VersioningStepArgs
44
from api_utils.versioning.steps import (
55
get_largest_possible_version,
66
get_steps_for_requested_version,
@@ -27,8 +27,8 @@ def execute_step_chain(
2727
)
2828
version_chain.run(
2929
init={
30-
VERSIONING_STEP_ARGS.EVENT: event,
31-
VERSIONING_STEP_ARGS.VERSIONED_STEPS: versioned_steps,
30+
VersioningStepArgs.EVENT: event,
31+
VersioningStepArgs.VERSIONED_STEPS: versioned_steps,
3232
}
3333
)
3434

src/layers/api_utils/versioning/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
VERSION_RE = re.compile(r"^v(\d+)$")
44

55

6-
class VERSIONING_STEP_ARGS:
6+
class VersioningStepArgs:
77
VERSIONED_STEPS = "versioned_steps"
88
EVENT = "event"

0 commit comments

Comments
 (0)