Skip to content

Commit 755fc65

Browse files
Merge branch 'recaptcha-password-leak-sample' of https://github.com/GoogleCloudPlatform/nodejs-docs-samples into recaptcha-password-leak-sample
2 parents 1cb423d + acf078a commit 755fc65

File tree

121 files changed

+2518
-563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2518
-563
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug report
3+
about: Please let us know which issues you are having.
4+
title: ''
5+
labels: 'priority: p2, triage me, type: bug'
6+
assignees: ''
7+
8+
---
9+
10+
Thanks for stopping by to let us know something could be better!
11+
12+
**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.
13+
14+
**The issue you're having must be related to a file in this repository.** We are unable to provide assistance for issues unrelated to samples in this repository.
15+
16+
Please include as much information as possible:
17+
18+
## In which file did you encounter the issue?
19+
<!-- Please provide the full path to the file, to avoid ambiguity -->
20+
21+
## Did you change the file? If so, how?
22+
<!-- A diff would be helpful; otherwise, a description -->
23+
24+
## Describe the issue
25+
<!-- Please be specific. Copying and pasting your invocation and the entire
26+
output is often helpful. -->
27+
28+
Making sure to follow these steps will guarantee the quickest resolution possible.
29+
30+
Thanks!
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Feature request
3+
about: Let us know how we can make things better.
4+
title: ''
5+
labels: 'priority: p3, triage me, type: feature request'
6+
assignees: ''
7+
8+
---
9+
10+
Thanks for stopping by to let us know something could be better!
11+
12+
**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.
13+
14+
**The issue you're having must be related to a file in this repository.** We are unable to provide assistance for issues unrelated to samples in this repository.
15+
16+
Please include as much information as possible:
17+
18+
## Is your feature request related to a problem? Please describe.
19+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
20+
21+
## Describe the solution you'd like.
22+
<!-- A clear and concise description of what you want to happen. -->
23+
24+
## Describe alternatives you've considered.
25+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
26+
27+
## Additional context.
28+
<!-- Add any other context or screenshots about the feature request here. -->
29+
30+
Making sure to follow these steps will guarantee the quickest resolution possible.
31+
32+
Thanks!

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Description
2+
3+
Fixes #<ISSUE-NUMBER>
4+
5+
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
6+
7+
## Checklist
8+
- [ ] I have followed guidelines from [CONTRIBUTING.MD](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/main/CONTRIBUTING.md) and [Samples Style Guide](https://googlecloudplatform.github.io/samples-style-guide/)
9+
- [ ] **Tests** pass: `npm test` (see [Testing](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/main/CONTRIBUTING.md#run-the-tests-for-a-single-sample))
10+
- [ ] **Lint** pass: `npm run lint` (see [Style](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/main/CONTRIBUTING.md#style))
11+
- [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones)
12+
- [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones)
13+
- [ ] This sample adds a new **Product API**, and I updated the [Blunderbuss issue/PR auto-assigner](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/main/.github/blunderbuss.yml) with the codeowners for this sample
14+
- [ ] Please **merge** this PR for me once it is approved

.github/flakybot.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2023 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+
issuePriority: p2

.github/workflows/ci.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2023 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+
115
on:
216
push:
317
branches:
@@ -26,4 +40,4 @@ jobs:
2640
runs-on: ubuntu-latest
2741
steps:
2842
- uses: actions/checkout@v3
29-
- run: ./.github/workflows/region-tags-tests.sh
43+
- run: ./.github/workflows/utils/region-tags-tests.sh

.github/workflows/ci.yaml.njk

Lines changed: 0 additions & 85 deletions
This file was deleted.

.github/workflows/flakybot.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright 2023 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+
name: FlakyBot
16+
17+
on:
18+
workflow_call:
19+
20+
env:
21+
FLAKYBOT_VERSION: '1.2.0'
22+
23+
jobs:
24+
flakybot:
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 5
27+
permissions:
28+
contents: 'read'
29+
id-token: 'write'
30+
steps:
31+
- name: authenticate
32+
uses: 'google-github-actions/auth@v1'
33+
with:
34+
workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
35+
service_account: 'kokoro-system-test@long-door-651.iam.gserviceaccount.com'
36+
create_credentials_file: 'true'
37+
access_token_lifetime: 600s
38+
- name: download test results
39+
uses: actions/download-artifact@v3
40+
with:
41+
name: test-results
42+
- name: download FlakyBot
43+
run: |
44+
curl -s -L https://github.com/googleapis/repo-automation-bots/archive/refs/tags/flakybot-v${{ env.FLAKYBOT_VERSION }}.tar.gz -o flakybot.tar.gz
45+
tar xzf flakybot.tar.gz
46+
cp -rT repo-automation-bots-flakybot-v${{ env.FLAKYBOT_VERSION}}/packages/flakybot/ .
47+
- uses: actions/setup-go@v4
48+
with:
49+
cache: true
50+
cache-dependency-path: '${{ github.workspace }}/go.sum'
51+
go-version-file: '${{ github.workspace }}/go.mod'
52+
- name: run FlakyBot
53+
run: go run flakybot.go --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
Lines changed: 31 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,57 @@
1+
# Copyright 2023 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+
115
name: functions-concepts
216
on:
317
push:
418
branches:
519
- main
620
paths:
721
- 'functions/concepts/**'
22+
- '.github/workflows/functions-concepts.yaml'
823
pull_request:
924
paths:
1025
- 'functions/concepts/**'
26+
- '.github/workflows/functions-concepts.yaml'
1127
pull_request_target:
1228
types: [labeled]
1329
paths:
1430
- 'functions/concepts/**'
31+
- '.github/workflows/functions-concepts.yaml'
1532
schedule:
1633
- cron: '0 0 * * 0'
1734
jobs:
1835
test:
36+
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
1937
strategy:
2038
matrix:
21-
# Each package in this list will be tested independently.
22-
# New packages must be manually added to this list.
23-
package:
39+
path:
2440
- 'functions/concepts/afterResponse'
2541
- 'functions/concepts/afterTimeout'
2642
- 'functions/concepts/backgroundTermination'
2743
- 'functions/concepts/filesystem'
2844
- 'functions/concepts/httpTermination'
2945
- 'functions/concepts/requests'
30-
- 'functions/concepts/stateless'
31-
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
32-
runs-on: ubuntu-latest
33-
timeout-minutes: 60
34-
permissions:
35-
contents: 'write'
36-
pull-requests: 'write'
37-
id-token: 'write'
38-
steps:
39-
- uses: actions/checkout@v3
40-
with:
41-
ref: ${{github.event.pull_request.head.ref}}
42-
repository: ${{github.event.pull_request.head.repo.full_name}}
43-
- uses: google-github-actions/auth@v1.0.0
44-
with:
45-
workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
46-
service_account: 'kokoro-system-test@long-door-651.iam.gserviceaccount.com'
47-
create_credentials_file: 'true'
48-
access_token_lifetime: 600s
49-
- uses: actions/setup-node@v3
50-
with:
51-
node-version: 14
52-
- run: npm install
53-
working-directory: ${{ matrix.package }}
54-
- run: npm test -- --reporter xunit --reporter-option output=sponge_log.xml --reporter-option suiteName="${{ matrix.package }}"
55-
working-directory: ${{ matrix.package }}
56-
env:
57-
MOCHA_REPORTER: xunit
58-
- if: ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }}
59-
uses: actions/github-script@v6
60-
with:
61-
github-token: ${{ secrets.GITHUB_TOKEN }}
62-
script: |
63-
try {
64-
await github.rest.issues.removeLabel({
65-
name: 'actions:force-run',
66-
owner: 'GoogleCloudPlatform',
67-
repo: 'nodejs-docs-samples',
68-
issue_number: context.payload.pull_request.number
69-
});
70-
} catch (e) {
71-
if (!e.message.includes('Label does not exist')) {
72-
throw e;
73-
}
74-
}
75-
- if: ${{ github.event_name == 'schedule' && always() }}
76-
run: |
77-
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
78-
chmod +x ./flakybot
79-
./flakybot --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
46+
- 'functions/concepts/stateless'
47+
uses: ./.github/workflows/test.yaml
48+
with:
49+
name: 'functions-concepts'
50+
path: '${{ matrix.path }}'
51+
remove_label:
52+
if: github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' && always()
53+
uses: ./.github/workflows/remove-label.yaml
54+
flakybot:
55+
if: github.event_name == 'schedule' && always()
56+
uses: ./.github/workflows/flakybot.yaml
57+
needs: [test]

0 commit comments

Comments
 (0)