Skip to content

Commit 473d145

Browse files
yoshi-automationBenjamin E. Coe
authored andcommitted
fix: DEADLINE_EXCEEDED no longer listed as idempotent
1 parent 125b356 commit 473d145

10 files changed

+101
-97
lines changed

.kokoro/lint.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ cd $(dirname $0)/..
2323
npm install
2424

2525
# Install and link samples
26-
cd samples/
27-
npm link ../
28-
npm install
29-
cd ..
26+
if [ -f samples/package.json ]; then
27+
cd samples/
28+
npm link ../
29+
npm install
30+
cd ..
31+
fi
3032

3133
npm run lint

.kokoro/samples-test.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ if [ -f .kokoro/pre-samples-test.sh ]; then
3131
set -x
3232
fi
3333

34-
npm install
34+
if [ -f samples/package.json ]; then
35+
npm install
3536

36-
# Install and link samples
37-
cd samples/
38-
npm link ../
39-
npm install
40-
cd ..
37+
# Install and link samples
38+
cd samples/
39+
npm link ../
40+
npm install
41+
cd ..
4142

42-
npm run samples-test
43+
npm run samples-test
44+
fi

.kokoro/test.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ cd $(dirname $0)/..
2222

2323
npm install
2424
npm test
25-
./node_modules/nyc/bin/nyc.js report
2625

27-
bash $KOKORO_GFILE_DIR/codecov.sh
26+
COVERAGE_NODE=10
27+
if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then
28+
NYC_BIN=./node_modules/nyc/bin/nyc.js
29+
if [ -f "$NYC_BIN" ]; then
30+
$NYC_BIN report
31+
fi
32+
bash $KOKORO_GFILE_DIR/codecov.sh
33+
else
34+
echo "coverage is only reported for Node $COVERAGE_NODE"
35+
fi

