Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

Commit ba64499

Browse files
chore: migrate to owl bot (#1348)
* chore: migrate to owl bot * chore: copy files from googleapis-gen 397c0bfd367a2427104f988d5329bc117caafd95 * chore: run the post processor * fix: lint
1 parent e54c623 commit ba64499

24 files changed

+109
-101
lines changed

.github/.OwlBot.lock.yaml

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

.github/.OwlBot.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
docker:
15+
image: gcr.io/repo-automation-bots/owlbot-nodejs:latest
16+
17+
18+
begin-after-commit-hash: 397c0bfd367a2427104f988d5329bc117caafd95
19+

.github/generated-files-bot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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'
14+
ignoreAuthors:
15+
- 'gcf-owl-bot[bot]'
16+
- 'yoshi-automation'

synth.py renamed to owlbot.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,9 @@
1313
# limitations under the License.
1414

1515
import synthtool as s
16-
import synthtool.gcp as gcp
17-
import logging
18-
import subprocess
16+
import synthtool.languages.node as node
1917

20-
logging.basicConfig(level=logging.DEBUG)
21-
22-
AUTOSYNTH_MULTIPLE_COMMITS = True
23-
24-
common_templates = gcp.CommonTemplates()
25-
templates = common_templates.node_library()
26-
# Don't use .nycrc for code coverage (see "Fix Code Coverage")
27-
s.copy(templates, excludes=[
18+
node.owlbot_main(templates_excludes=[
2819
'.eslintignore',
2920
'.github/workflows/ci.yaml',
3021
'.nycrc',

scripts/get-plugin-types.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ async function mkdirSafeP(dir: string) {
3131
export async function getPluginTypes() {
3232
await mkdirSafeP(TYPES_DIRECTORY);
3333

34-
const indexTs = ((await readFileP(
35-
`${TYPES_DIRECTORY}/index.d.ts`,
36-
'utf8'
37-
)) as string).split('\n');
34+
const indexTs = (
35+
(await readFileP(`${TYPES_DIRECTORY}/index.d.ts`, 'utf8')) as string
36+
).split('\n');
3837
for (const line of indexTs) {
3938
const matches = line.match(
4039
/^import \* as .* from '\.\/(.+)';\s*\/\/\s*(.+)@(.+)/

src/config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ export interface SetHeaderFunction {
6464
setHeader: (key: string, value: string) => void;
6565
}
6666
export interface OpenCensusPropagation {
67-
extract: (
68-
getHeader: GetHeaderFunction
69-
) => {
67+
extract: (getHeader: GetHeaderFunction) => {
7068
traceId: string;
7169
spanId: string;
7270
options?: number;

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ function initConfig(userConfig: Forceable<Config>): TopLevelConfig {
183183
samplingRate: mergedConfig.samplingRate,
184184
ignoreMethods: mergedConfig.ignoreMethods,
185185
ignoreUrls: mergedConfig.ignoreUrls,
186-
contextHeaderBehavior: mergedConfig.contextHeaderBehavior as TraceContextHeaderBehavior,
186+
contextHeaderBehavior:
187+
mergedConfig.contextHeaderBehavior as TraceContextHeaderBehavior,
187188
},
188189
overrides: {
189190
tracePolicy: mergedConfig.tracePolicy,

src/plugins/plugin-express.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import {express_4} from './types';
2121
// application is an undocumented member of the express object.
2222
type Express4Module = typeof express_4 & {application: express_4.Application};
2323

24-
const methods: Array<keyof express_4.Application> = (httpMethods as Array<
25-
keyof express_4.Application
26-
>).concat('use', 'route', 'param', 'all');
24+
const methods: Array<keyof express_4.Application> = (
25+
httpMethods as Array<keyof express_4.Application>
26+
).concat('use', 'route', 'param', 'all');
2727

2828
const SUPPORTED_VERSIONS = '4.x';
2929

src/plugins/plugin-grpc.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,8 @@ function patchClient(client: ClientModule, api: Tracer) {
151151
traceContext: TraceContext | null
152152
): void {
153153
if (traceContext) {
154-
const metadataValue = api.traceContextUtils.encodeAsByteArray(
155-
traceContext
156-
);
154+
const metadataValue =
155+
api.traceContextUtils.encodeAsByteArray(traceContext);
157156
metadata.set(
158157
api.constants.TRACE_CONTEXT_GRPC_METADATA_NAME,
159158
metadataValue
@@ -293,7 +292,7 @@ function patchClient(client: ClientModule, api: Tracer) {
293292
// TODO(kjin): Investigate whether we need to copy properties of
294293
// method onto clientMethodTrace.
295294
// eslint-disable-next-line @typescript-eslint/no-explicit-any
296-
return (clientMethodTrace as any) as ClientMethod<S, T>;
295+
return clientMethodTrace as any as ClientMethod<S, T>;
297296
}
298297

299298
/**

src/plugins/plugin-pg.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@ class PostgresPatchUtility {
8787
readonly maybePopulateLabelsFromOutputs: typeof populateLabelsFromOutputs;
8888

8989
constructor(private readonly tracer: Tracer) {
90-
this.maybePopulateLabelsFromInputs = tracer.enhancedDatabaseReportingEnabled()
91-
? populateLabelsFromInputs
92-
: noOp;
93-
this.maybePopulateLabelsFromOutputs = tracer.enhancedDatabaseReportingEnabled()
94-
? populateLabelsFromOutputs
95-
: noOp;
90+
this.maybePopulateLabelsFromInputs =
91+
tracer.enhancedDatabaseReportingEnabled()
92+
? populateLabelsFromInputs
93+
: noOp;
94+
this.maybePopulateLabelsFromOutputs =
95+
tracer.enhancedDatabaseReportingEnabled()
96+
? populateLabelsFromOutputs
97+
: noOp;
9698
}
9799

98100
patchSubmittable(pgQuery: Submittable, span: Span): Submittable {

0 commit comments

Comments
 (0)