Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit e74ba01

Browse files
chore: Support Node 18+
* feat: Support Node 18+ * chore: Additional Node 18 upgrades * chore: don't change test fixtures * feat: Move kokoro directories to 18 * chore: Update checkout and setup-node to v4 - https://github.com/actions/checkout/releases/tag/v4.0.0 - https://github.com/actions/setup-node/releases/tag/v4.0.0 Source-Link: googleapis/synthtool@c19dd80 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:8060aba1f6d5617d08091767141ab2a99ea1ccbd9371fd42ffc208c5329caa73
1 parent 06eb0d0 commit e74ba01

33 files changed

+555
-32
lines changed

.github/.OwlBot.lock.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest
16-
digest: sha256:d920257482ca1cd72978f29f7d28765a9f8c758c21ee0708234db5cf4c5016c2
17-
# created: 2024-06-12T16:18:41.688792375Z
16+
digest: sha256:8060aba1f6d5617d08091767141ab2a99ea1ccbd9371fd42ffc208c5329caa73
17+
# created: 2024-10-04T00:09:31.22876583Z

.github/CODEOWNERS

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@
55
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
66

77

8-
# The yoshi-nodejs team is the default owner for nodejs repositories.
9-
* @googleapis/yoshi-nodejs @googleapis/cloud-native-db-dpes
10-
11-
# The github automation team is the default owner for the auto-approve file.
12-
.github/auto-approve.yml @googleapis/github-automation
8+
# Unless specified, the jsteam is the default owner for nodejs repositories.
9+
* @googleapis/cloud-native-db-dpes @googleapis/jsteam

