Skip to content

Commit

Permalink
Merge branch 'master' into SSCSCI-1347
Browse files Browse the repository at this point in the history
  • Loading branch information
nilay913 authored Nov 27, 2024
2 parents 85863ec + 71e6eeb commit 95442bf
Show file tree
Hide file tree
Showing 66 changed files with 5,173 additions and 1,404 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CI - Integration tests

on:
pull_request:
Expand Down Expand Up @@ -27,7 +27,13 @@ jobs:
with:
distribution: 'temurin'
java-version: 17
- name: Run checks
run: ./gradlew check
- name: Run integration tests
run: ./gradlew integration
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
check_name: Integration Tests results
comment_title: Integration Tests results
files: |
build/test-results/**/*.xml
5 changes: 3 additions & 2 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def secrets = [
's2s-${env}': [
secret('microservicekey-ccd-gw', 'CCD_API_GATEWAY_S2S_SECRET'),
secret('microservicekey-ccd-data', 'CCD_DATA_STORE_S2S_SECRET'),
secret('microservicekey-ccd-definition', 'CCD_DEFINITION_STORE_S2S_SECRET')
secret('microservicekey-ccd-definition', 'CCD_DEFINITION_STORE_S2S_SECRET'),
secret('microservicekey-ccd-admin', 'ADMIN_S2S_KEY')
],
'ccd-${env}': [
secret('ccd-api-gateway-oauth2-client-secret', 'CCD_API_GATEWAY_IDAM_CLIENT_SECRET'),
Expand Down Expand Up @@ -111,7 +112,7 @@ static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
]
}

def branchesToSync = ['demo', 'ithc', 'perftest']
def branchesToSync = ['ithc', 'perftest']

