Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to owl bot #1380

Merged
merged 8 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docker:
digest: sha256:f556e6e7be625deb1b2429fe608df27be57185c3e6b7d39ee0059f1609f17530
image: gcr.io/repo-automation-bots/owlbot-nodejs:latest

30 changes: 30 additions & 0 deletions .github/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
docker:
image: gcr.io/repo-automation-bots/owlbot-nodejs:latest


deep-remove-regex:
- /owl-bot-staging

deep-copy-regex:
- source: /google/spanner/(v.*)/.*-nodejs/(.*)
dest: /owl-bot-staging/$1/$2
- source: /google/spanner/(admin/database/v.*)/.*-nodejs/(.*)
dest: /owl-bot-staging/$1/$2
- source: /google/spanner/(admin/instance/v.*)/.*-nodejs/(.*)
dest: /owl-bot-staging/$1/$2

begin-after-commit-hash: 46f25fb1121747b994ff5818963fda84b5e6bfd3

3 changes: 3 additions & 0 deletions .github/generated-files-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ generatedFiles:
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'
- path: 'samples/README.md'
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'
ignoreAuthors:
- 'gcf-owl-bot[bot]'
- 'yoshi-automation'
10 changes: 0 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ jobs:
- run: rm -rf node_modules
- run: npm install
- run: npm test
- name: coverage
uses: codecov/codecov-action@v1
with:
name: actions ${{ matrix.node }}
fail_ci_if_error: false
windows:
runs-on: windows-latest
steps:
Expand All @@ -38,11 +33,6 @@ jobs:
node-version: 14
- run: npm install
- run: npm test
- name: coverage
uses: codecov/codecov-action@v1
with:
name: actions windows
fail_ci_if_error: false
lint:
runs-on: ubuntu-latest
steps:
Expand Down
62 changes: 62 additions & 0 deletions owlbot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import synthtool as s
import synthtool.gcp as gcp
import synthtool.languages.node as node
import logging
from pathlib import Path
from synthtool import _tracked_paths
import shutil

staging = Path("owl-bot-staging")

if staging.is_dir():
logging.info(f"Copying files from staging directory ${staging}.")

# nodejs-spanner is composed of 3 APIs: SpannerClient, SpannerAdminDatabase and
# SpannerAdminInstance, all 3 are exported in src/v1/index.js
# Excluding auto-generated system test since Spanner has its own packing test
excludes=["src/index.ts", "src/v1/index.ts", "README.md", "package.json",
"system-test/*", "system-test/fixtures/sample/*", "system-test/fixtures/sample/src/*",
"tsconfig.json"]

# Copy spanner library.
for version in ['v1']:
library = staging / version
_tracked_paths.add(library)
s.copy([library], excludes=excludes)

excludes += ["webpack.config.js", ".jsdoc.js"]

# Copy the admin/database library.
for version in ['v1']:
library = staging / 'admin' / 'database' / version
_tracked_paths.add(library)
s.copy([library], excludes=excludes)

# Copy the admin/instance library.
for version in ['v1']:
library = staging / 'admin' / 'instance' / version
_tracked_paths.add(library)
s.copy([library], excludes=excludes)

# The staging directory should never be merged into the main branch.
shutil.rmtree(staging)

common_templates = gcp.CommonTemplates()
templates = common_templates.node_library(source_location='build/src')
s.copy(templates)

node.postprocess_gapic_library_hermetic()
55 changes: 0 additions & 55 deletions synth.metadata

This file was deleted.

33 changes: 0 additions & 33 deletions synth.py

This file was deleted.

8 changes: 4 additions & 4 deletions test/mockserver/mockinstanceadmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ export class MockInstanceAdmin {
call: grpc.ServerUnaryCall<v1.GetInstanceConfigRequest, v1.Instance>,
callback: v1.InstanceAdmin.GetInstanceConfigCallback
) {
if (call.request!!.name === TEST_INSTANCE_CONFIG_NAME) {
if (call.request!.name === TEST_INSTANCE_CONFIG_NAME) {
callback(null, MockInstanceAdmin.TEST_INSTANCE_CONFIG);
} else {
callback(
MockInstanceAdmin.createNotFoundError(
`InstanceConfig not found: ${call.request!!.name}`
`InstanceConfig not found: ${call.request!.name}`
)
);
}
Expand All @@ -147,8 +147,8 @@ export class MockInstanceAdmin {
) {
let instances: google.spanner.admin.instance.v1.IInstance[] = [];
if (
!call.request!!.filter ||
call.request!!.filter.includes(
!call.request!.filter ||
call.request!.filter.includes(
`name:${MockInstanceAdmin.TEST_INSTANCE.name}`
)
) {
Expand Down