Skip to content

Commit

Permalink
chore(spotless): upgrade spinnaker gradle plugin (#910)
Browse files Browse the repository at this point in the history
This includes updates to google-java-format and ktlint, so requires some
formatting changes. These were made with a simple `./gradlew spotlessApply`.
  • Loading branch information
plumpy committed Jul 27, 2020
1 parent 586d5d1 commit 0378e6a
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ public void run() {
"Starting deletion of dangling service accounts ({})", this.getClass().getSimpleName());

Set<String> serviceAccountsToKeep =
pipelineDAO
.all()
.parallelStream()
pipelineDAO.all().parallelStream()
.flatMap(
pipeline ->
pipeline.getTriggers().stream()
Expand All @@ -73,9 +71,7 @@ public void run() {
.distinct())
.collect(Collectors.toSet());

serviceAccountDAO
.all()
.parallelStream()
serviceAccountDAO.all().parallelStream()
.map(ServiceAccount::getName)
.filter(isManagedServiceAccount())
.filter(serviceAccount -> !serviceAccountsToKeep.contains(serviceAccount))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ public void run() {
serviceAccountDAO.all().stream()
.collect(Collectors.toMap(ServiceAccount::getName, Function.identity()));

pipelineDAO
.all()
.parallelStream()
pipelineDAO.all().parallelStream()
.filter(p -> p.getTriggers().stream().anyMatch(this::hasManualServiceUser))
.forEach(pipeline -> migrate(pipeline, serviceAccounts));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ class CompositeStorageService(
try {
return primary.listObjectVersions(objectType, objectKey, maxResults)
} catch (e: NotFoundException) {
log.debug("{}.listObjectVersions({}, {}, {}) not found (primary)",
log.debug(
"{}.listObjectVersions({}, {}, {}) not found (primary)",
primary.javaClass.simpleName,
objectType,
objectKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ class SqlStorageService(
)
}

log.debug("Took {}ms to fetch {} objects for {}",
log.debug(
"Took {}ms to fetch {} objects for {}",
timeToLoadObjects,
objects.size,
objectType
Expand Down Expand Up @@ -297,7 +298,8 @@ class SqlStorageService(
objectKeys.put(resultSet.getString(1), resultSet.getLong(2))
}

log.debug("Took {}ms to fetch {} object keys for {}",
log.debug(
"Took {}ms to fetch {} object keys for {}",
System.currentTimeMillis() - startTime,
objectKeys.size,
objectType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,24 @@ internal val retrySupport = RetrySupport()
* Run the provided [fn] in a transaction.
*/
internal fun DSLContext.transactional(retryProperties: RetryProperties, fn: (DSLContext) -> Unit) {
retrySupport.retry({
transaction { ctx ->
fn(DSL.using(ctx))
}
}, retryProperties.maxRetries, retryProperties.backoffMs, false)
retrySupport.retry(
{
transaction { ctx ->
fn(DSL.using(ctx))
}
},
retryProperties.maxRetries, retryProperties.backoffMs, false
)
}

/**
* Run the provided [fn] with retry support.
*/
internal fun <T> DSLContext.withRetry(retryProperties: RetryProperties, fn: (DSLContext) -> T): T {
return retrySupport.retry({
fn(this)
}, retryProperties.maxRetries, retryProperties.backoffMs, false)
return retrySupport.retry(
{
fn(this)
},
retryProperties.maxRetries, retryProperties.backoffMs, false
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import strikt.assertions.isA
@SpringBootTest(
classes = [CompositeStorageServiceConfigurationTestApp::class],
properties = ["spring.application.name=front50"]
)
)
internal class CompositeStorageServiceConfigurationTests {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ internal object SqlStorageServiceTests : JUnit5Minutests {
fun tests() = rootContext<JooqConfig> {

fixture {
JooqConfig(SQLDialect.MYSQL, "jdbc:tc:mysql:5.7.22://somehostname:someport/databasename")
JooqConfig(SQLDialect.MYSQL, "jdbc:tc:mysql:5.7.22://somehostname:someport/databasename")
}

context("mysql CRUD operations") {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fiatVersion=1.22.0
includeProviders=azure,gcs,oracle,redis,s3,swift,sql
korkVersion=7.56.0
org.gradle.parallel=true
spinnakerGradleVersion=8.3.0
spinnakerGradleVersion=8.4.0

# To enable a composite reference to a project, set the
# project property `'<projectName>Composite=true'`.
Expand Down

0 comments on commit 0378e6a

Please sign in to comment.