withPipeline(type, product, component) {
def githubApi = new GithubAPI(this)
Expand Down
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Tribunals case api is a spring boot based application to create new appeals for

For versions and complete list of dependencies see build.gradle

* Java 8
* Java 17
* Spring Boot
* Gradle

Expand Down Expand Up @@ -42,16 +42,17 @@ Once the application running locally, please make sure
## Running tribunals with hearings enabled
If you need to test Tribunals with HMC Hearings you must carry out the following steps:
1. First you need to create a pull request on github for your branch
2. The branch should have the labels: enable_keep_helm, pr-values:ccd, and enable_hearings
3. Once this is done you then need to upload a CCD Definition file to AAT CCD. This definition file should have a unique CaseType ID in this format (3575 represents the Pull request number):
2. The branch should have the labels: `enable_keep_helm`, `pr-values:hearings`
3. Once this is done you then need to upload a CCD Definition file to AAT CCD. This definition file should have a unique CaseType ID in this format (4120 represents the Pull request number):

```bash
./bin/create-pr-definition.sh 4120

```
Benefit-3575
```
4. You must ensure the callbacks for the CaseEvents match the service ingress values within your PR's preview chart. Here is an example of a callback URL for a tribunals PR with an id of 3575:
4. You must ensure the callbacks for the CaseEvents match the service ingress values within your PR's preview chart. Here is an example of a callback URL for a tribunals PR with an id of 4120:

```
https://sscs-tribunals-api-pr-3575.preview.platform.hmcts.net/ccdAboutToSubmit
https://sscs-tribunals-api-pr-4120.preview.platform.hmcts.net/ccdAboutToSubmit
```

5. Once this file has been uploaded to AAT, you will need to create a service bus subscription for the HMC hearings topic on AAT. In the Azure portal go to hmc-servicebus-aat and create a subscription for the hmc-to-cft-aat topic,
Expand All @@ -61,27 +62,28 @@ https://sscs-tribunals-api-pr-3575.preview.platform.hmcts.net/ccdAboutToSubmit
hmc-to-sscs-subscription-pr-XXXX
```

6. And on that subscription create a Correlation filter with these values:
6. And on that subscription create a Correlation filters with these values:
```
hmctsServiceId:BBA3
hmctsDeploymentId:deployment-sscs-tribunals-api-pr-xxxx
```

7. Once this has been completed go to values.ccd.preview.template.yaml and enable sscs-hearings-api. you will need to replace
7. Once this has been completed go to values.hearings.preview.template.yaml and you will need to replace

```
```yaml
HMC_HEARINGS_TOPIC_SUBSCRIPTION_NAME: "hmc-to-sscs-subscription-aat"
```
with name of the subscription you have created
With the name of the subscription you have created.

```yaml
HMC_HEARINGS_TOPIC_SUBSCRIPTION_NAME: "hmc-to-sscs-subscription-pr-XXXX"
```
Once this is done you should be able to deploy to preview with hearings enabled.
Note: When you are finished with preview testing remember to delete the uploaded CCD definition from AAT and the subscription created on hmc-to-cft-aat.
ccd-def-cleanup should delete the ccd def file you uploaded, given the enable_keep_helm label is not on your PR.


### Running in Docker(Work in progress...)
Create the image of the application by executing the following command:
Expand Down Expand Up @@ -216,3 +218,7 @@ In order to include Bundling & Hearings tests as part of preview pipeline, QA's
## Gotchas

PRs that start with _"Bump"_ won't have a preview environment. The decision was made after we realised that most the preview environments were created by Depandabot.

### Preview cases not listing
Elastic indices may be missing on preview. They can be recreated by login into ccd admin for e.g. - https://admin-web-sscs-tribunals-api-pr-4091.preview.platform.hmcts.net/ and clicking on "Create Elasticsearch Indices" link.
This would avoid re-triggering the pipeline build and save time.
22 changes: 22 additions & 0 deletions bin/create-pr-definition.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

if [ -z "$1" ]; then
echo "Usage: $0 <CHANGE_ID>"
exit 1
fi

CHANGE_ID=$1

if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
find ./definitions/benefit/sheets/ -type f -exec sed -i '' "s/Benefit/Benefit-$CHANGE_ID/g" {} +
sed -i '' "s/-e \"CCD_DEF_ENV=[^\"]*\"/-e \"CCD_DEF_ENV=${CHANGE_ID}\"/" ./bin/create-xlsx.sh
else
# Linux and other Unix-like systems
find ./definitions/benefit/sheets/ -type f -exec sed -i "s/Benefit/Benefit-$CHANGE_ID/g" {} +
sed -i "s/-e \"CCD_DEF_ENV=[^\"]*\"/-e \"CCD_DEF_ENV=${CHANGE_ID}\"/" ./bin/create-xlsx.sh
fi

./bin/create-xlsx.sh benefit dev pr

git checkout definitions/benefit/sheets bin
7 changes: 2 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,11 @@ repositories {
processResources.dependsOn(generateGitProperties)

project.tasks.named('sonarqube') {
dependsOn test, integration, jacocoTestReport
dependsOn test, jacocoTestReport
}

check.dependsOn integration
checkstyleMain.shouldRunAfter(compileJava)
test.shouldRunAfter(checkstyleTest)
integration.shouldRunAfter(checkstyleIntegrationTest)
integration.shouldRunAfter(test)

sonarqube {
properties {
Expand Down Expand Up @@ -357,7 +354,7 @@ dependencies {

implementation group: 'com.mchange', name: 'c3p0', version: '0.10.1'
implementation group: 'org.flywaydb', name: 'flyway-core', version: '9.22.3'

implementation group: 'com.github.hmcts', name: 'sscs-common', version: 'SSCSCI-1347-SNAPSHOT'
implementation group: 'com.github.hmcts', name: 'sscs-pdf-email-common', version: '5.2.18'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ java:
HMC_API_URL: "http://hmc-cft-hearing-service-aat.service.core-compute-aat.internal"
#Messaging
HMC_HEARINGS_TOPIC_NAME: "hmc-to-cft-aat"
HMC_HEARINGS_TOPIC_SUBSCRIPTION_NAME: "hmc-to-sscs-subscription-pr-3858"
HMC_HEARINGS_TOPIC_SUBSCRIPTION_NAME: "hmc-to-sscs-subscription-pr-4114"
TRIBUNALS_EVENT_QUEUE_NAME: "${SERVICE_NAME}-servicebus-tribunals-to-hearing-api"
TRIBUNALS_EVENT_QUEUE_POLICY_NAME: "RootManageSharedAccessKey"
TRIBUNALS_EVENT_QUEUE_NAMESPACE: "sscs-sb-preview"
Expand Down
12 changes: 11 additions & 1 deletion charts/sscs-tribunals-api/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ java:
SUBMIT_APPEAL_SERVICE_V2_ENABLED: true
PROCESS_EVENT_MESSAGE_V2_ENABLED: true
UPDATE_CASE_ONLY_HEARING_V2_ENABLED: true
# START - SSCS-IB RELEASE VARIABLES
BUNDLE_ENGLISH_CONFIG: sscs-ib-bundle-config.yaml
BUNDLE_EDITED_CONFIG: sscs-ib-bundle-edited-config.yaml
# END - SSCS-IB RELEASE VARIABLES
secrets:
JOB_SCHEDULER_DB_PASSWORD:
secretRef: postgres
Expand Down Expand Up @@ -608,4 +612,10 @@ postgresql:
- name: "pr-${CHANGE_ID}-annotation"
- name: "pr-${CHANGE_ID}-role-assignment"
- name: "pr-${CHANGE_ID}-hmc-cft-hearing-service"
- name: "pr-${CHANGE_ID}-sscs-job-scheduler"
- name: "pr-${CHANGE_ID}-sscs-job-scheduler"

ccd-def-cleanup:
enabled: true
change_id: ${CHANGE_ID}
case_type_ids:
- Benefit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
{"LiveFrom": "01/01/2018", "CaseTypeID": "Benefit", "CaseEventID": "createResponseReceivedTestCase", "AccessProfile": "caseworker-sscs", "CRUD": "R"},
{"LiveFrom": "01/01/2018", "CaseTypeID": "Benefit", "CaseEventID": "createTestCase", "AccessProfile": "caseworker-sscs-systemupdate", "CRUD": "CRUD"},
{"LiveFrom": "01/01/2018", "CaseTypeID": "Benefit", "CaseEventID": "createTestCase", "AccessProfile": "caseworker-sscs", "CRUD": "R"},
{"LiveFrom": "23/11/2022", "CaseTypeID": "Benefit", "CaseEventID": "setHearingRoute", "AccessProfile": "caseworker-sscs-superuser", "CRUD": "CRUD"},
{"LiveFrom": "30/10/2024", "CaseTypeID": "Benefit", "CaseEventID": "addHearingOutcome", "AccessProfile": "caseworker-sscs", "CRUD": "CRUD"},
{"LiveFrom": "30/10/2024", "CaseTypeID": "Benefit", "CaseEventID": "addHearingOutcome", "AccessProfile": "caseworker-sscs-clerk", "CRUD": "CRUD"}
]
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,8 @@
{"LiveFrom": "06/10/2022", "CaseTypeID": "Benefit", "CaseEventID": "setAsideRefused", "AccessProfile": "caseworker-sscs", "CRUD": "R"},
{"LiveFrom": "13/10/2022", "CaseTypeID": "Benefit", "CaseEventID": "setAsideRefusedSOR", "AccessProfile": "caseworker-sscs-systemupdate", "CRUD": "CRUD"},
{"LiveFrom": "06/10/2022", "CaseTypeID": "Benefit", "CaseEventID": "setAsideRefusedSOR", "AccessProfile": "caseworker-sscs", "CRUD": "R"},
{"LiveFrom": "23/11/2022", "CaseTypeID": "Benefit", "CaseEventID": "setHearingRoute", "AccessProfile": "caseworker-sscs-superuser", "CRUD": "CRUD"},
{"LiveFrom": "23/11/2022", "CaseTypeID": "Benefit", "CaseEventID": "setHearingRoute", "AccessProfile": "caseworker-sscs-clerk", "CRUD": "CRUD"},
{"LiveFrom": "09/12/2022", "CaseTypeID": "Benefit", "CaseEventID": "postHearingRequest", "AccessProfile": "caseworker-sscs-dwpresponsewriter", "CRUD": "CRUD"},
{"LiveFrom": "23/11/2022", "CaseTypeID": "Benefit", "CaseEventID": "postHearingRequest", "AccessProfile": "caseworker-sscs-superuser", "CRUD": "CRUD"},
{"LiveFrom": "06/10/2022", "CaseTypeID": "Benefit", "CaseEventID": "postHearingRequest", "AccessProfile": "caseworker-sscs", "CRUD": "R"},
Expand Down
13 changes: 1 addition & 12 deletions definitions/benefit/sheets/CaseEvent/CaseEvent-nonprod.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
[
{
"LiveFrom": "23/11/2022",
"CaseTypeID": "Benefit",
"ID": "setHearingRoute",
"Name": "Set Hearing Route",
"Description": "Set Hearing Route",
"DisplayOrder": 9990,
"PreConditionState(s)": "*",
"PostConditionState": "*",
"SecurityClassification": "Public",
"EventEnablingCondition": "appeal.benefitType.code!=\"infectedBloodCompensation\""
},
{
"LiveFrom": "30/10/2024",
"CaseTypeID": "Benefit",
Expand All @@ -19,6 +7,7 @@
"Description": "Add a hearing outcome",
"DisplayOrder": 140,
"PreConditionState(s)": "dormantAppealState;postHearing;withUT;hearing;readyToList",
"CallBackURLAboutToStartEvent": "${CCD_DEF_TRIBUNALS_API_URL}/ccdAboutToStart",
"PostConditionState": "*",
"ShowEventNotes": "Y",
"SecurityClassification": "Public"
Expand Down
17 changes: 16 additions & 1 deletion definitions/benefit/sheets/CaseEvent/CaseEvent.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
"DisplayOrder": 230,
"PreConditionState(s)": "appealCreated;dormantAppealState;postHearing;withUT;draft;draftArchived;hearing;incompleteApplication;incompleteApplicationInformationReqsted;interlocutoryReviewState;responseReceived;validAppeal;voidState;withDwp;handlingError",
"PostConditionState": "readyToList",
"EventEnablingCondition": "appeal.benefitType.code!=\"infectedBloodCompensation\"",
"ShowEventNotes": "Y",
"SecurityClassification": "Public"
},
Expand Down Expand Up @@ -1733,6 +1734,7 @@
"DisplayOrder": 1250,
"PreConditionState(s)": "*",
"PostConditionState": "readyToList",
"EventEnablingCondition": "appeal.benefitType.code!=\"infectedBloodCompensation\"",
"CallBackURLAboutToSubmitEvent": "${CCD_DEF_TRIBUNALS_API_URL}/ccdAboutToSubmit",
"RetriesTimeoutURLAboutToSubmitEvent": "5,5",
"CallBackURLSubmittedEvent": "${CCD_DEF_TRIBUNALS_API_URL}/send",
Expand Down Expand Up @@ -2249,6 +2251,7 @@
"DisplayOrder": 1640,
"PreConditionState(s)": "notListable",
"PostConditionState": "*",
"EventEnablingCondition": "appeal.benefitType.code!=\"infectedBloodCompensation\"",
"CallBackURLAboutToSubmitEvent": "${CCD_DEF_TRIBUNALS_API_URL}/ccdAboutToSubmit",
"SecurityClassification": "Public",
"ShowSummary": "Y",
Expand All @@ -2263,7 +2266,7 @@
"DisplayOrder": 1650,
"PreConditionState(s)": "*",
"PostConditionState": "*",
"EventEnablingCondition": "appeal.benefitType.code=\"childSupport\" OR appeal.benefitType.code=\"taxCredit\" OR appeal.benefitType.code=\"guardiansAllowance\" OR appeal.benefitType.code=\"taxFreeChildcare\" OR appeal.benefitType.code=\"homeResponsibilitiesProtection\" OR appeal.benefitType.code=\"childBenefit\" OR appeal.benefitType.code=\"thirtyHoursFreeChildcare\" OR appeal.benefitType.code=\"guaranteedMinimumPension\" OR appeal.benefitType.code=\"nationalInsuranceCredits\"",
"EventEnablingCondition": "appeal.benefitType.code=\"childSupport\" OR appeal.benefitType.code=\"taxCredit\" OR appeal.benefitType.code=\"guardiansAllowance\" OR appeal.benefitType.code=\"taxFreeChildcare\" OR appeal.benefitType.code=\"homeResponsibilitiesProtection\" OR appeal.benefitType.code=\"childBenefit\" OR appeal.benefitType.code=\"thirtyHoursFreeChildcare\" OR appeal.benefitType.code=\"guaranteedMinimumPension\" OR appeal.benefitType.code=\"nationalInsuranceCredits\" OR appeal.benefitType.code=\"infectedBloodCompensation\"",
"CallBackURLAboutToSubmitEvent": "${CCD_DEF_TRIBUNALS_API_URL}/ccdAboutToSubmit",
"CallBackURLSubmittedEvent": "${CCD_DEF_TRIBUNALS_API_URL}/send",
"ShowEventNotes": "Y",
Expand Down Expand Up @@ -2953,6 +2956,18 @@
"CallBackURLSubmittedEvent": "${CCD_DEF_TRIBUNALS_API_URL}/send",
"SecurityClassification": "Public"
},
{
"LiveFrom": "23/11/2022",
"CaseTypeID": "Benefit",
"ID": "setHearingRoute",
"Name": "Set Hearing Route",
"Description": "Set Hearing Route",
"DisplayOrder": 500,
"PreConditionState(s)": "*",
"PostConditionState": "*",
"SecurityClassification": "Public",
"EventEnablingCondition": "appeal.benefitType.code=\"infectedBloodCompensation\""
},
{
"LiveFrom": "23/11/2022",
"CaseTypeID": "Benefit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
"ID": "hearingOutcomeValueDidPoAttendHearing",
"DisplayContext": "MANDATORY",
"LiveFrom": "30/10/2024",
"FieldDisplayOrder": 1
"FieldDisplayOrder": 2
},
{
"CaseEventID": "addHearingOutcome",
"CaseFieldID": "hearingOutcomeValue",
"ListElementCode": "completedHearings",
"ID": "hearingOutcomeValueCompletedHearings",
"DisplayContext": "MANDATORY",
"LiveFrom": "28/10/2024",
"FieldDisplayOrder": 3
}
]
Loading

0 comments on commit 95442bf

Please sign in to comment.