From 473d1456a8eb033dc41806709ac578c3b599a874 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Wed, 8 May 2019 16:54:36 -0700 Subject: [PATCH] fix: DEADLINE_EXCEEDED no longer listed as idempotent --- .kokoro/lint.sh | 10 +-- .kokoro/samples-test.sh | 16 +++-- .kokoro/test.sh | 12 +++- src/v2/config_service_v2_client.js | 70 +++++++++---------- src/v2/config_service_v2_client_config.json | 1 - .../doc/google/api/doc_monitored_resource.js | 37 +++++----- src/v2/logging_service_v2_client_config.json | 1 - src/v2/metrics_service_v2_client.js | 38 +++++----- src/v2/metrics_service_v2_client_config.json | 1 - synth.metadata | 12 ++-- 10 files changed, 101 insertions(+), 97 deletions(-) diff --git a/.kokoro/lint.sh b/.kokoro/lint.sh index 7c2ea2a2..bcb75083 100755 --- a/.kokoro/lint.sh +++ b/.kokoro/lint.sh @@ -23,9 +23,11 @@ cd $(dirname $0)/.. npm install # Install and link samples -cd samples/ -npm link ../ -npm install -cd .. +if [ -f samples/package.json ]; then + cd samples/ + npm link ../ + npm install + cd .. +fi npm run lint diff --git a/.kokoro/samples-test.sh b/.kokoro/samples-test.sh index 5a81ec01..f83f712a 100755 --- a/.kokoro/samples-test.sh +++ b/.kokoro/samples-test.sh @@ -31,12 +31,14 @@ if [ -f .kokoro/pre-samples-test.sh ]; then set -x fi -npm install +if [ -f samples/package.json ]; then + npm install -# Install and link samples -cd samples/ -npm link ../ -npm install -cd .. + # Install and link samples + cd samples/ + npm link ../ + npm install + cd .. -npm run samples-test + npm run samples-test +fi diff --git a/.kokoro/test.sh b/.kokoro/test.sh index 4d6c3f83..f7e9fe78 100755 --- a/.kokoro/test.sh +++ b/.kokoro/test.sh @@ -22,6 +22,14 @@ cd $(dirname $0)/.. npm install npm test -./node_modules/nyc/bin/nyc.js report -bash $KOKORO_GFILE_DIR/codecov.sh +COVERAGE_NODE=10 +if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then + NYC_BIN=./node_modules/nyc/bin/nyc.js + if [ -f "$NYC_BIN" ]; then + $NYC_BIN report + fi + bash $KOKORO_GFILE_DIR/codecov.sh +else + echo "coverage is only reported for Node $COVERAGE_NODE" +fi diff --git a/src/v2/config_service_v2_client.js b/src/v2/config_service_v2_client.js index d56d31bf..812c4ec5 100644 --- a/src/v2/config_service_v2_client.js +++ b/src/v2/config_service_v2_client.js @@ -101,11 +101,11 @@ class ConfigServiceV2Client { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - projectPathTemplate: new gax.PathTemplate('projects/{project}'), - sinkPathTemplate: new gax.PathTemplate('projects/{project}/sinks/{sink}'), exclusionPathTemplate: new gax.PathTemplate( 'projects/{project}/exclusions/{exclusion}' ), + projectPathTemplate: new gax.PathTemplate('projects/{project}'), + sinkPathTemplate: new gax.PathTemplate('projects/{project}/sinks/{sink}'), }; // Some of the methods on this service return "paged" results, @@ -1121,6 +1121,20 @@ class ConfigServiceV2Client { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified exclusion resource name string. + * + * @param {String} project + * @param {String} exclusion + * @returns {String} + */ + exclusionPath(project, exclusion) { + return this._pathTemplates.exclusionPathTemplate.render({ + project: project, + exclusion: exclusion, + }); + } + /** * Return a fully-qualified project resource name string. * @@ -1148,17 +1162,27 @@ class ConfigServiceV2Client { } /** - * Return a fully-qualified exclusion resource name string. + * Parse the exclusionName from a exclusion resource. * - * @param {String} project - * @param {String} exclusion - * @returns {String} + * @param {String} exclusionName + * A fully-qualified path representing a exclusion resources. + * @returns {String} - A string representing the project. */ - exclusionPath(project, exclusion) { - return this._pathTemplates.exclusionPathTemplate.render({ - project: project, - exclusion: exclusion, - }); + matchProjectFromExclusionName(exclusionName) { + return this._pathTemplates.exclusionPathTemplate.match(exclusionName) + .project; + } + + /** + * Parse the exclusionName from a exclusion resource. + * + * @param {String} exclusionName + * A fully-qualified path representing a exclusion resources. + * @returns {String} - A string representing the exclusion. + */ + matchExclusionFromExclusionName(exclusionName) { + return this._pathTemplates.exclusionPathTemplate.match(exclusionName) + .exclusion; } /** @@ -1193,30 +1217,6 @@ class ConfigServiceV2Client { matchSinkFromSinkName(sinkName) { return this._pathTemplates.sinkPathTemplate.match(sinkName).sink; } - - /** - * Parse the exclusionName from a exclusion resource. - * - * @param {String} exclusionName - * A fully-qualified path representing a exclusion resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromExclusionName(exclusionName) { - return this._pathTemplates.exclusionPathTemplate.match(exclusionName) - .project; - } - - /** - * Parse the exclusionName from a exclusion resource. - * - * @param {String} exclusionName - * A fully-qualified path representing a exclusion resources. - * @returns {String} - A string representing the exclusion. - */ - matchExclusionFromExclusionName(exclusionName) { - return this._pathTemplates.exclusionPathTemplate.match(exclusionName) - .exclusion; - } } module.exports = ConfigServiceV2Client; diff --git a/src/v2/config_service_v2_client_config.json b/src/v2/config_service_v2_client_config.json index a66c127b..7f84d5e8 100644 --- a/src/v2/config_service_v2_client_config.json +++ b/src/v2/config_service_v2_client_config.json @@ -3,7 +3,6 @@ "google.logging.v2.ConfigServiceV2": { "retry_codes": { "idempotent": [ - "DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE" ], diff --git a/src/v2/doc/google/api/doc_monitored_resource.js b/src/v2/doc/google/api/doc_monitored_resource.js index 29ad2b03..24321d64 100644 --- a/src/v2/doc/google/api/doc_monitored_resource.js +++ b/src/v2/doc/google/api/doc_monitored_resource.js @@ -16,10 +16,9 @@ // to be loaded as the JS file. /** - * An object that describes the schema of a - * MonitoredResource object using a type name - * and a set of labels. For example, the monitored resource descriptor for - * Google Compute Engine VM instances has a type of + * An object that describes the schema of a MonitoredResource object using a + * type name and a set of labels. For example, the monitored resource + * descriptor for Google Compute Engine VM instances has a type of * `"gce_instance"` and specifies the use of the labels `"instance_id"` and * `"zone"` to identify particular VM instances. * @@ -69,13 +68,11 @@ const MonitoredResourceDescriptor = { * An object representing a resource that can be used for monitoring, logging, * billing, or other purposes. Examples include virtual machine instances, * databases, and storage devices such as disks. The `type` field identifies a - * MonitoredResourceDescriptor object - * that describes the resource's schema. Information in the `labels` field - * identifies the actual resource and its attributes according to the schema. - * For example, a particular Compute Engine VM instance could be represented by - * the following object, because the - * MonitoredResourceDescriptor for - * `"gce_instance"` has labels + * MonitoredResourceDescriptor object that describes the resource's + * schema. Information in the `labels` field identifies the actual resource and + * its attributes according to the schema. For example, a particular Compute + * Engine VM instance could be represented by the following object, because the + * MonitoredResourceDescriptor for `"gce_instance"` has labels * `"instance_id"` and `"zone"`: * * { "type": "gce_instance", @@ -84,10 +81,8 @@ const MonitoredResourceDescriptor = { * * @property {string} type * Required. The monitored resource type. This field must match - * the `type` field of a - * MonitoredResourceDescriptor - * object. For example, the type of a Compute Engine VM instance is - * `gce_instance`. + * the `type` field of a MonitoredResourceDescriptor object. For + * example, the type of a Compute Engine VM instance is `gce_instance`. * * @property {Object.} labels * Required. Values for all of the labels listed in the associated monitored @@ -103,12 +98,12 @@ const MonitoredResource = { }; /** - * Auxiliary metadata for a MonitoredResource - * object. MonitoredResource objects contain the - * minimum set of information to uniquely identify a monitored resource - * instance. There is some other useful auxiliary metadata. Monitoring and - * Logging use an ingestion pipeline to extract metadata for cloud resources of - * all types, and store the metadata in this message. + * Auxiliary metadata for a MonitoredResource object. + * MonitoredResource objects contain the minimum set of information to + * uniquely identify a monitored resource instance. There is some other useful + * auxiliary metadata. Monitoring and Logging use an ingestion + * pipeline to extract metadata for cloud resources of all types, and store + * the metadata in this message. * * @property {Object} systemLabels * Output only. Values for predefined system metadata labels. diff --git a/src/v2/logging_service_v2_client_config.json b/src/v2/logging_service_v2_client_config.json index e93f2055..ee2abd14 100644 --- a/src/v2/logging_service_v2_client_config.json +++ b/src/v2/logging_service_v2_client_config.json @@ -3,7 +3,6 @@ "google.logging.v2.LoggingServiceV2": { "retry_codes": { "idempotent": [ - "DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE" ], diff --git a/src/v2/metrics_service_v2_client.js b/src/v2/metrics_service_v2_client.js index 4b9cfa14..df34c419 100644 --- a/src/v2/metrics_service_v2_client.js +++ b/src/v2/metrics_service_v2_client.js @@ -100,10 +100,10 @@ class MetricsServiceV2Client { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - projectPathTemplate: new gax.PathTemplate('projects/{project}'), metricPathTemplate: new gax.PathTemplate( 'projects/{project}/metrics/{metric}' ), + projectPathTemplate: new gax.PathTemplate('projects/{project}'), }; // Some of the methods on this service return "paged" results, @@ -607,18 +607,6 @@ class MetricsServiceV2Client { // -- Path templates -- // -------------------- - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - /** * Return a fully-qualified metric resource name string. * @@ -634,14 +622,15 @@ class MetricsServiceV2Client { } /** - * Parse the projectName from a project resource. + * Return a fully-qualified project resource name string. * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. + * @param {String} project + * @returns {String} */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; + projectPath(project) { + return this._pathTemplates.projectPathTemplate.render({ + project: project, + }); } /** @@ -665,6 +654,17 @@ class MetricsServiceV2Client { matchMetricFromMetricName(metricName) { return this._pathTemplates.metricPathTemplate.match(metricName).metric; } + + /** + * Parse the projectName from a project resource. + * + * @param {String} projectName + * A fully-qualified path representing a project resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromProjectName(projectName) { + return this._pathTemplates.projectPathTemplate.match(projectName).project; + } } module.exports = MetricsServiceV2Client; diff --git a/src/v2/metrics_service_v2_client_config.json b/src/v2/metrics_service_v2_client_config.json index 671ed471..4b086d91 100644 --- a/src/v2/metrics_service_v2_client_config.json +++ b/src/v2/metrics_service_v2_client_config.json @@ -3,7 +3,6 @@ "google.logging.v2.MetricsServiceV2": { "retry_codes": { "idempotent": [ - "DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE" ], diff --git a/synth.metadata b/synth.metadata index 0d045f96..1ef4a9e6 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-04-21T11:47:20.841946Z", + "updateTime": "2019-05-08T12:03:04.701437Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.26", - "dockerImage": "googleapis/artman@sha256:314eae2a40f6f7822db77365cf5f45bd513d628ae17773fd0473f460e7c2a665" + "version": "0.19.0", + "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3369c803f56d52662ea3792076deb8545183bdb0", - "internalRef": "244282812" + "sha": "51145ff7812d2bb44c1219d0b76dac92a8bd94b2", + "internalRef": "247143125" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.4.10" + "version": "2019.5.2" } } ],