src/v2/config_service_v2_client.js

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ class ConfigServiceV2Client {
101101
// identifiers to uniquely identify resources within the API.
102102
// Create useful helper objects for these.
103103
this._pathTemplates = {
104-
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
105-
sinkPathTemplate: new gax.PathTemplate('projects/{project}/sinks/{sink}'),
106104
exclusionPathTemplate: new gax.PathTemplate(
107105
'projects/{project}/exclusions/{exclusion}'
108106
),
107+
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
108+
sinkPathTemplate: new gax.PathTemplate('projects/{project}/sinks/{sink}'),
109109
};
110110

111111
// Some of the methods on this service return "paged" results,
@@ -1121,6 +1121,20 @@ class ConfigServiceV2Client {
11211121
// -- Path templates --
11221122
// --------------------
11231123

1124+
/**
1125+
* Return a fully-qualified exclusion resource name string.
1126+
*
1127+
* @param {String} project
1128+
* @param {String} exclusion
1129+
* @returns {String}
1130+
*/
1131+
exclusionPath(project, exclusion) {
1132+
return this._pathTemplates.exclusionPathTemplate.render({
1133+
project: project,
1134+
exclusion: exclusion,
1135+
});
1136+
}
1137+
11241138
/**
11251139
* Return a fully-qualified project resource name string.
11261140
*
@@ -1148,17 +1162,27 @@ class ConfigServiceV2Client {
11481162
}
11491163

11501164
/**
1151-
* Return a fully-qualified exclusion resource name string.
1165+
* Parse the exclusionName from a exclusion resource.
11521166
*
1153-
* @param {String} project
1154-
* @param {String} exclusion
1155-
* @returns {String}
1167+
* @param {String} exclusionName
1168+
* A fully-qualified path representing a exclusion resources.
1169+
* @returns {String} - A string representing the project.
11561170
*/
1157-
exclusionPath(project, exclusion) {
1158-
return this._pathTemplates.exclusionPathTemplate.render({
1159-
project: project,
1160-
exclusion: exclusion,
1161-
});
1171+
matchProjectFromExclusionName(exclusionName) {
1172+
return this._pathTemplates.exclusionPathTemplate.match(exclusionName)
1173+
.project;
1174+
}
1175+
1176+
/**
1177+
* Parse the exclusionName from a exclusion resource.
1178+
*
1179+
* @param {String} exclusionName
1180+
* A fully-qualified path representing a exclusion resources.
1181+
* @returns {String} - A string representing the exclusion.
1182+
*/
1183+
matchExclusionFromExclusionName(exclusionName) {
1184+
return this._pathTemplates.exclusionPathTemplate.match(exclusionName)
1185+
.exclusion;
11621186
}
11631187

11641188
/**
@@ -1193,30 +1217,6 @@ class ConfigServiceV2Client {
11931217
matchSinkFromSinkName(sinkName) {
11941218
return this._pathTemplates.sinkPathTemplate.match(sinkName).sink;
11951219
}
1196-
1197-
/**
1198-
* Parse the exclusionName from a exclusion resource.
1199-
*
1200-
* @param {String} exclusionName
1201-
* A fully-qualified path representing a exclusion resources.
1202-
* @returns {String} - A string representing the project.
1203-
*/
1204-
matchProjectFromExclusionName(exclusionName) {
1205-
return this._pathTemplates.exclusionPathTemplate.match(exclusionName)
1206-
.project;
1207-
}
1208-
1209-
/**
1210-
* Parse the exclusionName from a exclusion resource.
1211-
*
1212-
* @param {String} exclusionName
1213-
* A fully-qualified path representing a exclusion resources.
1214-
* @returns {String} - A string representing the exclusion.
1215-
*/
1216-
matchExclusionFromExclusionName(exclusionName) {
1217-
return this._pathTemplates.exclusionPathTemplate.match(exclusionName)
1218-
.exclusion;
1219-
}
12201220
}
12211221

12221222
module.exports = ConfigServiceV2Client;

src/v2/config_service_v2_client_config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"google.logging.v2.ConfigServiceV2": {
44
"retry_codes": {
55
"idempotent": [
6-
"DEADLINE_EXCEEDED",
76
"INTERNAL",
87
"UNAVAILABLE"
98
],

src/v2/doc/google/api/doc_monitored_resource.js

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
// to be loaded as the JS file.
1717

1818
/**
19-
* An object that describes the schema of a
20-
* MonitoredResource object using a type name
21-
* and a set of labels. For example, the monitored resource descriptor for
22-
* Google Compute Engine VM instances has a type of
19+
* An object that describes the schema of a MonitoredResource object using a
20+
* type name and a set of labels. For example, the monitored resource
21+
* descriptor for Google Compute Engine VM instances has a type of
2322
* `"gce_instance"` and specifies the use of the labels `"instance_id"` and
2423
* `"zone"` to identify particular VM instances.
2524
*
@@ -69,13 +68,11 @@ const MonitoredResourceDescriptor = {
6968
* An object representing a resource that can be used for monitoring, logging,
7069
* billing, or other purposes. Examples include virtual machine instances,
7170
* databases, and storage devices such as disks. The `type` field identifies a
72-
* MonitoredResourceDescriptor object
73-
* that describes the resource's schema. Information in the `labels` field
74-
* identifies the actual resource and its attributes according to the schema.
75-
* For example, a particular Compute Engine VM instance could be represented by
76-
* the following object, because the
77-
* MonitoredResourceDescriptor for
78-
* `"gce_instance"` has labels
71+
* MonitoredResourceDescriptor object that describes the resource's
72+
* schema. Information in the `labels` field identifies the actual resource and
73+
* its attributes according to the schema. For example, a particular Compute
74+
* Engine VM instance could be represented by the following object, because the
75+
* MonitoredResourceDescriptor for `"gce_instance"` has labels
7976
* `"instance_id"` and `"zone"`:
8077
*
8178
* { "type": "gce_instance",
@@ -84,10 +81,8 @@ const MonitoredResourceDescriptor = {
8481
*
8582
* @property {string} type
8683
* Required. The monitored resource type. This field must match
87-
* the `type` field of a
88-
* MonitoredResourceDescriptor
89-
* object. For example, the type of a Compute Engine VM instance is
90-
* `gce_instance`.
84+
* the `type` field of a MonitoredResourceDescriptor object. For
85+
* example, the type of a Compute Engine VM instance is `gce_instance`.
9186
*
9287
* @property {Object.<string, string>} labels
9388
* Required. Values for all of the labels listed in the associated monitored
@@ -103,12 +98,12 @@ const MonitoredResource = {
10398
};
10499

105100
/**
106-
* Auxiliary metadata for a MonitoredResource
107-
* object. MonitoredResource objects contain the
108-
* minimum set of information to uniquely identify a monitored resource
109-
* instance. There is some other useful auxiliary metadata. Monitoring and
110-
* Logging use an ingestion pipeline to extract metadata for cloud resources of
111-
* all types, and store the metadata in this message.
101+
* Auxiliary metadata for a MonitoredResource object.
102+
* MonitoredResource objects contain the minimum set of information to
103+
* uniquely identify a monitored resource instance. There is some other useful
104+
* auxiliary metadata. Monitoring and Logging use an ingestion
105+
* pipeline to extract metadata for cloud resources of all types, and store
106+
* the metadata in this message.
112107
*
113108
* @property {Object} systemLabels
114109
* Output only. Values for predefined system metadata labels.

src/v2/logging_service_v2_client_config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"google.logging.v2.LoggingServiceV2": {
44
"retry_codes": {
55
"idempotent": [
6-
"DEADLINE_EXCEEDED",
76
"INTERNAL",
87
"UNAVAILABLE"
98
],

src/v2/metrics_service_v2_client.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ class MetricsServiceV2Client {
100100
// identifiers to uniquely identify resources within the API.
101101
// Create useful helper objects for these.
102102
this._pathTemplates = {
103-
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
104103
metricPathTemplate: new gax.PathTemplate(
105104
'projects/{project}/metrics/{metric}'
106105
),
106+
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
107107
};
108108

109109
// Some of the methods on this service return "paged" results,
@@ -607,18 +607,6 @@ class MetricsServiceV2Client {
607607
// -- Path templates --
608608
// --------------------
609609

610-
/**
611-
* Return a fully-qualified project resource name string.
612-
*
613-
* @param {String} project
614-
* @returns {String}
615-
*/
616-
projectPath(project) {
617-
return this._pathTemplates.projectPathTemplate.render({
618-
project: project,
619-
});
620-
}
621-
622610
/**
623611
* Return a fully-qualified metric resource name string.
624612
*
@@ -634,14 +622,15 @@ class MetricsServiceV2Client {
634622
}
635623

636624
/**
637-
* Parse the projectName from a project resource.
625+
* Return a fully-qualified project resource name string.
638626
*
639-
* @param {String} projectName
640-
* A fully-qualified path representing a project resources.
641-
* @returns {String} - A string representing the project.
627+
* @param {String} project
628+
* @returns {String}
642629
*/
643-
matchProjectFromProjectName(projectName) {
644-
return this._pathTemplates.projectPathTemplate.match(projectName).project;
630+
projectPath(project) {
631+
return this._pathTemplates.projectPathTemplate.render({
632+
project: project,
633+
});
645634
}
646635

647636
/**
@@ -665,6 +654,17 @@ class MetricsServiceV2Client {
665654
matchMetricFromMetricName(metricName) {
666655
return this._pathTemplates.metricPathTemplate.match(metricName).metric;
667656
}
657+
658+
/**
659+
* Parse the projectName from a project resource.
660+
*
661+
* @param {String} projectName
662+
* A fully-qualified path representing a project resources.
663+
* @returns {String} - A string representing the project.
664+
*/
665+
matchProjectFromProjectName(projectName) {
666+
return this._pathTemplates.projectPathTemplate.match(projectName).project;
667+
}
668668
}
669669

670670
module.exports = MetricsServiceV2Client;

src/v2/metrics_service_v2_client_config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"google.logging.v2.MetricsServiceV2": {
44
"retry_codes": {
55
"idempotent": [
6-
"DEADLINE_EXCEEDED",
76
"INTERNAL",
87
"UNAVAILABLE"
98
],

synth.metadata

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"updateTime": "2019-04-21T11:47:20.841946Z",
2+
"updateTime": "2019-05-08T12:03:04.701437Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.26",
8-
"dockerImage": "googleapis/artman@sha256:314eae2a40f6f7822db77365cf5f45bd513d628ae17773fd0473f460e7c2a665"
7+
"version": "0.19.0",
8+
"dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "3369c803f56d52662ea3792076deb8545183bdb0",
16-
"internalRef": "244282812"
15+
"sha": "51145ff7812d2bb44c1219d0b76dac92a8bd94b2",
16+
"internalRef": "247143125"
1717
}
1818
},
1919
{
2020
"template": {
2121
"name": "node_library",
2222
"origin": "synthtool.gcp",
23-
"version": "2019.4.10"
23+
"version": "2019.5.2"
2424
}
2525
}
2626
],

0 commit comments

Comments
 (0)