.github/ISSUE_TEMPLATE/bug_report.yml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Bug Report
2+
description: Create a report to help us improve
3+
labels:
4+
- bug
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >
9+
**PLEASE READ**: If you have a support contract with Google, please
10+
create an issue in the [support
11+
console](https://cloud.google.com/support/) instead of filing on GitHub.
12+
This will ensure a timely response. Otherwise, please make sure to
13+
follow the steps below.
14+
- type: checkboxes
15+
attributes:
16+
label: Please make sure you have searched for information in the following
17+
guides.
18+
options:
19+
- label: "Search the issues already opened:
20+
https://github.com/GoogleCloudPlatform/google-cloud-node/issues"
21+
required: true
22+
- label: "Search StackOverflow:
23+
http://stackoverflow.com/questions/tagged/google-cloud-platform+nod\
24+
e.js"
25+
required: true
26+
- label: "Check our Troubleshooting guide:
27+
https://github.com/googleapis/google-cloud-node/blob/main/docs/trou\
28+
bleshooting.md"
29+
required: true
30+
- label: "Check our FAQ:
31+
https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.\
32+
md"
33+
required: true
34+
- label: "Check our libraries HOW-TO:
35+
https://github.com/googleapis/gax-nodejs/blob/main/client-libraries\
36+
.md"
37+
required: true
38+
- label: "Check out our authentication guide:
39+
https://github.com/googleapis/google-auth-library-nodejs"
40+
required: true
41+
- label: "Check out handwritten samples for many of our APIs:
42+
https://github.com/GoogleCloudPlatform/nodejs-docs-samples"
43+
required: true
44+
- type: textarea
45+
attributes:
46+
label: >
47+
A screenshot that you have tested with "Try this API".
48+
description: >
49+
As our client libraries are mostly autogenerated, we kindly request
50+
that you test whether your issue is with the client library, or with the
51+
API itself. To do so, please search for your API
52+
here: https://developers.google.com/apis-explorer and attempt to
53+
reproduce the issue in the given method. Please include a screenshot of
54+
the response in "Try this API". This response should NOT match the current
55+
behavior you are experiencing. If the behavior is the same, it means
56+
that you are likely experiencing a bug with the API itself. In that
57+
case, please submit an issue to the API team, either by submitting an
58+
issue in its issue tracker (https://cloud.google.com/support/docs/issue-trackers), or by
59+
submitting an issue in its linked tracker in the .repo-metadata.json
60+
file
61+
validations:
62+
required: true
63+
- type: input
64+
attributes:
65+
label: >
66+
Link to the code that reproduces this issue. A link to a **public** Github Repository or gist with a minimal
67+
reproduction.
68+
description: >
69+
**Skipping this or providing an invalid link will result in the issue being closed**
70+
validations:
71+
required: true
72+
- type: textarea
73+
attributes:
74+
label: >
75+
A step-by-step description of how to reproduce the issue, based on
76+
the linked reproduction.
77+
description: >
78+
Screenshots can be provided in the issue body below.
79+
placeholder: |
80+
1. Start the application in development (next dev)
81+
2. Click X
82+
3. Y will happen
83+
validations:
84+
required: true
85+
- type: textarea
86+
attributes:
87+
label: A clear and concise description of what the bug is, and what you
88+
expected to happen.
89+
placeholder: Following the steps from the previous section, I expected A to
90+
happen, but I observed B instead
91+
validations:
92+
required: true
93+
94+
- type: textarea
95+
attributes:
96+
label: A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
97+
placeholder: 'Documentation here(link) states that B should happen instead of A'
98+
validations:
99+
required: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Documentation Requests
2+
description: Requests for more information
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: >
7+
Please use this issue type to log documentation requests against the library itself.
8+
These requests should involve documentation on Github (`.md` files), and should relate to the library
9+
itself. If you have questions or documentation requests for an API, please
10+
reach out to the API tracker itself.
11+
12+
Please submit an issue to the API team, either by submitting an
13+
issue in its issue tracker https://cloud.google.com/support/docs/issue-trackers), or by
14+
submitting an issue in its linked tracker in the .repo-metadata.json
15+
file in the API under packages/* ([example]()).
16+
You can also submit a request to documentation on cloud.google.com itself with the "Send Feedback"
17+
on the bottom of the page.
18+
19+
20+
Please note that documentation requests and questions for specific APIs
21+
will be closed.
22+
- type: checkboxes
23+
attributes:
24+
label: Please make sure you have searched for information in the following
25+
guides.
26+
options:
27+
- label: "Search the issues already opened:
28+
https://github.com/GoogleCloudPlatform/google-cloud-node/issues"
29+
required: true
30+
- label: "Check our Troubleshooting guide:
31+
https://googlecloudplatform.github.io/google-cloud-node/#/docs/guid\
32+
es/troubleshooting"
33+
required: true
34+
- label: "Check our FAQ:
35+
https://googlecloudplatform.github.io/google-cloud-node/#/docs/guid\
36+
es/faq"
37+
required: true
38+
- label: "Check our libraries HOW-TO:
39+
https://github.com/googleapis/gax-nodejs/blob/main/client-libraries\
40+
.md"
41+
required: true
42+
- label: "Check out our authentication guide:
43+
https://github.com/googleapis/google-auth-library-nodejs"
44+
required: true
45+
- label: "Check out handwritten samples for many of our APIs:
46+
https://github.com/GoogleCloudPlatform/nodejs-docs-samples"
47+
required: true
48+
- type: textarea
49+
attributes:
50+
label: >
51+
Documentation Request
52+
validations:
53+
required: true
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Feature Request
2+
description: Suggest an idea for this library
3+
labels:
4+
- feature request
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >
9+
**PLEASE READ**: If you have a support contract with Google, please
10+
create an issue in the [support
11+
console](https://cloud.google.com/support/) instead of filing on GitHub.
12+
This will ensure a timely response. Otherwise, please make sure to
13+
follow the steps below.
14+
- type: textarea
15+
attributes:
16+
label: >
17+
A screenshot that you have tested with "Try this API".
18+
description: >
19+
As our client libraries are mostly autogenerated, we kindly request
20+
that you test whether your feature request is with the client library, or with the
21+
API itself. To do so, please search for your API
22+
here: https://developers.google.com/apis-explorer and attempt to
23+
reproduce the issue in the given method. Please include a screenshot of
24+
the response in "Try this API". This response should NOT match the current
25+
behavior you are experiencing. If the behavior is the same, it means
26+
that you are likely requesting a feature for the API itself. In that
27+
case, please submit an issue to the API team, either by submitting an
28+
issue in its issue tracker https://cloud.google.com/support/docs/issue-trackers, or by
29+
submitting an issue in its linked tracker in the .repo-metadata.json
30+
file in the API under packages/* ([example]())
31+
32+
Example of library specific issues would be: retry strategies, authentication questions, or issues with typings.
33+
Examples of API issues would include: expanding method parameter types, adding functionality to an API.
34+
validations:
35+
required: true
36+
- type: textarea
37+
attributes:
38+
label: >
39+
What would you like to see in the library?
40+
description: >
41+
Screenshots can be provided in the issue body below.
42+
placeholder: |
43+
1. Set up authentication like so
44+
2. Run the program like so
45+
3. X would be nice to happen
46+
47+
- type: textarea
48+
attributes:
49+
label: Describe alternatives you've considered
50+
51+
- type: textarea
52+
attributes:
53+
label: Additional context/notes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
name: Process Request
3+
about: Submit a process request to the library. Process requests are any requests related to library infrastructure, for example CI/CD, publishing, releasing, broken links.
4+
---

.github/ISSUE_TEMPLATE/questions.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Question
3+
about: If you have a question, please use Discussions
4+
5+
---
6+
7+
If you have a general question that goes beyond the library itself, we encourage you to use [Discussions](https://github.com//discussions)
8+
to engage with fellow community members!

.github/auto-approve.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
processes:
2-
- "NodeDependency"
3-
- "OwlBotTemplateChangesNode"
4-
- "OwlBotPRsNode"
2+
- "NodeDependency"
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright 2024 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+
15+
async function closeIssue(github, owner, repo, number) {
16+
await github.rest.issues.createComment({
17+
owner: owner,
18+
repo: repo,
19+
issue_number: number,
20+
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)'
21+
});
22+
await github.rest.issues.update({
23+
owner: owner,
24+
repo: repo,
25+
issue_number: number,
26+
state: 'closed'
27+
});
28+
}
29+
module.exports = async ({github, context}) => {
30+
const owner = context.repo.owner;
31+
const repo = context.repo.repo;
32+
const number = context.issue.number;
33+
34+
const issue = await github.rest.issues.get({
35+
owner: owner,
36+
repo: repo,
37+
issue_number: number,
38+
});
39+
40+
const isBugTemplate = issue.data.body.includes('Link to the code that reproduces this issue');
41+
42+
if (isBugTemplate) {
43+
console.log(`Issue ${number} is a bug template`)
44+
try {
45+
const link = issue.data.body.split('\n')[18].match(/(https?:\/\/(gist\.)?github.com\/.*)/)[0];
46+
console.log(`Issue ${number} contains this link: ${link}`)
47+
const isValidLink = (await fetch(link)).ok;
48+
console.log(`Issue ${number} has a ${isValidLink ? 'valid' : 'invalid'} link`)
49+
if (!isValidLink) {
50+
await closeIssue(github, owner, repo, number);
51+
}
52+
} catch (err) {
53+
await closeIssue(github, owner, repo, number);
54+
}
55+
}
56+
};
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Copyright 2024 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+
15+
function labeledEvent(data) {
16+
return data.event === 'labeled' && data.label.name === 'needs more info';
17+
}
18+
19+
const numberOfDaysLimit = 15;
20+
const close_message = `This has been closed since a request for information has \
21+
not been answered for ${numberOfDaysLimit} days. It can be reopened when the \
22+
requested information is provided.`;
23+
24+
module.exports = async ({github, context}) => {
25+
const owner = context.repo.owner;
26+
const repo = context.repo.repo;
27+
28+
const issues = await github.rest.issues.listForRepo({
29+
owner: owner,
30+
repo: repo,
31+
labels: 'needs more info',
32+
});
33+
const numbers = issues.data.map((e) => e.number);
34+
35+
for (const number of numbers) {
36+
const events = await github.paginate(
37+
github.rest.issues.listEventsForTimeline,
38+
{
39+
owner: owner,
40+
repo: repo,
41+
issue_number: number,
42+
},
43+
(response) => response.data.filter(labeledEvent)
44+
);
45+
46+
const latest_response_label = events[events.length - 1];
47+
48+
const created_at = new Date(latest_response_label.created_at);
49+
const now = new Date();
50+
const diff = now - created_at;
51+
const diffDays = diff / (1000 * 60 * 60 * 24);
52+
53+
if (diffDays > numberOfDaysLimit) {
54+
await github.rest.issues.update({
55+
owner: owner,
56+
repo: repo,
57+
issue_number: number,
58+
state: 'closed',
59+
});
60+
61+
await github.rest.issues.createComment({
62+
owner: owner,
63+
repo: repo,
64+
issue_number: number,
65+
body: close_message,
66+
});
67+
}
68+
}
69+
};

0 commit comments

Comments
 (0)