Skip to content

Commit

Permalink
Merge pull request #18 from trocco-io/marge-treasure-data-109
Browse files Browse the repository at this point in the history
Marge treasure data 109
  • Loading branch information
t3t5u authored Jun 29, 2022
2 parents 5e9f60f + 2126d8c commit 0a09ba7
Show file tree
Hide file tree
Showing 48 changed files with 1,750 additions and 982 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @treasure-data/integrations
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and test

on: push

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with testing
run: ./gradlew check --console rich --info

- uses: actions/upload-artifact@v2
if: always()
with:
name: tests
path: ./build/reports/tests/test

- name: JaCoCo test report
if: success()
run: ./gradlew jacocoTestReport

- uses: actions/upload-artifact@v2
if: success()
with:
name: jacoco
path: ./build/reports/jacoco/test
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 0.6.21 - 2021-07-15
- Upgrade `embulk-*` to `v0.10.29`.
- Apply new lib `embulk-util-*`.
- Upgrade `embulk-base-restclient` to `v0.10.1`
- Upgrade Gradle to `6.6.1`.
- Apply `org.embulk.embulk-plugins` Gradle plugin.
- Use Java optional 8 in place of Guava
- Miscellaneous code cleanup.

## 0.6.20 - 2020-07-17
* [enhancement] Replace Joda-Time with java.time classes [101](https://github.com/treasure-data/embulk-input-marketo/pull/101)
* [enhancement] Use GitHub Action instead of Travis CI [101](https://github.com/treasure-data/embulk-input-marketo/pull/101)

## 0.6.19 - 2020-07-06
* [enhancement] Support import Lead/Member by input static List,Program IDs [100](https://github.com/treasure-data/embulk-input-marketo/pull/100)
* [enhancement] Support string comma-separated filterValues for Custom Objects [100](https://github.com/treasure-data/embulk-input-marketo/pull/100)

## 0.6.18 - 2020-01-06
* [enhancement] Support Marketo Partner API Key [#98](https://github.com/treasure-data/embulk-input-marketo/pull/98)

Expand Down Expand Up @@ -156,7 +173,7 @@ This version breaks backword compatibility of marketo/lead. Please check README.

## 0.1.1 - 2015-08-19

* [enhanement] Support scheduled execution [#20](https://github.com/treasure-data/embulk-input-marketo/pull/20) [[Reported by @muga](https://github.com/treasure-data/embulk-input-marketo/issues/18). Thanks!]
* [enhancement] Support scheduled execution [#20](https://github.com/treasure-data/embulk-input-marketo/pull/20) [[Reported by @muga](https://github.com/treasure-data/embulk-input-marketo/issues/18). Thanks!]
* [maintenance] Use everyleaf-embulk_helper [#19](https://github.com/treasure-data/embulk-input-marketo/pull/19)

## 0.1.0 - 2015-07-15
Expand Down
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ Configuration:

| name | required | default value | description |
|---------------------|----------|---------------|-----------------------------------------------------------------------------------------------------------------|
| **included_fields** | false | null | List of lead fields to included in export request sent to Marketo, can be used to reduce request, response size |
| **included_fields** | false | null | List of lead fields to included in export request sent to Marketo, can be used to reduce request, response size |
| **list_ids** | false | null | Import Leads by specified Lists_ID. If not specified will import all Leads by all List IDs |

Schema type: Dynamic via describe leads. Schema will have 1 addition column name listId that contain the id of the list the lead belong to

Expand All @@ -138,9 +139,10 @@ Extract all Lead data including lead's program id

Configuration:

| name | required | default value | description |
|---------------------|----------|---------------|-----------------------------------------------------------------------------------------------------------------|
| **included_fields** | false | null | List of lead fields to included in export request sent to Marketo, can be used to reduce request, response size |
| name | required | default value | description |
|---------------------|----------|---------------|-----------------------------------------------------------------------------------------------------------------------|
| **included_fields** | false | null | List of lead fields to included in export request sent to Marketo, can be used to reduce request, response size |
| **program_ids** | false | null | Import Members by specified Program_ID (comma-separated). If not specified will import all Members by all Program IDs |

Schema type: Dynamic via describe leads. Schema will have 1 addition column name listId that contain the id of the list the lead belong to

Expand All @@ -166,14 +168,30 @@ Configuration:
| **tag_type** | false | null | Required if query by `tag_type` is selected. Type of program tag |
| **tag_value** | false | null | Required if query by `tag_type` is selected. Value of the tag |
| **report_duration** | false | null | Amount of milliseconds to fetch from `earliest_updated_at`. If `incremental = true` this value will automatically calculated for the first run by `latest_updated_at` - `earliest_updated_at` |
| **incremental** | false | true | If incremental is set to true, next run will have `earliest_updated_at` set to the previous `latest_updated_at` + `report_duration`. Incremental import only support by query `date_range` |
| **incremental** | false | true | If incremental is set to true, next run will have `earliest_updated_at` set to the previous `latest_updated_at` + `report_duration`. Incremental import only support by query `date_range` |

Schema type: Static schema

Incremental support: yes (Query by `date_range` only)

Range ingestion: yes

`target: all_lead_with_program_id`

Configuration:

| name | required | default value | description |
|---------------------------------------|----------|---------------|-----------------------------------------------------------------------------------------------------------------------|
| **custom_object_api_name** | true | null | The API name of the custom object |
| **custom_object_fields** | false | null | Comma separated API name of fields of the custom object (Optional) |
| **custom_object_filter_type** | true | null | Field to search on Valid values are: dedupeFields, idFields, and any field defined in searchableFields attribute of Describe endpoint. Default is dedupeFields |
| **custom_object_filter_values** | false | null | Comma-separated list of field values to match. |
| **custom_object_filter_from_value** | false | null | Filter Marketo Custom Object has value greater than this value |
| **custom_object_filter_to_value** | false | null | Filter Marketo Custom Object has value smaller than this value. If not set, only records that have value greater than "From Value" will be returned. Job will stop if no record found in 300 consecutive value. |

Schema type: dynamic schema
Incremental support: no

### List

List extract all list data from Marketo
Expand Down
217 changes: 143 additions & 74 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,117 +1,186 @@
plugins {
id "com.jfrog.bintray" version "1.1"
id "com.github.jruby-gradle.base" version "0.1.5"
id "java"
id "maven-publish"
id "checkstyle"
id "jacoco"
id "signing"
id "org.embulk.embulk-plugins" version "0.4.2"
id "com.palantir.git-version" version "0.12.3"
}
import com.github.jrubygradle.JRubyExec

repositories {
mavenCentral()
jcenter()
maven {
url "https://dl.bintray.com/embulk-base-restclient/maven"
}
}
configurations {
provided
}

group = "com.treasuredata.embulk.plugins"
description = "Loads records from Marketo."
version = {
def baseVersion = "0.6.32"
def baseVersion = "0.6.23"
def patchVersion = "1"
def vd = versionDetails()
if (vd.lastTag != "${baseVersion}.${patchVersion}") {
logger.warn "lastTag '${vd.lastTag}' is not '${baseVersion}.${patchVersion}'"
}
if (vd.commitDistance == 0 && vd.lastTag ==~ /^[0-9]+\.[0-9]+\.[0-9]+(\.[a-zA-Z0-9]+)?/) {
baseVersion
"${vd.lastTag}.trocco"
} else {
"${baseVersion}.${vd.gitHash}.pre"
}
}()

sourceCompatibility = 1.7
targetCompatibility = 1.7
sourceCompatibility = 1.8
targetCompatibility = 1.8

def embulkVersion = '0.10.29'

dependencies {
compile "org.embulk:embulk-core:0.8.+"
provided "org.embulk:embulk-core:0.8.+"
compile "org.embulk.base.restclient:embulk-base-restclient:0.5.3"
compile "org.embulk.base.restclient:embulk-util-retryhelper-jetty92:0.5.3"
compile 'org.apache.commons:commons-text:1.2'
// https://mvnrepository.com/artifact/org.apache.commons/commons-csv
compile group: 'org.apache.commons', name: 'commons-csv', version: '1.8'
compileOnly "org.embulk:embulk-api:$embulkVersion"
compileOnly "org.embulk:embulk-spi:$embulkVersion"

compile('org.embulk:embulk-util-config:0.3.1') {
// Conflict with Embulk Core
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
exclude group: 'com.fasterxml.jackson.datatype', module: 'jackson-datatype-jdk8'
exclude group: 'javax.validation', module: 'validation-api'
}

compile "org.embulk:embulk-util-json:0.1.1"
compile "org.embulk:embulk-util-text:0.1.1"
compile "org.embulk:embulk-util-timestamp:0.2.1"

// Explicit dependencies for embulk-util-* that matches with Embulk
compile 'com.fasterxml.jackson.core:jackson-core:2.6.7'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.6.7'
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.7'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.6.7'
compile 'javax.validation:validation-api:1.1.0.Final'

compile 'org.embulk:embulk-base-restclient:0.10.1'
compile 'org.embulk:embulk-util-retryhelper-jetty92:0.8.2'

compile 'com.google.guava:guava:18.0'
compile "com.google.code.findbugs:annotations:3.0.1"
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.apache.commons:commons-csv:1.8'

testCompile "junit:junit:4.+"
testCompile "org.embulk:embulk-core:0.8.+:tests"
testCompile "org.embulk:embulk-test:0.8.+"
testCompile "org.embulk:embulk-core:$embulkVersion:tests"
testCompile "org.embulk:embulk-junit4:$embulkVersion"
testCompile "org.embulk:embulk-deps:$embulkVersion"
testCompile "org.mockito:mockito-core:2.+"
}

task classpath(type: Copy, dependsOn: ["jar"]) {
doFirst { file("classpath").deleteDir() }
from (configurations.runtime - configurations.provided + files(jar.archivePath))
into "classpath"
embulkPlugin {
mainClass = "org.embulk.input.marketo.MarketoInputPlugin"
category = "input"
type = "marketo"
}

publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = project.name

from components.java // Must be "components.java". The dependency modification works only for it.
// javadocJar and sourcesJar are added by java.withJavadocJar() and java.withSourcesJar() above.
// See: https://docs.gradle.org/current/javadoc/org/gradle/api/plugins/JavaPluginExtension.html

pom { // https://central.sonatype.org/pages/requirements.html
packaging "jar"

name = project.name
description = project.description
url = "https://www.embulk.org/"

licenses {
license {
// http://central.sonatype.org/pages/requirements.html#license-information
name = "MIT License"
url = "http://www.opensource.org/licenses/mit-license.php"
}
}

developers {
developer {
name = "Treasure Data"
email = "[email protected]"
}
}

scm {
connection = "scm:git:git://github.com/treasure-data/embulk-input-marketo.git"
developerConnection = "scm:git:[email protected]:treasure-data/embulk-input-marketo.git"
url = "https://github.com/treasure-data/embulk-input-marketo"
}
}
}
}

repositories {
maven { // publishMavenPublicationToMavenCentralRepository
name = "mavenCentral"
if (project.version.endsWith("-SNAPSHOT")) {
url "https://oss.sonatype.org/content/repositories/snapshots"
} else {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
}

credentials {
username = project.hasProperty("ossrhUsername") ? ossrhUsername : ""
password = project.hasProperty("ossrhPassword") ? ossrhPassword : ""
}
}
}
}

signing {
sign publishing.publications.maven
}

gem {
authors = ["uu59", "yoshihara", "taikhuu", "Treasure Data"]
email = ["[email protected]", "[email protected]", "[email protected]", "[email protected]"]
summary = "Marketo input plugin for Embulk"
homepage = "https://github.com/treasure-data/embulk-input-marketo"
licenses = ["MIT"]
}

gemPush {
host = "https://rubygems.org"
}

javadoc {
options {
locale = 'en_US'
encoding = 'UTF-8'
}
}
clean { delete "classpath" }

checkstyle {
configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
toolVersion = '6.14.1'
}
checkstyleMain {
exclude '**/**/CsvTokenizer*'
configFile = file("${project.rootDir}/config/checkstyle/default.xml")
ignoreFailures = false
ignoreFailures = true
}
checkstyleTest {
configFile = file("${project.rootDir}/config/checkstyle/default.xml")
ignoreFailures = false
ignoreFailures = true
}
task checkstyle(type: Checkstyle) {
classpath = sourceSets.main.output + sourceSets.test.output
source = sourceSets.main.allJava + sourceSets.test.allJava
}

task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "build"
script "${project.name}.gemspec"
doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
}

task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push"
script "pkg/${project.name}-${project.version}.gem"
}

task "package"(dependsOn: ["gemspec", "classpath"]) {
doLast {
println "> Build succeeded."
println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
}
}

task gemspec {
ext.gemspecFile = file("${project.name}.gemspec")
inputs.file "build.gradle"
outputs.file gemspecFile
doLast { gemspecFile.write($/
Gem::Specification.new do |spec|
spec.name = "${project.name}"
spec.version = "${project.version}"
spec.authors = ["uu59", "yoshihara", "taikhuu"]
spec.summary = %[Marketo input plugin for Embulk]
spec.description = %[Loads records from Marketo.]
spec.email = ["[email protected]", "[email protected]", "[email protected]"]
spec.licenses = ["Apache2"]
spec.homepage = "https://github.com/treasure-data/embulk-input-marketo"

spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
spec.test_files = spec.files.grep(%r"^(test|spec)/")
spec.require_paths = ["lib"]

#spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
spec.add_development_dependency 'bundler', ['~> 1.0']
spec.add_development_dependency 'rake', ['>= 10.0']
end
/$)
jacocoTestReport {
group = "Reporting"
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/reports/coverage")
}
}
clean { delete "${project.name}.gemspec" }
Loading

0 comments on commit 0a09ba7

Please sign in to comment.