Skip to content

Commit 7df5f8f

Browse files
Fix: [AEA-5861] - Temp fully disable activity code B0401 (#1429)
## Summary - Routine Change - ⚠️ Potential issues that might be caused by this change ### Details - Temporarily fully disabled access for activity code B0401, any associated baseline role codes and any child activity codes - Updates regression test tag --------- Co-authored-by: jonathanwelch1-nhs <[email protected]>
1 parent 466a9e1 commit 7df5f8f

File tree

3 files changed

+43
-40
lines changed

3 files changed

+43
-40
lines changed

.github/workflows/run_regression_tests.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -68,37 +68,37 @@ jobs:
6868
VERSION_NUMBER: ${{ inputs.VERSION_NUMBER }}
6969
GITHUB-TOKEN: ${{ steps.generate-token.outputs.token }}
7070
run: |
71-
if [[ "$TARGET_ENVIRONMENT" != "prod" && "$TARGET_ENVIRONMENT" != "ref" ]]; then
72-
REGRESSION_TEST_REPO_TAG="v3.4.12" # This is the tag or branch of the regression test code to run, usually a version tag like v3.1.0 or a branch name
73-
REGRESSION_TEST_WORKFLOW_TAG="v3.4.12" # This is the tag of the github workflow to run, usually the same as REGRESSION_TEST_REPO_TAG
71+
if [[ "$TARGET_ENVIRONMENT" != "prod" && "$TARGET_ENVIRONMENT" != "ref" ]]; then
72+
REGRESSION_TEST_REPO_TAG="v3.4.24" # This is the tag or branch of the regression test code to run, usually a version tag like v3.1.0 or a branch name
73+
REGRESSION_TEST_WORKFLOW_TAG="v3.4.24" # This is the tag of the github workflow to run, usually the same as REGRESSION_TEST_REPO_TAG
7474
75-
if [[ -z "$REGRESSION_TEST_REPO_TAG" || -z "$REGRESSION_TEST_WORKFLOW_TAG" ]]; then
76-
echo "Error: One or both tag variables are not set" >&2
77-
exit 1
78-
fi
75+
if [[ -z "$REGRESSION_TEST_REPO_TAG" || -z "$REGRESSION_TEST_WORKFLOW_TAG" ]]; then
76+
echo "Error: One or both tag variables are not set" >&2
77+
exit 1
78+
fi
7979
80-
# HELPER IF STATEMENT - It will automatically determine the correct Git URL to use based on the REGRESSION_TEST_WORKFLOW_TAG value
81-
if [[ "$REGRESSION_TEST_WORKFLOW_TAG" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
82-
echo "REGRESSION_TEST_WORKFLOW_TAG is a version tag, using tag link"
83-
curl "https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/tags/${REGRESSION_TEST_WORKFLOW_TAG}/scripts/run_regression_tests.py" -o run_regression_tests.py
84-
else
85-
echo "REGRESSION_TEST_WORKFLOW_TAG doesn't look like a version tag, using branch link"
86-
curl "https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/heads/${REGRESSION_TEST_REPO_TAG}/scripts/run_regression_tests.py" -o run_regression_tests.py
87-
fi
80+
# HELPER IF STATEMENT - It will automatically determine the correct Git URL to use based on the REGRESSION_TEST_WORKFLOW_TAG value
81+
if [[ "$REGRESSION_TEST_WORKFLOW_TAG" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
82+
echo "REGRESSION_TEST_WORKFLOW_TAG is a version tag, using tag link"
83+
curl "https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/tags/${REGRESSION_TEST_WORKFLOW_TAG}/scripts/run_regression_tests.py" -o run_regression_tests.py
84+
else
85+
echo "REGRESSION_TEST_WORKFLOW_TAG doesn't look like a version tag, using branch link"
86+
curl "https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/heads/${REGRESSION_TEST_REPO_TAG}/scripts/run_regression_tests.py" -o run_regression_tests.py
87+
fi
8888
89-
if [[ ! -f run_regression_tests.py ]]; then
90-
echo "Error: run_regression_tests.py not found" >&2
91-
exit 1
92-
fi
89+
if [[ ! -f run_regression_tests.py ]]; then
90+
echo "Error: run_regression_tests.py not found" >&2
91+
exit 1
92+
fi
9393
94-
poetry install
95-
echo Running regression tests in the "$TARGET_ENVIRONMENT" environment
96-
poetry run python -u run_regression_tests.py \
97-
--env="$TARGET_ENVIRONMENT" \
98-
--pr_label="$VERSION_NUMBER" \
99-
--token=${{ steps.generate-token.outputs.token }} \
100-
--is_called_from_github=true \
101-
--product=CPTS-UI \
102-
--regression_test_repo_tag "${REGRESSION_TEST_REPO_TAG}" \
103-
--regression_test_workflow_tag "${REGRESSION_TEST_WORKFLOW_TAG}"
104-
fi
94+
poetry install
95+
echo Running regression tests in the "$TARGET_ENVIRONMENT" environment
96+
poetry run python -u run_regression_tests.py \
97+
--env="$TARGET_ENVIRONMENT" \
98+
--pr_label="$VERSION_NUMBER" \
99+
--token=${{ steps.generate-token.outputs.token }} \
100+
--is_called_from_github=true \
101+
--product=CPTS-UI \
102+
--regression_test_repo_tag "${REGRESSION_TEST_REPO_TAG}" \
103+
--regression_test_workflow_tag "${REGRESSION_TEST_WORKFLOW_TAG}"
104+
fi

packages/common/dynamoFunctions/src/rbacHierarchy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ const B0429: ActivityCode = {
226226
childActivityCodes: {}
227227
}
228228

229+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
229230
const B0401: ActivityCode = {
230231
baselineRoleCodes: [
231232
"R0260", "R0270", "R6200", "R6300", "R0370",
@@ -245,7 +246,7 @@ const B0401: ActivityCode = {
245246
}
246247
}
247248

248-
export const rbacHierarchy: RBACHierarchy = {B0570, B0278, B0401}
249+
export const rbacHierarchy: RBACHierarchy = {B0570, B0278/*, B0401*/} // temp disable all of B0401
249250

250251
const extractAccessCodes = (activityCode: ActivityCode): Array<Array<string>> => {
251252
let acceptedRoleCodes: Array<string> = []

packages/common/dynamoFunctions/tests/userUtils.test.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,15 @@ describe("extractRoleInformation", () => {
289289
role_name: "User Role",
290290
activity_codes: ["B0278"] // Also has access
291291
},
292-
{
293-
org_code: "ORG2",
294-
person_orgid: "PORG2",
295-
person_roleid: "ROLE2",
296-
role_code: "S000:G000:RC3",
297-
role_name: "User Role",
298-
activity_codes: ["B0401"] // Also has access
299-
},
292+
//TODO: remove or reinstate depending on decision on B0401
293+
// {
294+
// org_code: "ORG2",
295+
// person_orgid: "PORG2",
296+
// person_roleid: "ROLE2",
297+
// role_code: "S000:G000:RC3",
298+
// role_name: "User Role",
299+
// activity_codes: ["B0401"] // Also has access
300+
// },
300301
{
301302
org_code: "ORG3",
302303
person_orgid: "PORG3",
@@ -326,7 +327,8 @@ describe("extractRoleInformation", () => {
326327
const result = extractRoleInformation(mockUserInfo, selectedRoleId, mockLogger as Logger)
327328

328329
// Verify roles with access (should include B0570, B0278 and B0401)
329-
expect(result.roles_with_access).toHaveLength(3)
330+
// expect(result.roles_with_access).toHaveLength(3) //TODO: remove or reinstate depending on decision on B0401
331+
expect(result.roles_with_access).toHaveLength(2)
330332
expect(result.roles_without_access).toHaveLength(1)
331333
})
332334

0 commit comments

Comments
 (0)