Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleJamesWalker committed May 10, 2019
2 parents 4a01282 + 43e42fb commit 2a8ed43
Show file tree
Hide file tree
Showing 177 changed files with 1,689 additions and 1,003 deletions.
118 changes: 40 additions & 78 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,107 +14,81 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

buildscript {
ext {
korkVersion = "5.2.6"
fiatVersion = "1.0.4"
kotlinVersion = "1.3.10"
junitPlatformVersion = "1.0.2"
}

repositories {
jcenter()
maven { url "https://spinnaker.bintray.com/gradle" }
maven { url "https://plugins.gradle.org/m2/" }
}

dependencies {
classpath 'com.netflix.spinnaker.gradle:spinnaker-dev-plugin:5.2.1'
classpath "org.junit.platform:junit-platform-gradle-plugin:${junitPlatformVersion}"
classpath 'com.netflix.spinnaker.gradle:spinnaker-dev-plugin:6.0.0'
if (Boolean.valueOf(enablePublishing)) {
classpath "com.netflix.spinnaker.gradle:spinnaker-gradle-project:6.0.0"
}
classpath "com.netflix.nebula:nebula-kotlin-plugin:$kotlinVersion"
classpath "org.junit.platform:junit-platform-gradle-plugin:${junitPlatformVersion}"

}
}

