Skip to content

Commit 7515d44

Browse files
chore: new owl bot post processor docker image (#571)
gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f
1 parent e05c7a6 commit 7515d44

File tree

21 files changed

+161
-196
lines changed

21 files changed

+161
-196
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
docker:
2-
digest: sha256:1feb84e8b76860344b70d70e26f9f6d509f489be5f1ca37451bf4397254429e5
3-
image: gcr.io/repo-automation-bots/owlbot-nodejs:latest
4-
2+
image: gcr.io/repo-automation-bots/owlbot-nodejs:latest
3+
digest: sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f

.github/generated-files-bot.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
# Source template: https://github.com/googleapis/synthtool/blob/master/synthtool/gcp/templates/node_library/CONTRIBUTING.md
2-
externalManifests:
3-
- type: json
4-
file: 'synth.metadata'
5-
jsonpath: '$.generatedFiles[*]'
1+
generatedFiles:
2+
- path: '.kokoro/**'
3+
message: '`.kokoro` files are templated and should be updated in [`synthtool`](https://github.com/googleapis/synthtool)'
4+
- path: '.github/CODEOWNERS'
5+
message: 'CODEOWNERS should instead be modified via the `codeowner_team` property in .repo-metadata.json'
6+
- path: '.github/workflows/**'
7+
message: '`.github/workflows` (GitHub Actions) should be updated in [`synthtool`](https://github.com/googleapis/synthtool)'
8+
- path: '.github/generated-files-bot.+(yml|yaml)'
9+
message: '`.github/generated-files-bot.(yml|yaml)` should be updated in [`synthtool`](https://github.com/googleapis/synthtool)'
10+
- path: 'README.md'
11+
message: '`README.md` is managed by [`synthtool`](https://github.com/googleapis/synthtool). However, a partials file can be used to update the README, e.g.: https://github.com/googleapis/nodejs-storage/blob/master/.readme-partials.yaml'
12+
- path: 'samples/README.md'
13+
message: '`samples/README.md` is managed by [`synthtool`](https://github.com/googleapis/synthtool). However, a partials file can be used to update the README, e.g.: https://github.com/googleapis/nodejs-storage/blob/master/.readme-partials.yaml'

.kokoro/release/publish.cfg

Lines changed: 0 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/classes/error-message.ts

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ export class ErrorMessage {
121121
* @returns {this} - returns the instance for chaining
122122
*/
123123
setServiceContext(service?: string, version?: string) {
124-
this.serviceContext.service = (typeof service === 'string'
125-
? service
126-
: 'node')!;
124+
this.serviceContext.service = (
125+
typeof service === 'string' ? service : 'node'
126+
)!;
127127
this.serviceContext.version =
128128
typeof version === 'string' ? version : undefined;
129129

@@ -150,9 +150,9 @@ export class ErrorMessage {
150150
* @returns {this} - returns the instance for chaining
151151
*/
152152
setHttpMethod(method?: string) {
153-
this.context.httpRequest.method = (typeof method === 'string'
154-
? method
155-
: '')!;
153+
this.context.httpRequest.method = (
154+
typeof method === 'string' ? method : ''
155+
)!;
156156

157157
return this;
158158
}
@@ -176,9 +176,9 @@ export class ErrorMessage {
176176
* @returns {this} - returns the instance for chaining
177177
*/
178178
setUserAgent(userAgent?: string) {
179-
this.context.httpRequest.userAgent = (typeof userAgent === 'string'
180-
? userAgent
181-
: '')!;
179+
this.context.httpRequest.userAgent = (
180+
typeof userAgent === 'string' ? userAgent : ''
181+
)!;
182182

183183
return this;
184184
}
@@ -190,9 +190,9 @@ export class ErrorMessage {
190190
* @returns {this} - returns the instance for chaining
191191
*/
192192
setReferrer(referrer?: string) {
193-
this.context.httpRequest.referrer = (typeof referrer === 'string'
194-
? referrer
195-
: '')!;
193+
this.context.httpRequest.referrer = (
194+
typeof referrer === 'string' ? referrer : ''
195+
)!;
196196

197197
return this;
198198
}
@@ -204,10 +204,9 @@ export class ErrorMessage {
204204
* @returns {this} - returns the instance for chaining
205205
*/
206206
setResponseStatusCode(responseStatusCode?: number) {
207-
this.context.httpRequest.responseStatusCode = (typeof responseStatusCode ===
208-
'number'
209-
? responseStatusCode
210-
: 0)!;
207+
this.context.httpRequest.responseStatusCode = (
208+
typeof responseStatusCode === 'number' ? responseStatusCode : 0
209+
)!;
211210

212211
return this;
213212
}
@@ -219,9 +218,9 @@ export class ErrorMessage {
219218
* @returns {this} - returns the instance for chaining
220219
*/
221220
setRemoteIp(remoteIp?: string) {
222-
this.context.httpRequest.remoteIp = (typeof remoteIp === 'string'
223-
? remoteIp
224-
: '')!;
221+
this.context.httpRequest.remoteIp = (
222+
typeof remoteIp === 'string' ? remoteIp : ''
223+
)!;
225224

226225
return this;
227226
}
@@ -245,9 +244,9 @@ export class ErrorMessage {
245244
* @returns {this} - returns the instance for chaining
246245
*/
247246
setFilePath(filePath?: string) {
248-
this.context.reportLocation.filePath = (typeof filePath === 'string'
249-
? filePath
250-
: '')!;
247+
this.context.reportLocation.filePath = (
248+
typeof filePath === 'string' ? filePath : ''
249+
)!;
251250

252251
return this;
253252
}
@@ -259,9 +258,9 @@ export class ErrorMessage {
259258
* @returns {this} - returns the instance for chaining
260259
*/
261260
setLineNumber(lineNumber?: number) {
262-
this.context.reportLocation.lineNumber = (typeof lineNumber === 'number'
263-
? lineNumber
264-
: 0)!;
261+
this.context.reportLocation.lineNumber = (
262+
typeof lineNumber === 'number' ? lineNumber : 0
263+
)!;
265264

266265
return this;
267266
}
@@ -273,9 +272,9 @@ export class ErrorMessage {
273272
* @returns {this} - returns the instance for chaining
274273
*/
275274
setFunctionName(functionName?: string) {
276-
this.context.reportLocation.functionName = (typeof functionName === 'string'
277-
? functionName
278-
: '')!;
275+
this.context.reportLocation.functionName = (
276+
typeof functionName === 'string' ? functionName : ''
277+
)!;
279278

280279
return this;
281280
}

src/configuration.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ export class Configuration {
241241
version = env.GAE_MODULE_VERSION;
242242
}
243243

244-
this._serviceContext.service = (typeof service === 'string'
245-
? service
246-
: 'node')!;
244+
this._serviceContext.service = (
245+
typeof service === 'string' ? service : 'node'
246+
)!;
247247
this._serviceContext.version =
248248
typeof version === 'string' ? version : undefined;
249249

@@ -253,7 +253,8 @@ export class Configuration {
253253
if (
254254
typeof this._givenConfiguration.serviceContext!.service === 'string'
255255
) {
256-
this._serviceContext.service = this._givenConfiguration.serviceContext!.service!;
256+
this._serviceContext.service =
257+
this._givenConfiguration.serviceContext!.service!;
257258
} else if (
258259
this._givenConfiguration.serviceContext?.service !== undefined
259260
) {
@@ -263,7 +264,8 @@ export class Configuration {
263264
if (
264265
typeof this._givenConfiguration.serviceContext!.version === 'string'
265266
) {
266-
this._serviceContext.version = this._givenConfiguration.serviceContext!.version;
267+
this._serviceContext.version =
268+
this._givenConfiguration.serviceContext!.version;
267269
} else if (
268270
this._givenConfiguration.serviceContext?.version !== undefined
269271
) {
@@ -273,7 +275,8 @@ export class Configuration {
273275
}
274276
_determineReportMode() {
275277
if (this._givenConfiguration.reportMode) {
276-
this._reportMode = this._givenConfiguration.reportMode.toLowerCase() as ReportMode;
278+
this._reportMode =
279+
this._givenConfiguration.reportMode.toLowerCase() as ReportMode;
277280
}
278281
}
279282
/**
@@ -370,7 +373,8 @@ export class Configuration {
370373
if (
371374
typeof this._givenConfiguration.reportUnhandledRejections === 'boolean'
372375
) {
373-
this._reportUnhandledRejections = this._givenConfiguration.reportUnhandledRejections!;
376+
this._reportUnhandledRejections =
377+
this._givenConfiguration.reportUnhandledRejections!;
374378
} else if (
375379
this._givenConfiguration?.reportUnhandledRejections !== undefined
376380
) {

src/google-apis/auth-client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ export class RequestHandler extends Service {
171171
body: {}
172172
) => void
173173
) {
174-
const cb: Function = (typeof userCb === 'function'
175-
? userCb
176-
: RequestHandler.noOp)!;
174+
const cb: Function = (
175+
typeof userCb === 'function' ? userCb : RequestHandler.noOp
176+
)!;
177177
if (!this._config.isReportingEnabled()) {
178178
cb(null, null, {});
179179
return;

src/interfaces/hapi.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ export function makeHapiPlugin(client: RequestHandler, config: Configuration) {
111111
if (
112112
request?.toString() === '[object Object]' &&
113113
request.response &&
114-
((request.response as unknown) as boom).isBoom
114+
(request.response as unknown as boom).isBoom
115115
) {
116116
// Cast to {} is necessary, as@types/hapi@16 incorrectly types
117117
// response as 'Response | null' instead of 'Response | Boom |
118118
// null'.
119-
const boom = (request.response as {}) as Error;
119+
const boom = request.response as {} as Error;
120120
const em = hapiErrorHandler(
121121
new Error(boom.message),
122122
request,
@@ -144,7 +144,7 @@ export function makeHapiPlugin(client: RequestHandler, config: Configuration) {
144144
version: packageJson.version,
145145
};
146146

147-
((hapiPlugin.register as {}) as {attributes: {}}).attributes = {
147+
(hapiPlugin.register as {} as {attributes: {}}).attributes = {
148148
name: packageJson.name,
149149
version: packageJson.version,
150150
};

src/interfaces/message-builder.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ export function handlerSetup(config: Configuration) {
4949
config.getServiceContext().service,
5050
config.getServiceContext().version
5151
);
52-
((em as {}) as {
53-
_autoGeneratedStackTrace: string;
54-
})._autoGeneratedStackTrace = cleanedStack;
52+
(
53+
em as {} as {
54+
_autoGeneratedStackTrace: string;
55+
}
56+
)._autoGeneratedStackTrace = cleanedStack;
5557
return em;
5658
}
5759

src/interfaces/restify.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ function restifyRequestFinishHandler(
7474

7575
// TODO: Address the fact that `_body` does not exist in `res`
7676
if (
77-
((res as {}) as {_body: {}})._body instanceof Error ||
77+
(res as {} as {_body: {}})._body instanceof Error ||
7878
(res.statusCode > 309 && res.statusCode < 512)
7979
) {
8080
em = new ErrorMessage().consumeRequestInformation(
8181
// TODO: Address the type conflict with `req` and `res` and the types
8282
// expected for `expressRequestInformationExtractor`
8383
expressRequestInformationExtractor.expressRequestInformationExtractor(
84-
(req as {}) as express.Request,
85-
(res as {}) as express.Response
84+
req as {} as express.Request,
85+
res as {} as express.Response
8686
)
8787
);
8888

89-
restifyErrorHandler(client, config, ((res as {}) as {_body: {}})._body, em);
89+
restifyErrorHandler(client, config, (res as {} as {_body: {}})._body, em);
9090
}
9191
}
9292

@@ -127,11 +127,11 @@ function restifyRequestHandler(
127127
restifyRequestFinishHandler(client, config, req, res);
128128
res.removeListener(
129129
'finish',
130-
(listener as {}) as (...args: Array<{}>) => void
130+
listener as {} as (...args: Array<{}>) => void
131131
);
132132
};
133133

134-
res.on('finish', (listener as {}) as (...args: Array<{}>) => void);
134+
res.on('finish', listener as {} as (...args: Array<{}>) => void);
135135
}
136136

137137
return next();

src/request-extractors/hapi.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ function attemptToExtractStatusCode(req: hapi.Request) {
3333
if ('statusCode' in req.response) {
3434
return (req.response as hapi.ResponseObject).statusCode;
3535
} else if (
36-
((req.response as unknown) as boom).output?.toString() ===
37-
'[object Object]'
36+
(req.response as unknown as boom).output?.toString() === '[object Object]'
3837
) {
39-
return ((req.response as unknown) as boom).output.statusCode;
38+
return (req.response as unknown as boom).output.statusCode;
4039
}
4140
}
4241
return 0;
@@ -86,7 +85,7 @@ export function hapiRequestInformationExtractor(req?: hapi.Request) {
8685

8786
let urlString: string;
8887
if (typeof req!.url === 'string') {
89-
urlString = (req!.url as {}) as string;
88+
urlString = req!.url as {} as string;
9089
} else {
9190
urlString = req!.url.pathname;
9291
}

0 commit comments

Comments
 (0)