Skip to content

Commit

Permalink
Dfpl 1379 (#4512)
Browse files Browse the repository at this point in the history
* Upgrading app insights to v3 and upgrading to java 17.

* Update app insights terraform.

* Updating Dockerfile

* Deleting test duplicated in UpdateCMOHearingTest shouldThrowExceptionWhenNoHearingFoundForTheCMOId

* Bumping chart version/ fixing aliases

* Correcting resource group names for app insights and key vault

* Correcting app insights name.

* Disable functional tests in preview to test rest of pipeline.

* Move connection string app insights secret creation to main.tf.

* Reinstate functional tests.

* Disable ithc sync with prod

* Undoing change to remove syncing with ithc branch.

---------

Co-authored-by: hmcts-jenkins-d-to-i <62423932+hmcts-jenkins-d-to-i[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 4fe3d11 commit 61b5117
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 45 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
ARG APP_INSIGHTS_AGENT_VERSION=2.6.1
ARG APP_INSIGHTS_AGENT_VERSION=3.4.12

FROM hmctspublic.azurecr.io/base/java:11-distroless
FROM hmctspublic.azurecr.io/base/java:17-distroless

EXPOSE 4000

COPY lib/AI-Agent.xml /opt/app/
COPY build/libs/service.jar /opt/app/

CMD ["service.jar"]
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ plugins {
id 'org.owasp.dependencycheck' version '8.0.2' apply true
}

allprojects {
sourceCompatibility = '11'
targetCompatibility = '11'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion charts/fpl-case-service/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: fpl-case-service
apiVersion: v2
home: https://github.com/hmcts/fpl-ccd-configuration
version: 1.12.56
version: 1.12.57
description: FPL Case Service
maintainers:
- name: HMCTS Family Public Law team
Expand Down
1 change: 1 addition & 0 deletions charts/fpl-case-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ java:
- ctsc-inbox
- ctsc-team-lead-inbox
- AppInsightsInstrumentationKey
- app-insights-connection-string
- scheduler-db-password
- rcj-family-high-court-inbox
- court-to-court-admin-mapping
Expand Down
6 changes: 6 additions & 0 deletions infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ resource "azurerm_key_vault_secret" "AZURE_APPINSGHTS_KEY" {
key_vault_id = module.key-vault.key_vault_id
}

resource "azurerm_key_vault_secret" "AZURE_KEY_VAULT_SECRET" {
name = "app-insights-connection-string"
value = azurerm_application_insights.appinsights.connection_string
key_vault_id = module.key-vault.key_vault_id
}

module "key-vault" {
source = "git@github.com:hmcts/cnp-module-key-vault?ref=master"
name = "fpl-${var.env}"
Expand Down
11 changes: 0 additions & 11 deletions lib/AI-Agent.xml

This file was deleted.

Binary file removed lib/applicationinsights-agent-2.6.1.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions lib/applicationinsights.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"connectionString": "${file:/mnt/secrets/fpl/app-insights-connection-string}",
"role": {
"name": "fpl-ccd-configuration"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,33 +201,6 @@ void shouldPopulateCaseFieldsFromRemovedCMOAndHearingLinkedByLabel() {
NO.getValue());
}

@Test
void shouldThrowAnExceptionIfUniqueHearingNotFound() {
HearingOrder removedOrder = cmo(HEARING_START_DATE);

CaseData caseData = CaseData.builder()
.hearingOrdersBundlesDrafts(List.of(
element(HearingOrdersBundle.builder()
.orders(List.of(
element(TO_REMOVE_ORDER_ID, removedOrder)
)).build())
))
.hearingDetails(List.of(
element(HEARING_ID, hearing(UUID.randomUUID())),
element(ANOTHER_HEARING_ID, hearing(UUID.randomUUID()))
))
.build();

CaseDetailsMap caseDetailsMap = caseDetailsMap(CaseDetails.builder()
.data(Map.of())
.build());

assertThatThrownBy(() -> underTest.populateCaseFields(caseData, caseDetailsMap, TO_REMOVE_ORDER_ID,
removedOrder))
.usingRecursiveComparison()
.isEqualTo(unexpectedNumberOfCMOsRemovedException(TO_REMOVE_ORDER_ID, 2));
}

@Test
void shouldRemoveOrderWhenNoMatchingIDButMatchingHearingLabel() {
LocalDateTime differentStartDate = HEARING_START_DATE.plusDays(3);
Expand Down

0 comments on commit 61b5117

Please sign in to comment.