Skip to content

Commit

Permalink
Update Gradle Wrapper from 8.10.2 to 8.11 (#4422)
Browse files Browse the repository at this point in the history
* Bump Gradle Wrapper to the latest version

* Enable parallel config cache + update deprecated usage for Jib

* Formatting changes

---------

Co-authored-by: probation-integration-bot[bot] <177347787+probation-integration-bot[bot]@users.noreply.github.com>
Co-authored-by: Marcus Aspin <[email protected]>
  • Loading branch information
1 parent 69d4abb commit 3e11a25
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class JibConfigPlugin : Plugin<Project> {
"$buildDir/classes",
"$buildDir/generated",
"$buildDir/resources",
project.configurations[jib!!.configurationName.get()].resolvedConfiguration.files
project.configurations[jib!!.configurationName.get()].resolvedConfiguration.resolvedArtifacts.map { it.file }
)
outputs.file("$buildDir/jib-image.id")
outputs.cacheIf { true }
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache.parallel=true
org.gradle.configuration-cache.problems=warn
# Remove the above line once https://github.com/n0mer/gradle-git-properties/pull/235 is released
org.gradle.jvmargs=-Xmx4g "-XX:MaxMetaspaceSize=1g"
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionSha256Sum=57dafb5c2622c6cc08b993c85b7c06956a2f53536432a30ead46166dbca0f1e9
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ fun LdapTemplate.findEmailByUsername(@SpanAttribute username: String) = findAttr

@WithSpan
fun LdapTemplate.findAttributeByUsername(@SpanAttribute username: String, @SpanAttribute attribute: String) = try {
search(query()
.attributes(attribute)
.searchScope(SearchScope.ONELEVEL)
.where("objectclass").`is`("inetOrgPerson")
.and("objectclass").`is`("top")
.and("cn").`is`(username),
search(
query()
.attributes(attribute)
.searchScope(SearchScope.ONELEVEL)
.where("objectclass").`is`("inetOrgPerson")
.and("objectclass").`is`("top")
.and("cn").`is`(username),
AttributesMapper { it[attribute]?.get()?.toString() }
).singleOrNull()
} catch (_: NameNotFoundException) {
Expand All @@ -44,12 +45,13 @@ fun LdapTemplate.findAttributeByUsername(@SpanAttribute username: String, @SpanA

@WithSpan
fun LdapTemplate.getRoles(@SpanAttribute username: String) = try {
search(query()
.attributes("cn")
.base(LdapNameBuilder.newInstance().add("cn", username).build())
.searchScope(SearchScope.ONELEVEL)
.where("objectclass").`is`("NDRole")
.or("objectclass").`is`("NDRoleAssociation"),
search(
query()
.attributes("cn")
.base(LdapNameBuilder.newInstance().add("cn", username).build())
.searchScope(SearchScope.ONELEVEL)
.where("objectclass").`is`("NDRole")
.or("objectclass").`is`("NDRoleAssociation"),
AttributesMapper { it["cn"]?.get()?.toString() }
).filterNotNull()
} catch (_: NameNotFoundException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ class ProbationCaseDataLoader(

personalCircumstanceTypeRepository.saveAll(PersonalCircumstanceGenerator.PC_TYPES)
personalCircumstanceSubTypeRepository.saveAll(PersonalCircumstanceGenerator.PC_SUB_TYPES)
personalCircumstanceRepository.save(PersonalCircumstanceGenerator.generate(
ProbationCaseGenerator.CASE_COMPLEX.id,
PersonalCircumstanceGenerator.PC_TYPES.first { it.code == PersonalCircumstanceType.Code.VETERAN.value },
PersonalCircumstanceGenerator.PC_SUB_TYPES.first { it.description == PersonalCircumstanceType.Code.VETERAN.value + "SUB" }
))
personalCircumstanceRepository.save(
PersonalCircumstanceGenerator.generate(
ProbationCaseGenerator.CASE_COMPLEX.id,
PersonalCircumstanceGenerator.PC_TYPES.first { it.code == PersonalCircumstanceType.Code.VETERAN.value },
PersonalCircumstanceGenerator.PC_SUB_TYPES.first { it.description == PersonalCircumstanceType.Code.VETERAN.value + "SUB" }
))

mutableLimitedAccessPersonRepository.save(RESTRICTED_CASE)
mutableLimitedAccessPersonRepository.save(EXCLUDED_CASE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class DocumentService(
val convictions = convictionDocuments
.groupBy { it.eventId }
.map {
ConvictionDocuments(it.key.toString(),
ConvictionDocuments(
it.key.toString(),
it.value.map { d -> d.toOffenderDocumentDetail() }
.filter { odd -> filter(odd, filterData) })
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ fun DisabilityEntity.toDisability() = Disability(
startDate = startDate
)

fun DocumentEntity?.toPreviousConviction() = PreviousConviction(convictionDate = this?.dateProduced?.toLocalDate(),
fun DocumentEntity?.toPreviousConviction() = PreviousConviction(
convictionDate = this?.dateProduced?.toLocalDate(),
detail = this?.name?.let { ImmutableMap.of("documentName", it) })

fun Person.toProfile(previousConviction: DocumentEntity?) = OffenderProfile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ class Handler(
private fun findStaffIdForEmailAddress(emailAddress: String): Long? {
val matchingStaffIds = try {
ldapTemplate
.search(query()
.attributes("cn")
.searchScope(SearchScope.ONELEVEL)
.where("objectclass").`is`("inetOrgPerson")
.and("objectclass").`is`("top")
.and("mail").`is`(emailAddress),
.search(
query()
.attributes("cn")
.searchScope(SearchScope.ONELEVEL)
.where("objectclass").`is`("inetOrgPerson")
.and("objectclass").`is`("top")
.and("mail").`is`(emailAddress),
AttributesMapper { it["cn"]?.get()?.toString() })
.filterNotNull()
.mapNotNull { staffRepository.findByUserUsername(it)?.id }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class ComplianceService(
return PersonCompliance(
personSummary = summary.toPersonSummary(),
currentSentences = currentSentences.mapNotNull { it.toSentenceCompliance() },
previousOrders = PreviousOrders(breaches = previousOrders.map { breachesForSentence(it.id) }.count(),
previousOrders = PreviousOrders(
breaches = previousOrders.map { breachesForSentence(it.id) }.count(),
count = previousOrders.size,
orders = previousOrders.mapNotNull {
it.disposal?.toOrder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class PersonalDetailsService(
preferredName = person.preferredName,
telephoneNumber = person.telephoneNumber,
mobileNumber = person.mobileNumber,
circumstances = Circumstances(lastUpdated = personalCircumstances.maxOfOrNull { it.lastUpdated },
circumstances = Circumstances(
lastUpdated = personalCircumstances.maxOfOrNull { it.lastUpdated },
circumstances = personalCircumstances.map {
PersonalCircumstance(
it.subType.description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ abstract class ManagerService<T : ManagerBaseEntity>(
staffId = newManager.staff.id,
providerId = newManager.provider.id,
notes =
"""
"""
|Transfer Reason: Internal Transfer
|Transfer Date: ${newManager.startDate.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))}
|From Trust: ${newManager.provider.description}
|From Team: ${oldManager.team.description}
|From Officer: ${oldManager.staff.displayName}
|-------------------------------/${System.lineSeparator()}
|"""
.trimMargin()
.trimMargin()
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionSha256Sum=57dafb5c2622c6cc08b993c85b7c06956a2f53536432a30ead46166dbca0f1e9
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 3e11a25

Please sign in to comment.