From 8b53120aab044e21e40b920121d7f50646ce1538 Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Tue, 17 Nov 2020 08:41:30 -0800 Subject: [PATCH 1/5] Support Elasticsearch 7.10 --- build.gradle | 15 +++++++++------ gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- ...search-job-scheduler.release-notes-1.12.0.0.md | 6 ++++++ sample-extension-plugin/build.gradle | 14 +++++++------- .../sampleextension/SampleExtensionPlugin.java | 2 +- spi/build.gradle | 7 +++---- .../jobscheduler/spi/LockModel.java | 2 +- .../jobscheduler/spi/schedule/ScheduleParser.java | 6 +++--- 9 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.12.0.0.md diff --git a/build.gradle b/build.gradle index 5f60be6..5401ca0 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ buildscript { ext { - es_version = System.getProperty("es.version", "7.9.1") + es_version = System.getProperty("es.version", "7.10.0") } repositories { @@ -39,6 +39,7 @@ ext { apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.java-rest-test' ext { projectSubstitutions = [:] @@ -55,6 +56,7 @@ dependencyLicenses.enabled = false thirdPartyAudit.enabled = false forbiddenApisTest.ignoreFailures = true validateNebulaPom.enabled = false +loggerUsageCheck.enabled = false esplugin { name 'opendistro-job-scheduler' @@ -62,15 +64,15 @@ esplugin { classname 'com.amazon.opendistroforelasticsearch.jobscheduler.JobSchedulerPlugin' } -testClusters.integTest { - testDistribution = 'OSS' -} - -integTest.runner { +javaRestTest { // add "-Dtests.security.manager=false" to VM options if you want to run integ tests in IntelliJ systemProperty 'tests.security.manager', 'false' } +testClusters.javaRestTest { + testDistribution = 'OSS' +} + allprojects { group = 'com.amazon.opendistroforelasticsearch' version = "${opendistroVersion}.0" @@ -89,6 +91,7 @@ allprojects { dependencies { compile project(path: ":${rootProject.name}-spi", configuration: 'shadow') + javaRestTestImplementation project.sourceSets.main.runtimeClasspath } // RPM & Debian build diff --git a/gradle.properties b/gradle.properties index 9efa03e..65bbbb2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,4 +13,4 @@ # permissions and limitations under the License. # -version = 1.11.0 +version = 1.12.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 622ab64..12d38de 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.12.0.0.md b/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.12.0.0.md new file mode 100644 index 0000000..c4f0d27 --- /dev/null +++ b/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.12.0.0.md @@ -0,0 +1,6 @@ +## 2020-11-17 Version 1.12.0.0 + +Compatible with Elasticsearch 7.10 + +### Maintenance +* Support Elasticsearch 7.10 ([#79](https://github.com/opendistro-for-elasticsearch/job-scheduler/pull/79)) \ No newline at end of file diff --git a/sample-extension-plugin/build.gradle b/sample-extension-plugin/build.gradle index 48c7946..abc18fe 100644 --- a/sample-extension-plugin/build.gradle +++ b/sample-extension-plugin/build.gradle @@ -15,6 +15,7 @@ apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.java-rest-test' esplugin { name 'opendistro-job-scheduler-sample-extension' @@ -35,16 +36,15 @@ dependencies { licenseHeaders.enabled = false validateNebulaPom.enabled = false -testingConventions.enabled = false; +testingConventions.enabled = false +loggerUsageCheck.enabled = false -integTest.dependsOn(rootProject.assemble) -integTestRunner { +javaRestTest.dependsOn(rootProject.assemble) +javaRestTest { systemProperty 'tests.security.manager', 'false' } -testClusters.integTest { +testClusters.javaRestTest { testDistribution = 'OSS' - // need to install job-scheduler first, need to assemble job-scheduler first - plugin file("${rootProject.getBuildDir()}/distributions/${rootProject.getName()}-${project.getVersion()}.zip") } // As of ES 7.7 the sample-extension-plugin is being added to the list of plugins for the testCluster during build before @@ -53,7 +53,7 @@ testClusters.integTest { // Will need to do a deep dive to find out exactly what task adds the sample-extension-plugin and add job-scheduler there but a temporary hack is to // reorder the plugins list after evaluation but prior to task execution when the plugins are installed. afterEvaluate { - testClusters.integTest.nodes.each { node -> + testClusters.javaRestTest.nodes.each { node -> def plugins = node.plugins def firstPlugin = plugins.get(0) if (firstPlugin.provider == project.bundlePlugin.archiveFile) { diff --git a/sample-extension-plugin/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/sampleextension/SampleExtensionPlugin.java b/sample-extension-plugin/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/sampleextension/SampleExtensionPlugin.java index 23bb8b0..b3f1e24 100644 --- a/sample-extension-plugin/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/sampleextension/SampleExtensionPlugin.java +++ b/sample-extension-plugin/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/sampleextension/SampleExtensionPlugin.java @@ -96,7 +96,7 @@ public ScheduledJobRunner getJobRunner() { public ScheduledJobParser getJobParser() { return (parser, id, jobDocVersion) -> { SampleJobParameter jobParameter = new SampleJobParameter(); - XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser::getTokenLocation); + XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser); while (!parser.nextToken().equals(XContentParser.Token.END_OBJECT)) { String fieldName = parser.currentName(); diff --git a/spi/build.gradle b/spi/build.gradle index 8692034..7b9823d 100644 --- a/spi/build.gradle +++ b/spi/build.gradle @@ -25,6 +25,7 @@ plugins { apply plugin: 'elasticsearch.java' apply plugin: 'elasticsearch.testclusters' +apply plugin: 'elasticsearch.java-rest-test' ext { projectSubstitutions = [:] @@ -75,14 +76,12 @@ test { task integTest(type: RestIntegTestTask) { description 'Run integ test with elasticsearch test framework' group 'verification' - runner { - systemProperty 'tests.security.manager', 'false' - } + systemProperty 'tests.security.manager', 'false' dependsOn test } check.dependsOn integTest -testClusters.integTest { +testClusters.javaRestTest { testDistribution = 'OSS' } diff --git a/spi/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/spi/LockModel.java b/spi/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/spi/LockModel.java index 04001a6..032ec6c 100644 --- a/spi/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/spi/LockModel.java +++ b/spi/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/spi/LockModel.java @@ -109,7 +109,7 @@ public static LockModel parse(final XContentParser parser, long seqNo, long prim Long lockDurationSecond = null; Boolean released = null; - XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser::getTokenLocation); + XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser); while (!XContentParser.Token.END_OBJECT.equals(parser.nextToken())) { String fieldName = parser.currentName(); parser.nextToken(); diff --git a/spi/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/spi/schedule/ScheduleParser.java b/spi/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/spi/schedule/ScheduleParser.java index 0488234..15e77ba 100644 --- a/spi/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/spi/schedule/ScheduleParser.java +++ b/spi/src/main/java/com/amazon/opendistroforelasticsearch/jobscheduler/spi/schedule/ScheduleParser.java @@ -29,7 +29,7 @@ */ public class ScheduleParser { public static Schedule parse(XContentParser parser) throws IOException { - XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser::getTokenLocation); + XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser); while(!XContentParser.Token.END_OBJECT.equals(parser.nextToken())) { String fieldName = parser.currentName(); @@ -52,7 +52,7 @@ public static Schedule parse(XContentParser parser) throws IOException { } } XContentParserUtils.ensureExpectedToken(XContentParser.Token.END_OBJECT, parser.currentToken(), - parser::getTokenLocation); + parser); parser.nextToken(); return new CronSchedule(expression, timezone); case IntervalSchedule.INTERVAL_FIELD: @@ -78,7 +78,7 @@ public static Schedule parse(XContentParser parser) throws IOException { } } XContentParserUtils.ensureExpectedToken(XContentParser.Token.END_OBJECT, parser.currentToken(), - parser::getTokenLocation); + parser); parser.nextToken(); return new IntervalSchedule(startTime, period, unit); default: From 76a7162950f5d32cddcc4ab9bbf94adc0f516417 Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Tue, 17 Nov 2020 08:46:22 -0800 Subject: [PATCH 2/5] Fix link for release notes --- ...ro-for-elasticsearch-job-scheduler.release-notes-1.12.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.12.0.0.md b/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.12.0.0.md index c4f0d27..b289224 100644 --- a/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.12.0.0.md +++ b/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.12.0.0.md @@ -3,4 +3,4 @@ Compatible with Elasticsearch 7.10 ### Maintenance -* Support Elasticsearch 7.10 ([#79](https://github.com/opendistro-for-elasticsearch/job-scheduler/pull/79)) \ No newline at end of file +* Support Elasticsearch 7.10 ([#82](https://github.com/opendistro-for-elasticsearch/job-scheduler/pull/82)) \ No newline at end of file From 4381b71498d70b1196d14ac8554d8f5090c3f285 Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Tue, 26 Jan 2021 15:03:01 -0800 Subject: [PATCH 3/5] Rename plugin for more consistent naming convention --- build.gradle | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 5401ca0..363f051 100644 --- a/build.gradle +++ b/build.gradle @@ -131,13 +131,27 @@ afterEvaluate { buildRpm { arch = 'NOARCH' - archiveName "${packageName}-${version}.rpm" dependsOn 'assemble' + finalizedBy 'renameRpm' + task renameRpm(type: Copy) { + from("$buildDir/distributions") + into("$buildDir/distributions") + include archiveName + rename archiveName, "${packageName}-${version}.rpm" + doLast { delete file("$buildDir/distributions/$archiveName") } + } } buildDeb { - arch = 'amd64' - archiveName "${packageName}-${version}.deb" + arch = 'all' dependsOn 'assemble' + finalizedBy 'renameDeb' + task renameDeb(type: Copy) { + from("$buildDir/distributions") + into("$buildDir/distributions") + include archiveName + rename archiveName, "${packageName}-${version}.deb" + doLast { delete file("$buildDir/distributions/$archiveName") } + } } } From ba3c9f96aa18ebd3d5e396100dc3bfca3902e5bc Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Tue, 26 Jan 2021 15:29:15 -0800 Subject: [PATCH 4/5] Support Elasticsearch 7.10.2 --- build.gradle | 2 +- gradle.properties | 2 +- ...asticsearch-job-scheduler.release-notes-1.13.0.0.md | 10 ++++++++++ spi/build.gradle | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.13.0.0.md diff --git a/build.gradle b/build.gradle index 363f051..53335d5 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ buildscript { ext { - es_version = System.getProperty("es.version", "7.10.0") + es_version = System.getProperty("es.version", "7.10.2") } repositories { diff --git a/gradle.properties b/gradle.properties index 65bbbb2..3d0d9a7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,4 +13,4 @@ # permissions and limitations under the License. # -version = 1.12.0 +version = 1.13.0 diff --git a/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.13.0.0.md b/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.13.0.0.md new file mode 100644 index 0000000..273772b --- /dev/null +++ b/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.13.0.0.md @@ -0,0 +1,10 @@ +## 2021-01-26 Version 1.13.0.0 + +Compatible with Elasticsearch 7.10.2 + +### Maintenance +* Support Elasticsearch 7.10.2 ([#82](https://github.com/opendistro-for-elasticsearch/job-scheduler/pull/82)) + +### Infrastructure +* Update release-workflow.yml ([#83](https://github.com/opendistro-for-elasticsearch/job-scheduler/pull/83)) +* Rename plugin artifacts for more consistent naming convention ([#85](https://github.com/opendistro-for-elasticsearch/job-scheduler/pull/85)) \ No newline at end of file diff --git a/spi/build.gradle b/spi/build.gradle index 7b9823d..3a15a62 100644 --- a/spi/build.gradle +++ b/spi/build.gradle @@ -49,7 +49,7 @@ check.dependsOn jacocoTestReport dependencies { compileOnly "org.elasticsearch:elasticsearch:${es_version}" - compile "com.cronutils:cron-utils:7.0.5" + compile "com.cronutils:cron-utils:9.1.3" testImplementation "org.elasticsearch.test:framework:${es_version}" testImplementation "org.apache.logging.log4j:log4j-core:${versions.log4j}" From 0e2b43eeb156aa435e4e7b30409ac9189e531326 Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Tue, 26 Jan 2021 16:09:59 -0800 Subject: [PATCH 5/5] update release notes --- ...ro-for-elasticsearch-job-scheduler.release-notes-1.13.0.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.13.0.0.md b/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.13.0.0.md index 273772b..8fcc546 100644 --- a/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.13.0.0.md +++ b/release-notes/opendistro-for-elasticsearch-job-scheduler.release-notes-1.13.0.0.md @@ -3,7 +3,7 @@ Compatible with Elasticsearch 7.10.2 ### Maintenance -* Support Elasticsearch 7.10.2 ([#82](https://github.com/opendistro-for-elasticsearch/job-scheduler/pull/82)) +* Support Elasticsearch 7.10.2 ([#86](https://github.com/opendistro-for-elasticsearch/job-scheduler/pull/86)) ### Infrastructure * Update release-workflow.yml ([#83](https://github.com/opendistro-for-elasticsearch/job-scheduler/pull/83))