From 8a35a2a2eafee27c9eecd50916cb3f267fbde923 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Tue, 7 Jan 2020 00:48:02 -0800 Subject: [PATCH] [CHANGE ME] Re-generated to pick up changes in the API or client library generator. --- .kokoro/build.sh | 15 +- .kokoro/continuous/samples.cfg | 31 +++ .kokoro/nightly/samples.cfg | 31 +++ .kokoro/presubmit/samples.cfg | 31 +++ CONTRIBUTING.md | 104 ++++++++- synth.metadata | 376 ++++++++++++++++++++++++++++++++- 6 files changed, 585 insertions(+), 3 deletions(-) create mode 100644 .kokoro/continuous/samples.cfg create mode 100644 .kokoro/nightly/samples.cfg create mode 100644 .kokoro/presubmit/samples.cfg diff --git a/.kokoro/build.sh b/.kokoro/build.sh index dc2936ef..f1ae5840 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -44,13 +44,26 @@ test) bash .kokoro/coerce_logs.sh ;; lint) - mvn com.coveo:fmt-maven-plugin:check + mvn \ + -Penable-samples \ + com.coveo:fmt-maven-plugin:check ;; javadoc) mvn javadoc:javadoc javadoc:test-javadoc ;; integration) mvn -B ${INTEGRATION_TEST_ARGS} \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + bash .kokoro/coerce_logs.sh + ;; +samples) + mvn -B \ + -Penable-samples \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ diff --git a/.kokoro/continuous/samples.cfg b/.kokoro/continuous/samples.cfg new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/continuous/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..9a910249 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ebbb59e5..085021dd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,4 +25,106 @@ information on using pull requests. ## Community Guidelines This project follows -[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). \ No newline at end of file +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/synth.metadata b/synth.metadata index 226094db..dbec41a0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-19T19:48:48.118213Z", + "updateTime": "2020-01-07T08:48:02.774883Z", "sources": [ { "template": { @@ -8,5 +8,379 @@ "version": "2019.10.17" } } + ], + "newFiles": [ + { + "path": ".repo-metadata.json" + }, + { + "path": "renovate.json" + }, + { + "path": "license-checks.xml" + }, + { + "path": "synth.py" + }, + { + "path": "CHANGELOG.md" + }, + { + "path": "codecov.yaml" + }, + { + "path": "LICENSE" + }, + { + "path": ".gitignore" + }, + { + "path": "pom.xml" + }, + { + "path": "CODE_OF_CONDUCT.md" + }, + { + "path": "synth.metadata" + }, + { + "path": "README.md" + }, + { + "path": "versions.txt" + }, + { + "path": "CONTRIBUTING.md" + }, + { + "path": "java.header" + }, + { + "path": "src/test/java/com/google/cloud/dns/DnsBatchResultTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/ChangeRequestInfoTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/DnsTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/ProjectInfoTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/ZoneInfoTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/ZoneTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/DnsOptionsTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/RecordSetTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/DnsExceptionTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/ChangeRequestTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/OptionTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/SerializationTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/DnsBatchTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/DnsImplTest.java" + }, + { + "path": "src/test/java/com/google/cloud/dns/it/ITDnsTest.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/Option.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/DnsFactory.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/RecordSet.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/Dns.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/ChangeRequest.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/DnsException.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/ProjectInfo.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/ChangeRequestInfo.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/DnsOptions.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/DnsBatchResult.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/DnsImpl.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/DnsBatch.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/package-info.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/Zone.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/ZoneInfo.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/spi/DnsRpcFactory.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/spi/v1/DnsRpc.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/spi/v1/HttpDnsRpc.java" + }, + { + "path": "src/main/java/com/google/cloud/dns/spi/v1/RpcBatch.java" + }, + { + "path": ".kokoro/build.bat" + }, + { + "path": ".kokoro/build.sh" + }, + { + "path": ".kokoro/dependencies.sh" + }, + { + "path": ".kokoro/common.cfg" + }, + { + "path": ".kokoro/trampoline.sh" + }, + { + "path": ".kokoro/coerce_logs.sh" + }, + { + "path": ".kokoro/linkage-monitor.sh" + }, + { + "path": ".kokoro/continuous/dependencies.cfg" + }, + { + "path": ".kokoro/continuous/samples.cfg" + }, + { + "path": ".kokoro/continuous/java7.cfg" + }, + { + "path": ".kokoro/continuous/java8-osx.cfg" + }, + { + "path": ".kokoro/continuous/java8-win.cfg" + }, + { + "path": ".kokoro/continuous/propose_release.sh" + }, + { + "path": ".kokoro/continuous/lint.cfg" + }, + { + "path": ".kokoro/continuous/java11.cfg" + }, + { + "path": ".kokoro/continuous/common.cfg" + }, + { + "path": ".kokoro/continuous/propose_release.cfg" + }, + { + "path": ".kokoro/continuous/java8.cfg" + }, + { + "path": ".kokoro/continuous/integration.cfg" + }, + { + "path": ".kokoro/release/drop.sh" + }, + { + "path": ".kokoro/release/stage.cfg" + }, + { + "path": ".kokoro/release/promote.cfg" + }, + { + "path": ".kokoro/release/publish_javadoc.cfg" + }, + { + "path": ".kokoro/release/bump_snapshot.cfg" + }, + { + "path": ".kokoro/release/promote.sh" + }, + { + "path": ".kokoro/release/stage.sh" + }, + { + "path": ".kokoro/release/snapshot.sh" + }, + { + "path": ".kokoro/release/snapshot.cfg" + }, + { + "path": ".kokoro/release/common.cfg" + }, + { + "path": ".kokoro/release/bump_snapshot.sh" + }, + { + "path": ".kokoro/release/common.sh" + }, + { + "path": ".kokoro/release/drop.cfg" + }, + { + "path": ".kokoro/release/publish_javadoc.sh" + }, + { + "path": ".kokoro/presubmit/dependencies.cfg" + }, + { + "path": ".kokoro/presubmit/samples.cfg" + }, + { + "path": ".kokoro/presubmit/java7.cfg" + }, + { + "path": ".kokoro/presubmit/java8-osx.cfg" + }, + { + "path": ".kokoro/presubmit/linkage-monitor.cfg" + }, + { + "path": ".kokoro/presubmit/java8-win.cfg" + }, + { + "path": ".kokoro/presubmit/lint.cfg" + }, + { + "path": ".kokoro/presubmit/java11.cfg" + }, + { + "path": ".kokoro/presubmit/common.cfg" + }, + { + "path": ".kokoro/presubmit/clirr.cfg" + }, + { + "path": ".kokoro/presubmit/java8.cfg" + }, + { + "path": ".kokoro/presubmit/integration.cfg" + }, + { + "path": ".kokoro/nightly/dependencies.cfg" + }, + { + "path": ".kokoro/nightly/samples.cfg" + }, + { + "path": ".kokoro/nightly/java7.cfg" + }, + { + "path": ".kokoro/nightly/java8-osx.cfg" + }, + { + "path": ".kokoro/nightly/java8-win.cfg" + }, + { + "path": ".kokoro/nightly/lint.cfg" + }, + { + "path": ".kokoro/nightly/java11.cfg" + }, + { + "path": ".kokoro/nightly/common.cfg" + }, + { + "path": ".kokoro/nightly/java8.cfg" + }, + { + "path": ".kokoro/nightly/integration.cfg" + }, + { + "path": ".github/release-please.yml" + }, + { + "path": ".github/PULL_REQUEST_TEMPLATE.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/bug_report.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/support_request.md" + }, + { + "path": ".github/ISSUE_TEMPLATE/feature_request.md" + }, + { + "path": "__pycache__/synth.cpython-36.pyc" + }, + { + "path": ".git/index" + }, + { + "path": ".git/packed-refs" + }, + { + "path": ".git/HEAD" + }, + { + "path": ".git/config" + }, + { + "path": ".git/shallow" + }, + { + "path": ".git/objects/pack/pack-bee6b2142623cd1883a7c90a37e2dd1a942d4730.pack" + }, + { + "path": ".git/objects/pack/pack-bee6b2142623cd1883a7c90a37e2dd1a942d4730.idx" + }, + { + "path": ".git/refs/remotes/origin/HEAD" + }, + { + "path": ".git/refs/heads/autosynth" + }, + { + "path": ".git/refs/heads/master" + }, + { + "path": ".git/logs/HEAD" + }, + { + "path": ".git/logs/refs/remotes/origin/HEAD" + }, + { + "path": ".git/logs/refs/heads/autosynth" + }, + { + "path": ".git/logs/refs/heads/master" + } ] } \ No newline at end of file