diff --git a/.gitignore b/.gitignore index 8163af2a8..c1862c52c 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ Thumbs.db .gradle .m2 + # Build output directies /target */target @@ -67,3 +68,6 @@ atlassian-ide-plugin.xml # NetBeans specific files/directories .nbattrs >>>>>>> build/multi-project + +# publishing secrets +secrets/signing-key diff --git a/.travis.yml b/.travis.yml index 29dbc1298..9e6b9926a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,14 +4,16 @@ jdk: sudo: false git: depth: 100 -install: ./installViaTravis.sh -script: ./buildViaTravis.sh +install: "./installViaTravis.sh" +script: "./buildViaTravis.sh" cache: directories: - - $HOME/.gradle + - "$HOME/.gradle" env: global: - - secure: p81PYYYYhjhp1uJHOoT9EfUia8qPMphdykCxQannWMVvIFKXF5ibi/Qd52OUIYuJT9Q5MN9GhlwCtolxmCZu44YMLi99LsoITAv6n08LAFEux1oAOXmGt3ZBllvBFtlW+jlQ5lKmbuuPue3RVbTaWzL3KCCaYQ4uKW/sP31bXic= - - secure: AYWrIC/1JqAVyLhzlDhL163LypPpq7AliDltfey9emxzS73vB5VrGTHG45Em7xdkHN0kc1vED+UFsYks7ym1olXZPsbW29R0Gfd+p1VxCE3Cbhj7x690xNC3wIlSgWGpbgiPs7vhVN80OuNgnpz9/+WRFpKAVrYrcisbvugsDqk= - - secure: Ai75crFDh3imkmxzNQDXIwK49appZuZTrsmdZzgH1Zl/nD33RoZPWUWeeHP0yJoicNqZlU6aEXJnk8JGDWtPIT3VNO7Rsey+yrw041rHNV6bFGpwGdQgKv5CUhRHK+gShgFgnME5THCPKvK51+li1feIoByoYVmEn0gmvcxL0yM= - - secure: ZqBsyaFMBz3cqM7UHq0IRotTPaoBNUHrC7buiAqqhZ5JNM48a2m7ORuu/SENPFfr6xOT5KylCrvT6eD1bkQi5S2jT9Qyoju/9H/hXaAUG89dhwKOxqEE11ZGKF8DlNO/jcmchVnIkgWfEjVKc7vCAww1Y8lgxhyj4gRtnln+F+o= + - secure: bXzjPA0Ec3NBIN25knd9UYzGtxxmlhoLkO0LwI87iRSeCLzvbT+qBl/chvaXCk3DC2JnSq6GGWw2r0R6pjR4UezZx72KP+dm19cy606e7np1mHZmzziSkyjaBd84HPgOz8L4jh5G9qQBG8VhkjikIabAgsbiWG3oX6a/rOadobg= + - secure: COIxG87u7BSBAD0s8g0E9PTq4XLompgW/PL55bnIxuVkIo3tXXqShAxMzsJ0C++q5AbofNUICqTbGqN0ozk9GpMC78d5pgWS1O4hpdWsouK8Fxcju+KkKC5MUDC478G/zW0uSa0uZsZGaDy3Gx17jpvq2CdVCgHmaHmGGOxfDbA= + - secure: LMyJ2v4kN+07Gz5pPHkYLOvbQOAI05bHFGUVfaAbofyiR1DqKpKqB4hYaKSgb0kB/3YI6u9dLQ5AWzAqfx3HY0+p2iTmgseIxbHGrFfOH7bt2xusYNUtYPn1JXOAz1Nzxq/a+4rCgqD9lFI19XetrI5SNrRIRErDIZnWdXyhW/M= + - secure: dxJVfXpC/yORQWg2oaw+Q2UjeoAHiqf5hyLVSdGbIJYVrSu/fyFCuUNjQffikjleoyuaPeIHxaGQZoQZE3+9Cf3d7s1lXzugO3UOxmKR9UYi8tz6sLUFeLPjVhR6Etx603A8oCg659RhD2VyOCZvq1/R2gUa34tUtnVyoFyUzDA= + - secure: tl59nbZhOzWqW/PLp91+Paugond4Lwwj/qT1Tq4EFJ9Q2nNMFW3twlWzmUOcgn7GaJZTgfoDx2HGYFg1N3rrBtZIY/Wtzz9eWrGY4ywHfoXz/8lQGtbciDjiNePByuvSLOPWeTIGncOLGNUcCPNFOO9+kC4BzUGr9CjtTc+qnWg= + - secure: AZoBLO43P+GVjQq+vsT8mekOUNqifi+tRYukz19GLN2vv2vsgY4ejhXjeer1kwqm0l/1bXtfqo0uHyD+CFn2yINV20oKHScYNS4fwKnJ8aC60MZqAj6zddfe2VvEeDIKDiejpz4AfRJwgqpl9B0FrNtZ/1oU5n8oneTKpVFryTs= diff --git a/build.gradle b/build.gradle index c3f6b6b02..591a397c3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'nebula.netflixoss' version '7.1.3' + id 'nebula.netflixoss' version '9.1.0' id 'com.github.sherter.google-java-format' version '0.8' } @@ -78,7 +78,7 @@ allprojects { compile 'com.google.http-client:google-http-client-jackson2:1.28.0' compile 'com.netflix.spectator:spectator-api:0.96.0' compileOnly 'javax.servlet:javax.servlet-api:3.1.0' - testCompile 'org.jmockit:jmockit:1.31' + testCompile 'org.jmockit:jmockit:1.38' testCompile "org.spockframework:spock-core:1.1-groovy-2.4" testCompile "com.google.truth:truth:1.0.1" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' diff --git a/buildViaTravis.sh b/buildViaTravis.sh index 812026d7a..c3ddb674c 100755 --- a/buildViaTravis.sh +++ b/buildViaTravis.sh @@ -3,21 +3,22 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]" - ./gradlew build --stacktrace + ./gradlew build elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']' - ./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build snapshot --stacktrace + ./gradlew -Prelease.travisci=true -PnetflixOss.username="$NETFLIX_OSS_REPO_USERNAME" -PnetflixOss.password="$NETFLIX_OSS_REPO_PASSWORD" -Psonatype.signingPassword="$NETFLIX_OSS_SIGNING_PASSWORD" build snapshot elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']' case "$TRAVIS_TAG" in *-rc\.*) - ./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" candidate --stacktrace + ./gradlew -Prelease.travisci=true -PnetflixOss.username="$NETFLIX_OSS_REPO_USERNAME" -PnetflixOss.password="$NETFLIX_OSS_REPO_PASSWORD" -Psonatype.signingPassword="$NETFLIX_OSS_SIGNING_PASSWORD" -Prelease.useLastTag=true candidate ;; *) - ./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final --stacktrace + ./gradlew -Prelease.travisci=true -PnetflixOss.username="$NETFLIX_OSS_REPO_USERNAME" -PnetflixOss.password="$NETFLIX_OSS_REPO_PASSWORD" -Psonatype.username="$NETFLIX_OSS_SONATYPE_USERNAME" -Psonatype.password="$NETFLIX_OSS_SONATYPE_PASSWORD" -Psonatype.signingPassword="$NETFLIX_OSS_SIGNING_PASSWORD" -Prelease.useLastTag=true final ;; esac else echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']' - ./gradlew build --stacktrace + ./gradlew build fi + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 717f03890..68ca99ac4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip diff --git a/installViaTravis.sh b/installViaTravis.sh index 06a86291c..82cf1b880 100755 --- a/installViaTravis.sh +++ b/installViaTravis.sh @@ -1,16 +1,7 @@ #!/bin/bash # This script will build the project. -if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - echo -e "Assemble Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]" - ./gradlew assemble --stacktrace -elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then - echo -e 'Assemble Branch with Snapshot => Branch ['$TRAVIS_BRANCH']' - ./gradlew -Prelease.travisci=true assemble --stacktrace -elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then - echo -e 'Assemble Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']' - ./gradlew -Prelease.travisci=true -Prelease.useLastTag=true assemble --stacktrace -else - echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']' - ./gradlew assemble --stacktrace +if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then + echo "Decrypting publishing credentials" + openssl aes-256-cbc -k "$NETFLIX_OSS_SIGNING_FILE_PASSWORD" -in secrets/signing-key.enc -out secrets/signing-key -d fi diff --git a/priam/build.gradle b/priam/build.gradle index 723f3d03d..bbafaa0aa 100644 --- a/priam/build.gradle +++ b/priam/build.gradle @@ -1 +1,8 @@ -apply plugin: 'groovy' \ No newline at end of file +apply plugin: 'groovy' + +/** + * This is from https://jmockit.github.io/tutorial/Introduction.html#runningTests + */ +test { + jvmArgs "-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}" +} diff --git a/priam/src/main/java/com/netflix/priam/backupv2/SnapshotMetaTask.java b/priam/src/main/java/com/netflix/priam/backupv2/SnapshotMetaTask.java index 5ac26dc8f..871f021e2 100644 --- a/priam/src/main/java/com/netflix/priam/backupv2/SnapshotMetaTask.java +++ b/priam/src/main/java/com/netflix/priam/backupv2/SnapshotMetaTask.java @@ -415,7 +415,7 @@ ImmutableSetMultimap getFileUploadResults( * Gives the prefix (common name) of the sstable components. Returns an empty Optional if it is * not an sstable component or a manifest or schema file. * - *

