-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: track customization in templates
- Loading branch information
1 parent
4c4063f
commit c007ca3
Showing
9 changed files
with
164 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 20 additions & 27 deletions
47
synthtool/gcp/templates/java_library/.kokoro/nightly/integration.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,30 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto | ||
|
||
# Configure the docker image for kokoro-trampoline. | ||
{%- if 'defaults' in metadata and 'env_vars' in metadata['defaults'] -%} | ||
{%- for default_key, default_value in metadata['defaults']['env_vars'].items() -%} | ||
{%- if 'partials' in metadata | ||
and 'kokoro_nightly_env_vars' in metadata['partials'] | ||
and default_key not in metadata['partials']['kokoro_nightly_env_vars'] -%} | ||
{%- if default_key == "ENABLE_FLAKYBOT" %} | ||
env_vars: { | ||
key: "TRAMPOLINE_IMAGE" | ||
value: "gcr.io/cloud-devrel-kokoro-resources/java8" | ||
} | ||
|
||
env_vars: { | ||
key: "JOB_TYPE" | ||
value: "integration" | ||
} | ||
# TODO: remove this after we've migrated all tests and scripts | ||
env_vars: { | ||
key: "GCLOUD_PROJECT" | ||
value: "java-docs-samples-testing" | ||
} | ||
|
||
env_vars: { | ||
key: "GOOGLE_CLOUD_PROJECT" | ||
value: "java-docs-samples-testing" | ||
} | ||
|
||
env_vars: { | ||
key: "ENABLE_FLAKYBOT" | ||
key: "{{ default_key }}" | ||
value: {% if migrated_split_repo %}"false"{% else %}"true"{% endif %} | ||
} | ||
|
||
{% else %} | ||
env_vars: { | ||
key: "GOOGLE_APPLICATION_CREDENTIALS" | ||
value: "secret_manager/java-it-service-account" | ||
key: "{{ default_key }}" | ||
value: "{{ default_value }}" | ||
} | ||
{% endif %} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- endif -%} | ||
|
||
{%- if 'partials' in metadata and 'kokoro_nightly_env_vars' in metadata['partials'] -%} | ||
{% for partial_key, partial_value in metadata['partials']['kokoro_nightly_env_vars'].items() %} | ||
env_vars: { | ||
key: "SECRET_MANAGER_KEYS" | ||
value: "java-it-service-account" | ||
key: "{{ partial_key }}" | ||
value: "{{ partial_value }}" | ||
} | ||
{% endfor -%} | ||
{%- endif -%} |
8 changes: 8 additions & 0 deletions
8
synthtool/gcp/templates/java_library/defaults/integration-default.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
env_vars: | ||
TRAMPOLINE_IMAGE: gcr.io/cloud-devrel-kokoro-resources/java8 | ||
JOB_TYPE: integration | ||
GCLOUD_PROJECT: java-docs-samples-testing | ||
GOOGLE_CLOUD_PROJECT: java-docs-samples-testing | ||
ENABLE_FLAKYBOT: true | ||
GOOGLE_APPLICATION_CREDENTIALS: secret_manager/java-it-service-account | ||
SECRET_MANAGER_KEYS: java-it-service-account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
18 changes: 18 additions & 0 deletions
18
tests/fixtures/java_templates/partials/.repo-metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"api_shortname": "cloudasset", | ||
"name_pretty": "Cloud Asset Inventory", | ||
"product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", | ||
"api_reference": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", | ||
"api_description": "provides inventory services based on a time series database. This database keeps a five week history of Google Cloud asset metadata. The Cloud Asset Inventory export service allows you to export all asset metadata at a certain timestamp or export event change history during a timeframe.", | ||
"client_documentation": "https://googleapis.dev/java/google-cloud-asset/latest/index.html", | ||
"issue_tracker": "https://issuetracker.google.com/issues/new?component=187210&template=0", | ||
"release_level": "stable", | ||
"transport": "grpc", | ||
"requires_billing": true, | ||
"language": "java", | ||
"repo": "googleapis/java-asset", | ||
"repo_short": "java-asset", | ||
"distribution_name": "com.google.cloud:google-cloud-asset", | ||
"library_type": "GAPIC_AUTO", | ||
"api_id": "cloudasset.googleapis.com" | ||
} |
40 changes: 40 additions & 0 deletions
40
tests/fixtures/java_templates/partials/integration-golden.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# 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: "integration" | ||
} | ||
# TODO: remove this after we've migrated all tests and scripts | ||
env_vars: { | ||
key: "GCLOUD_PROJECT" | ||
value: "java-docs-samples-testing" | ||
} | ||
|
||
env_vars: { | ||
key: "GOOGLE_CLOUD_PROJECT" | ||
value: "java-docs-samples-testing" | ||
} | ||
|
||
env_vars: { | ||
key: "ENABLE_FLAKYBOT" | ||
value: {% if migrated_split_repo %}"false"{% else %}"true"{% endif %} | ||
} | ||
|
||
env_vars: { | ||
key: "GOOGLE_APPLICATION_CREDENTIALS" | ||
value: "secret_manager/java-it-service-account" | ||
} | ||
|
||
env_vars: { | ||
key: "SECRET_MANAGER_KEYS" | ||
value: "java-it-service-account" | ||
} | ||
{% if 'partials' in metadata and metadata['partials']['env_vars_list'] %} | ||
{{ metadata['partials']['env_vars_list'] }} | ||
{% endif %} |