allprojects {
group = "com.netflix.spinnaker.clouddriver"
apply plugin: 'spinnaker.base-project'
apply plugin: 'groovy'

ext {
spinnakerDependenciesVersion = '1.44.1'
if (project.hasProperty('spinnakerDependenciesVersion')) {
spinnakerDependenciesVersion = project.property('spinnakerDependenciesVersion')
}
if (Boolean.valueOf(enablePublishing)) {
apply plugin: 'spinnaker.project'
}
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: 'nebula.kotlin'

def checkLocalVersions = [spinnakerDependenciesVersion: spinnakerDependenciesVersion]
if (ext.has('versions')) {
def extVers = ext.get('versions')
if (extVers instanceof Map) {
checkLocalVersions.putAll(extVers)
}
}
sourceSets.main.java.srcDirs = []
sourceSets.main.groovy.srcDirs += ["src/main/java"]

def localVersions = checkLocalVersions.findAll { it.value.endsWith('-SNAPSHOT') }
if (localVersions) {
logger.info("Enabling mavenLocal repo for $localVersions")
repositories {
mavenLocal()
}
}
dependencies {
implementation platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")

spinnaker {
dependenciesVersion = spinnakerDependenciesVersion
annotationProcessor platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")
annotationProcessor "org.projectlombok:lombok"
testAnnotationProcessor platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")
testAnnotationProcessor "org.projectlombok:lombok"
}

test {
testLogging {
exceptionFormat = 'full'
}
if (project.hasProperty('slowTest')) {
long slow = 250
try {
slow = Long.parseLong(project.property('slowTest'))
} catch (Exception ex) {
}
afterTest { desc, result ->
long duration = result.getEndTime() - result.getStartTime()
if (duration > slow) {
logger.warn("test exceeded $slow ms: $desc.className :: $desc.name ($duration milliseconds)")
if (project.hasProperty('slowTest')) {
long slow = 250
try {
slow = Long.parseLong(project.property('slowTest'))
} catch (Exception ex) {
}
afterTest { desc, result ->
long duration = result.getEndTime() - result.getStartTime()
if (duration > slow) {
logger.warn("test exceeded $slow ms: $desc.className :: $desc.name ($duration milliseconds)")
}
}
}
minHeapSize = "512m"
maxHeapSize = "512m"
}
minHeapSize = "512m"
maxHeapSize = "512m"
}
}

subprojects { project ->

configurations {
all {
exclude group: 'javax.servlet', module: 'servlet-api'
exclude group: 'javax.ws.rs', module: 'jsr311-api'
resolutionStrategy {
force 'org.antlr:antlr-runtime:3.5.2'
eachDependency {
if (it.requested.group == 'asm' || it.requested.group == 'org.ow2.asm') {
it.useTarget group: 'org.ow2.asm', name: 'asm-all', version: '5.0.3'
}
if (it.requested.group == 'junit') {
it.useTarget group: 'junit', name: 'junit', version: '4.12'
}
if (it.requested.group == 'cglib' || it.requested.name == 'cglib') {
it.useTarget group: 'cglib', name: 'cglib', version: '3.2.0'
}
if (it.requested.group == 'antlr') {
it.useTarget group: 'org.antlr', name: it.requested.name, version: '3.5.2'
}
if (it.requested.group == 'org.apache.xbean') {
it.useVersion '4.3'
}
if (it.requested.group == 'ch.qos.logback') {
it.useVersion '1.2.3'
}
}
}
if ([korkVersion, fiatVersion].any { it.endsWith("-SNAPSHOT") }) {
logger.info("Enabling mavenLocal")
repositories {
mavenLocal()
}
}

Expand All @@ -123,18 +97,6 @@ subprojects { project ->
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7102'
}
}

dependencies {
compile spinnaker.dependency('groovy')
spinnaker.group('test')
}

//c&p this because NetflixOss reverts it to 1.7 and ends up getting applied last..
project.plugins.withType(JavaBasePlugin) {
JavaPluginConvention convention = project.convention.getPlugin(JavaPluginConvention)
convention.sourceCompatibility = JavaVersion.VERSION_1_8
convention.targetCompatibility = JavaVersion.VERSION_1_8
}
}

defaultTasks ':clouddriver-web:run'
14 changes: 10 additions & 4 deletions cats/cats-core/cats-core.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
dependencies {
compile spinnaker.dependency('slf4jApi')
compile spinnaker.dependency('jacksonAnnotations')
compileOnly spinnaker.dependency("lombok")
implementation "org.slf4j:slf4j-api"
implementation "com.fasterxml.jackson.core:jackson-annotations"
implementation "org.codehaus.groovy:groovy-all"

testCompile project(":cats:cats-test")
compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"

testImplementation project(":cats:cats-test")

testImplementation "org.spockframework:spock-core"
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class DefaultNodeIdentity implements NodeIdentity {
public static final String UNKNOWN_HOST = "UnknownHost";
private static final long REFRESH_INTERVAL = TimeUnit.SECONDS.toMillis(30);

@SuppressWarnings("PMD.EmptyCatchBlock")
private static String getHostName(String validationHost, int validationPort) {
final Enumeration<NetworkInterface> interfaces;
try {
Expand Down
18 changes: 13 additions & 5 deletions cats/cats-dynomite/cats-dynomite.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
dependencies {
compile project(':cats:cats-redis')
compile("com.netflix.spinnaker.kork:kork-dynomite:${spinnaker.version("kork")}")
compile('net.jodah:failsafe:1.0.4')
implementation project(":cats:cats-redis")
implementation project(":cats:cats-core")

testCompile project(':cats:cats-test')
testCompile spinnaker.dependency('korkJedisTest')
implementation "com.netflix.spinnaker.kork:kork-dynomite"
implementation "net.jodah:failsafe:1.0.4"

compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"

testImplementation project(":cats:cats-test")
testImplementation "com.netflix.spinnaker.kork:kork-jedis-test"

testImplementation "org.spockframework:spock-core"
}
23 changes: 16 additions & 7 deletions cats/cats-redis/cats-redis.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
dependencies {
compile project(':cats:cats-core')
compile spinnaker.dependency('eurekaClient')
compile spinnaker.dependency('guava')
compile "com.netflix.spinnaker.kork:kork-jedis:${spinnaker.version("kork")}"
compile "com.fasterxml.jackson.core:jackson-databind:${spinnaker.version('jackson')}"
testCompile project(':cats:cats-test')
testCompile spinnaker.dependency('korkJedisTest')
implementation project(":cats:cats-core")

compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"

implementation "com.fasterxml.jackson.core:jackson-databind"
implementation "com.google.guava:guava"
implementation "com.netflix.eureka:eureka-client"
implementation "com.netflix.spinnaker.kork:kork-jedis"
implementation "com.google.guava:guava:27.1-jre"

testImplementation project(":cats:cats-test")
testImplementation "com.netflix.spinnaker.kork:kork-jedis-test"

testImplementation "org.spockframework:spock-core"
}
69 changes: 46 additions & 23 deletions cats/cats-sql/cats-sql.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,50 @@ apply plugin: "groovy"
tasks.compileGroovy.enabled = false

dependencies {
spinnaker.group("spockBase")
testCompile spinnaker.dependency("groovy")

compile project(':cats:cats-core')
compile project(':cats:cats-redis')
compile project(":clouddriver-sql")
compile project(":clouddriver-core")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.1.1")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.1.1")

testCompile "com.h2database:h2:1.4.197"

testCompile "io.strikt:strikt-core:0.11.5"
testCompile "org.assertj:assertj-core:3.9.0"
testCompile "org.junit.jupiter:junit-jupiter-api:${spinnaker.version("jupiter")}"
testCompile "com.nhaarman:mockito-kotlin:1.5.0"

testCompile project(':cats:cats-test')
testCompile(spinnaker.dependency("korkSqlTest"))
testRuntime "org.junit.jupiter:junit-jupiter-engine:${spinnaker.version("jupiter")}"
testRuntime "org.junit.platform:junit-platform-launcher:${spinnaker.version("junit5")}"
testRuntime "org.junit.vintage:junit-vintage-engine:${spinnaker.version("junitVintage")}"
implementation project(":cats:cats-core")
implementation project(":cats:cats-redis")
implementation project(":clouddriver-core")
implementation project(":clouddriver-security")
implementation project(":clouddriver-sql")

compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"

implementation "com.fasterxml.jackson.core:jackson-databind"
implementation "com.h2database:h2:1.4.197"
implementation "com.netflix.spectator:spectator-api"
implementation "com.netflix.spinnaker.fiat:fiat-api:$fiatVersion"
implementation "com.netflix.spinnaker.fiat:fiat-core:$fiatVersion"
implementation "com.netflix.spinnaker.kork:kork-core"
implementation "com.netflix.spinnaker.kork:kork-sql"
implementation "de.huxhorn.sulky:de.huxhorn.sulky.ulid"
implementation "io.github.resilience4j:resilience4j-retry"
implementation "io.strikt:strikt-core"
implementation "io.vavr:vavr:0.10.0"
implementation "org.assertj:assertj-core"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.1.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.1.1"
implementation("org.jooq:jooq:3.9.6"){
force = true
}
implementation "org.springframework.boot:spring-boot-starter-web"

testImplementation project(":cats:cats-test")

testImplementation "cglib:cglib-nodep"
testImplementation "com.netflix.spinnaker.kork:kork-sql-test"
testImplementation "com.nhaarman:mockito-kotlin"
testImplementation "junit:junit"
testImplementation "org.hamcrest:hamcrest-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.junit.jupiter:junit-jupiter-engine"
testImplementation "org.junit.platform:junit-platform-launcher"
testImplementation "org.junit.vintage:junit-vintage-engine"
testImplementation "org.objenesis:objenesis"
testImplementation "org.spockframework:spock-core"
testImplementation "org.spockframework:spock-core"
testImplementation "org.spockframework:spock-spring"
testImplementation "org.springframework:spring-test"
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CatsSqlAdminController(private val fiat: FiatPermissionEvaluator,

@PutMapping(path = ["/truncate/{namespace}"])
fun truncateTables(@PathVariable("namespace") truncateNamespace: String,
@Value("\${sql.tableNamespace:#{null}}") currentNamespace: String?): CleanTablesResult {
@Value("\${sql.table-namespace:#{null}}") currentNamespace: String?): CleanTablesResult {

validatePermissions()
validateParams(currentNamespace, truncateNamespace)
Expand Down Expand Up @@ -65,7 +65,7 @@ class CatsSqlAdminController(private val fiat: FiatPermissionEvaluator,

@PutMapping(path = ["/drop/{namespace}"])
fun dropTables(@PathVariable("namespace") dropNamespace: String,
@Value("\${sql.tableNamespace:#{null}}") currentNamespace: String?): CleanTablesResult {
@Value("\${sql.table-namespace:#{null}}") currentNamespace: String?): CleanTablesResult {

validatePermissions()
validateParams(currentNamespace, dropNamespace)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
@ConditionalOnProperty(value = ["caching.writeEnabled"], matchIfMissing = true)
@ConditionalOnProperty(value = ["caching.write-enabled"], matchIfMissing = true)
class SqlAgentSchedulerConfiguration {

@Bean
Expand All @@ -40,7 +40,7 @@ class SqlAgentSchedulerConfiguration {
agentIntervalProvider: AgentIntervalProvider,
nodeStatusProvider: NodeStatusProvider,
dynamicConfigService: DynamicConfigService,
@Value("\${sql.tableNamespace:#{null}}") tableNamespace: String?,
@Value("\${sql.table-namespace:#{null}}") tableNamespace: String?,
sqlAgentProperties: SqlAgentProperties): AgentScheduler<*> {
return SqlClusteredAgentScheduler(
jooq = jooq,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ class SqlCacheConfiguration {
sqlProperties: SqlProperties,
cacheMetrics: SqlCacheMetrics,
dynamicConfigService: DynamicConfigService,
@Value("\${sql.cache.asyncPoolSize:0}") poolSize: Int,
@Value("\${sql.tableNamespace:#{null}}") tableNamespace: String?): NamedCacheFactory {
@Value("\${sql.cache.async-pool-size:0}") poolSize: Int,
@Value("\${sql.table-namespace:#{null}}") tableNamespace: String?): NamedCacheFactory {
if (tableNamespace != null && !tableNamespace.matches("""^\w+$""".toRegex())) {
throw IllegalArgumentException("tableNamespace can only contain characters [a-z, A-Z, 0-9, _]")
}
Expand Down Expand Up @@ -137,22 +137,22 @@ class SqlCacheConfiguration {
}

@Bean
@ConditionalOnExpression("\${sql.readOnly:false} == false")
@ConditionalOnExpression("\${sql.read-only:false} == false")
fun sqlTableMetricsAgent(jooq: DSLContext,
registry: Registry,
clock: Clock,
@Value("\${sql.tableNamespace:#{null}}") namespace: String?): SqlTableMetricsAgent =
@Value("\${sql.table-namespace:#{null}}") namespace: String?): SqlTableMetricsAgent =
SqlTableMetricsAgent(jooq, registry, clock, namespace)

@Bean
@ConditionalOnExpression("\${sql.readOnly:false} == false")
@ConditionalOnExpression("\${sql.read-only:false} == false")
fun sqlCleanupStaleOnDemandCachesAgent(applicationContext: ApplicationContext,
registry: Registry,
clock: Clock): SqlCleanupStaleOnDemandCachesAgent =
SqlCleanupStaleOnDemandCachesAgent(applicationContext, registry, clock)

@Bean
@ConditionalOnExpression("\${sql.readOnly:false} == false")
@ConditionalOnExpression("\${sql.read-only:false} == false")
fun sqlAgentProvider(sqlTableMetricsAgent: SqlTableMetricsAgent,
sqlCleanupStaleOnDemandCachesAgent: SqlCleanupStaleOnDemandCachesAgent): SqlProvider =
SqlProvider(mutableListOf(sqlTableMetricsAgent, sqlCleanupStaleOnDemandCachesAgent))
Expand Down
Loading

0 comments on commit 2a8ed43

Please sign in to comment.