For example: mc-3-big-Data.db --> mc-3-big ks-cf-ka-7213-Index.db --> ks-cf-ka-7213 + *

For example: mc-3-big-Data.db -- mc-3-big ks-cf-ka-7213-Index.db -- ks-cf-ka-7213 * * @param file the file from which to extract a common prefix. * @return common prefix of the file, or empty, diff --git a/priam/src/main/java/com/netflix/priam/identity/token/TokenRetrieverUtils.java b/priam/src/main/java/com/netflix/priam/identity/token/TokenRetrieverUtils.java index 700f3ef92..1fd35b7ec 100644 --- a/priam/src/main/java/com/netflix/priam/identity/token/TokenRetrieverUtils.java +++ b/priam/src/main/java/com/netflix/priam/identity/token/TokenRetrieverUtils.java @@ -30,8 +30,6 @@ public class TokenRetrieverUtils { * @param dc * @return IP of the token owner based on gossip information or null if C* status doesn't * converge. - * @throws GossipParseException when required number of instances are not available to fetch the - * gossip info. */ public static InferredTokenOwnership inferTokenOwnerFromGossip( List allIds, String token, String dc) { diff --git a/secrets/signing-key.enc b/secrets/signing-key.enc new file mode 100644 index 000000000..ce0833210 Binary files /dev/null and b/secrets/signing-key.enc differ