Skip to content

Commit

Permalink
chore!: upgrade to node 18 (#627)
Browse files Browse the repository at this point in the history
* chore: ensure we are upgrading to the latest version of image to avoid vulnerabilities

Source-Link: googleapis/synthtool@e082ba7
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:54d3915b7c06c51f4339072d9ae9ddec43fe3197d5dd45122ca6ab7a02168765

* chore: complete migrating to node 18

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* update all dependencies to newest version

* add any typings

* fix broken test

* Update samples-test.sh

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Update samples-test.sh

* Update owlbot.py

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Update owlbot.py

* Update samples-test.sh

* Update samples-test.sh

* Update samples-test.sh

* Update samples-test.sh

* Update samples-test.sh

* Update samples-test.sh

* Update samples-test.sh

* Update samples-test.sh

* Update package.json

* Update package.json

* Update samples-test.sh

* Update package.json

* Update .OwlBot.lock.yaml

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Update .OwlBot.lock.yaml

* update samples test

* run lint

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: sofisl <[email protected]>
Co-authored-by: Sofia Leon <[email protected]>
  • Loading branch information
4 people authored Dec 11, 2024
1 parent bd79ae1 commit 19359b6
Show file tree
Hide file tree
Showing 35 changed files with 161 additions and 79 deletions.
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest
digest: sha256:609822e3c09b7a1bd90b99655904609f162cc15acb4704f1edf778284c36f429
# created: 2024-10-01T19:34:30.797530443Z
digest: sha256:0d39e59663287ae929c1d4ccf8ebf7cef9946826c9b86eda7e85d8d752dbb584
# created: 2024-11-21T22:39:44.342569463Z
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ body:
description: >
Screenshots can be provided in the issue body below.
placeholder: |
1. Start the application in development (run `npm run start`)
2. Click X
3. Y will happen
validations:
Expand Down
1 change: 1 addition & 0 deletions .github/release-trigger.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
enabled: true
multiScmName: gcp-metadata
56 changes: 56 additions & 0 deletions .github/scripts/close-invalid-link.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright 2024 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.

async function closeIssue(github, owner, repo, number) {
await github.rest.issues.createComment({
owner: owner,
repo: repo,
issue_number: number,
body: 'Issue was opened with an invalid reproduction link. Please make sure the repository is a valid, publicly-accessible github repository, and make sure the url is complete (example: https://github.com/googleapis/google-cloud-node)'
});
await github.rest.issues.update({
owner: owner,
repo: repo,
issue_number: number,
state: 'closed'
});
}
module.exports = async ({github, context}) => {
const owner = context.repo.owner;
const repo = context.repo.repo;
const number = context.issue.number;

const issue = await github.rest.issues.get({
owner: owner,
repo: repo,
issue_number: number,
});

const isBugTemplate = issue.data.body.includes('Link to the code that reproduces this issue');

if (isBugTemplate) {
console.log(`Issue ${number} is a bug template`)
try {
const link = issue.data.body.split('\n')[18].match(/(https?:\/\/(gist\.)?github.com\/.*)/)[0];
console.log(`Issue ${number} contains this link: ${link}`)
const isValidLink = (await fetch(link)).ok;
console.log(`Issue ${number} has a ${isValidLink ? 'valid' : 'invalid'} link`)
if (!isValidLink) {
await closeIssue(github, owner, repo, number);
}
} catch (err) {
await closeIssue(github, owner, repo, number);
}
}
};
4 changes: 2 additions & 2 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ branchProtectionRules:
- "ci/kokoro: Samples test"
- "ci/kokoro: System test"
- lint
- test (14)
- test (16)
- test (18)
- test (20)
- test (22)
- cla/google
- windows
- OwlBot Post Processor
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16, 18, 20]
node: [18, 20, 22]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: node --version
Expand All @@ -29,30 +29,30 @@ jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 18
- run: npm install --engine-strict
- run: npm test
env:
MOCHA_THROW_DEPRECATION: false
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 18
- run: npm install
- run: npm run lint
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 18
- run: npm install
- run: npm run docs
- uses: JustinBeckwith/linkinator-action@v1
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/issues-no-repro.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: invalid_link
on:
issues:
types: [opened, reopened]

jobs:
close:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
with:
script: |
const script = require('./.github/scripts/close-invalid-link.cjs')
await script({github, context})
2 changes: 1 addition & 1 deletion .kokoro/common.cfg

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .kokoro/release/docs-devsite.cfg

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .kokoro/release/docs.cfg

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .kokoro/release/docs.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .kokoro/release/publish.cfg

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions .kokoro/samples-test.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .kokoro/system-test.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .kokoro/test.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .kokoro/test.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .kokoro/trampoline_v2.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

common_templates = gcp.CommonTemplates()
templates = common_templates.node_library()
s.copy(sources=templates, excludes=[".github/ISSUE_TEMPLATE", ".github/scripts", ".github/workflows/issues-no-repro.yaml"])
s.copy(sources=templates, excludes=[".github/ISSUE_TEMPLATE", ".github/scripts", ".github/workflows/issues-no-repro.yaml", ".kokoro/samples-test.sh"])
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,36 @@
"author": "Google LLC",
"license": "Apache-2.0",
"dependencies": {
"gaxios": "^6.1.1",
"json-bigint": "^1.0.0"
"json-bigint": "^1.0.0",
"gaxios": "^6.7.1"
},
"devDependencies": {
"@google-cloud/functions": "^3.0.0",
"@types/json-bigint": "^1.0.0",
"@types/mocha": "^9.0.0",
"@types/ncp": "^2.0.1",
"@types/node": "^20.0.0",
"@types/sinon": "^17.0.0",
"@types/tmp": "0.2.6",
"@types/uuid": "^9.0.0",
"c8": "^9.0.0",
"@google-cloud/functions": "^3.6.0",
"@types/json-bigint": "^1.0.4",
"@types/mocha": "^10.0.9",
"@types/ncp": "^2.0.8",
"@types/node": "^22.9.0",
"@types/sinon": "^17.0.3",
"@types/tmp": "^0.2.6",
"@types/uuid": "^10.0.0",
"c8": "^10.1.2",
"cross-env": "^7.0.3",
"gcbuild": "^1.3.4",
"gcbuild": "^1.3.39",
"gcx": "^1.0.0",
"gts": "^5.0.0",
"linkinator": "^3.0.0",
"jsdoc": "^4.0.0",
"gts": "^6.0.2",
"jsdoc": "^4.0.4",
"jsdoc-fresh": "^3.0.0",
"jsdoc-region-tag": "^3.0.0",
"mocha": "^8.0.0",
"linkinator": "^6.1.2",
"mocha": "^10.8.2",
"ncp": "^2.0.0",
"nock": "^13.0.0",
"sinon": "^17.0.0",
"tmp": "^0.2.0",
"typescript": "^5.1.6",
"uuid": "^9.0.0"
"nock": "^13.5.5",
"sinon": "^19.0.2",
"tmp": "^0.2.3",
"typescript": "^5.6.3",
"uuid": "^11.0.2"
},
"engines": {
"node": ">=14"
"node": ">=18"
}
}
4 changes: 2 additions & 2 deletions samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"license": "Apache-2.0",
"author": "Google LLC",
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"*.js"
Expand All @@ -20,4 +20,4 @@
"chai": "^4.2.0",
"mocha": "^8.0.0"
}
}
}
Loading

0 comments on commit 19359b6

Please sign in to comment.