forked from flutter/cocoon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'flutter:main' into main
Showing
43 changed files
with
13,578 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: no-response-publish | ||
|
||
# Declare default permissions as read only. | ||
permissions: read-all | ||
|
||
on: | ||
release: | ||
types: [published, edited] | ||
branches: | ||
- main | ||
paths: | ||
- 'gh_actions/third_party/no-response/**' | ||
- '.github/workflows/no-response_test.yaml' | ||
- '.github/workflows/no-response_publish.yaml' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
if: ${{ github.repository == 'flutter/cocoon' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
sparse-checkout: 'gh_actions/third_party/no-response' | ||
sparse-checkout-cone-mode: false | ||
- name: move_package_to_root | ||
run: | | ||
mv -f gh_actions/third_party/no-response/{.[!.],}* ./ | ||
rm -rf gh_actions | ||
- name: ls | ||
run: ls -la | ||
- name: npm_ci | ||
run: npm ci | ||
- name: npm_run_build | ||
run: npm run build | ||
- uses: JasonEtco/build-and-tag-action@dd5e4991048c325f6d85b4155e586fc211c644da | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.FLUTTERGITHUBBOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: no-response-test | ||
|
||
# Declare default permissions as read only. | ||
permissions: read-all | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'gh_actions/third_party/no-response/**' | ||
- '.github/workflows/no-response_test.yaml' | ||
- '.github/workflows/no-response_publish.yaml' | ||
jobs: | ||
unitTest: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.repository == 'flutter/cocoon' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
sparse-checkout: 'gh_actions/third_party/no-response' | ||
sparse-checkout-cone-mode: false | ||
- name: move_package_to_root | ||
run: | | ||
mv -f gh_actions/third_party/no-response/{.[!.],}* ./ | ||
rm -rf gh_actions | ||
- name: ls | ||
run: ls -la | ||
- name: npm_ci | ||
run: npm ci | ||
- name: npm_run_ci | ||
run: npm run ci | ||
- name: npm_run_build | ||
run: npm run build |
This CODEOWNERS file contains errors …
CODEOWNERS errors
-
Unknown owner on line 8: make sure @keyonghan exists and has write access to the repository
…builders.dart @keyonghan
-
Unknown owner on line 9: make sure @CaseyHillers exists and has write access to the repository
…h.dart @CaseyHillers
-
Unknown owner on line 10: make sure @drewroengoogle exists and has write access to the repository
…l_subscription.dart @drewroengoogle
-
Unknown owner on line 11: make sure @keyonghan exists and has write access to the repository
…ssue_and_pr.dart @keyonghan
-
Unknown owner on line 12: make sure @keyonghan exists and has write access to the repository
…dart @keyonghan
-
Unknown owner on line 13: make sure @keyonghan exists and has write access to the repository
…atus.dart @keyonghan
-
Unknown owner on line 14: make sure @CaseyHillers exists and has write access to the repository
…branches.dart @CaseyHillers
-
Unknown owner on line 15: make sure @keyonghan exists and has write access to the repository
…rt @keyonghan
-
Unknown owner on line 16: make sure @keyonghan exists and has write access to the repository
…art @keyonghan
-
Unknown owner on line 17: make sure @XilaiZhang exists and has write access to the repository
…mmits.dart @XilaiZhang
-
Unknown owner on line 18: make sure @keyonghan exists and has write access to the repository
…limit_status.dart @keyonghan
-
Unknown owner on line 19: make sure @keyonghan exists and has write access to the repository
…ok.dart @keyonghan
-
Unknown owner on line 20: make sure @keyonghan exists and has write access to the repository
…ok_subscription.dart @keyonghan
-
Unknown owner on line 21: make sure @keyonghan exists and has write access to the repository
…ci_subscription.dart @keyonghan
-
Unknown owner on line 22: make sure @keyonghan exists and has write access to the repository
…uci_subscription.dart @keyonghan
-
Unknown owner on line 23: make sure @keyonghan exists and has write access to the repository
…tatus_to_github.dart @keyonghan
-
Unknown owner on line 24: make sure @Piinks exists and has write access to the repository
…atus_to_github.dart @Piinks
-
Unknown owner on line 25: make sure @keyonghan exists and has write access to the repository
…ask.dart @keyonghan
-
Unknown owner on line 26: make sure @keyonghan exists and has write access to the repository
…sk.dart @keyonghan
-
Unknown owner on line 27: make sure @keyonghan exists and has write access to the repository
…tch_backfiller.dart @keyonghan
-
Unknown owner on line 28: make sure @keyonghan exists and has write access to the repository
…quest_subscription.dart @keyonghan
-
Unknown owner on line 29: make sure @keyonghan exists and has write access to the repository
…cuum_stale_tasks.dart @keyonghan
-
Unknown owner on line 30: make sure @keyonghan exists and has write access to the repository
…ing_flaky_issues.dart @keyonghan
-
Unknown owner on line 31: make sure @keyonghan exists and has write access to the repository
…status.dart @keyonghan
-
Unknown owner on line 32: make sure @keyonghan exists and has write access to the repository
…b_commits.dart @keyonghan
-
Unknown owner on line 38: make sure @XilaiZhang exists and has write access to the repository
… @XilaiZhang
-
Unknown owner on line 39: make sure @yusuf-goog exists and has write access to the repository
… @yusuf-goog
-
Unknown owner on line 40: make sure @gspencergoog exists and has write access to the repository
… @gspencergoog
-
Unknown owner on line 41: make sure @godofredoc exists and has write access to the repository
… @godofredoc
-
Unknown owner on line 44: make sure @godofredoc exists and has write access to the repository
… @godofredoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"targets":[{"name":"Linux Cocoon","properties":{"add_recipes_cq":"true"},"recipe":"cocoon/cocoon"},{"name":"Linux device_doctor","properties":{"script":"cipd_packages/device_doctor/tool/build.sh","cipd_name":"flutter/device_doctor/linux-amd64"},"runIf":["cipd_packages/device_doctor/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac device_doctor","properties":{"script":"cipd_packages/device_doctor/tool/build.sh","cipd_name":"flutter/device_doctor/mac-amd64","device_type":"none"},"runIf":["cipd_packages/device_doctor/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac_arm64 device_doctor","properties":{"script":"cipd_packages/device_doctor/tool/build.sh","cipd_name":"flutter/device_doctor/mac-arm64","device_type":"none"},"runIf":["cipd_packages/device_doctor/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Windows device_doctor","properties":{"script":"cipd_packages\\device_doctor\\tool\\build.bat","cipd_name":"flutter/device_doctor/windows-amd64"},"runIf":["cipd_packages/device_doctor/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Linux doxygen","properties":{"script":"cipd_packages/doxygen/tool/build.sh","cipd_name":"flutter/doxygen/linux-amd64","dependencies":"[\n {\"dependency\": \"cmake\", \"version\": \"build_id:8787856497187628321\"}\n]"},"runIf":["cipd_packages/doxygen/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac codesign","properties":{"script":"cipd_packages/codesign/tool/build.sh","cipd_name":"flutter/codesign/mac-amd64","device_type":"none"},"runIf":["cipd_packages/codesign/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac_arm64 codesign","properties":{"script":"cipd_packages/codesign/tool/build.sh","cipd_name":"flutter/codesign/mac-arm64","device_type":"none"},"runIf":["cipd_packages/codesign/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac ruby","timeout":60,"properties":{"script":"cipd_packages/ruby/tools/build.sh","cipd_name":"flutter/ruby/mac-amd64","device_os":"iOS","contexts":"[\n \"osx_sdk_devicelab\"\n]","$flutter/osx_sdk":"{\n \"sdk_version\": \"14e300c\"\n}"},"runIf":["cipd_packages/ruby/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac_arm64 ruby","timeout":60,"properties":{"script":"cipd_packages/ruby/tools/build.sh","cipd_name":"flutter/ruby/mac-arm64","device_os":"iOS","contexts":"[\n \"osx_sdk_devicelab\"\n]","$flutter/osx_sdk":"{\n \"sdk_version\": \"14e300c\"\n}"},"runIf":["cipd_packages/ruby/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Linux ci_yaml roller","properties":{"backfill":"false"},"recipe":"infra/ci_yaml"}],"enabledBranches":["main"],"platformProperties":{"linux":{"properties":{"os":"Linux","device_type":"none"}},"mac":{"properties":{"os":"Mac-12|Mac-13","cpu":"x86"}},"mac_arm64":{"properties":{"os":"Mac-12|Mac-13","cpu":"arm64"}},"windows":{"properties":{"os":"Windows","device_type":"none"}}}} | ||
{"targets":[{"name":"Linux Cocoon","properties":{"add_recipes_cq":"true"},"runIf":[".ci.yaml","analyze/**","app_dart/**","auto_submit/**","cipd_packages/**","cloud_build/**","dashboard/**","dev/**","licenses/**","packages/**","test_utilities/**","tooling/**"],"recipe":"cocoon/cocoon"},{"name":"Linux device_doctor","properties":{"script":"cipd_packages/device_doctor/tool/build.sh","cipd_name":"flutter/device_doctor/linux-amd64"},"runIf":["cipd_packages/device_doctor/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac device_doctor","properties":{"script":"cipd_packages/device_doctor/tool/build.sh","cipd_name":"flutter/device_doctor/mac-amd64","device_type":"none"},"runIf":["cipd_packages/device_doctor/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac_arm64 device_doctor","properties":{"script":"cipd_packages/device_doctor/tool/build.sh","cipd_name":"flutter/device_doctor/mac-arm64","device_type":"none"},"runIf":["cipd_packages/device_doctor/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Windows device_doctor","properties":{"script":"cipd_packages\\device_doctor\\tool\\build.bat","cipd_name":"flutter/device_doctor/windows-amd64"},"runIf":["cipd_packages/device_doctor/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Linux doxygen","properties":{"script":"cipd_packages/doxygen/tool/build.sh","cipd_name":"flutter/doxygen/linux-amd64","dependencies":"[\n {\"dependency\": \"cmake\", \"version\": \"build_id:8787856497187628321\"}\n]"},"runIf":["cipd_packages/doxygen/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac codesign","properties":{"script":"cipd_packages/codesign/tool/build.sh","cipd_name":"flutter/codesign/mac-amd64","device_type":"none"},"runIf":["cipd_packages/codesign/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac_arm64 codesign","properties":{"script":"cipd_packages/codesign/tool/build.sh","cipd_name":"flutter/codesign/mac-arm64","device_type":"none"},"runIf":["cipd_packages/codesign/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac ruby","timeout":60,"properties":{"script":"cipd_packages/ruby/tools/build.sh","cipd_name":"flutter/ruby/mac-amd64","device_os":"iOS","contexts":"[\n \"osx_sdk_devicelab\"\n]","$flutter/osx_sdk":"{\n \"sdk_version\": \"14e300c\"\n}"},"runIf":["cipd_packages/ruby/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Mac_arm64 ruby","timeout":60,"properties":{"script":"cipd_packages/ruby/tools/build.sh","cipd_name":"flutter/ruby/mac-arm64","device_os":"iOS","contexts":"[\n \"osx_sdk_devicelab\"\n]","$flutter/osx_sdk":"{\n \"sdk_version\": \"14e300c\"\n}"},"runIf":["cipd_packages/ruby/**",".ci.yaml"],"recipe":"cocoon/cipd"},{"name":"Linux ci_yaml roller","properties":{"backfill":"false"},"runIf":[".ci.yaml"],"recipe":"infra/ci_yaml"}],"enabledBranches":["main"],"platformProperties":{"linux":{"properties":{"os":"Linux","device_type":"none"}},"mac":{"properties":{"os":"Mac-12|Mac-13","cpu":"x86"}},"mac_arm64":{"properties":{"os":"Mac-12|Mac-13","cpu":"arm64"}},"windows":{"properties":{"os":"Windows","device_type":"none"}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
lib/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"plugins": ["jest", "@typescript-eslint"], | ||
"extends": ["plugin:github/recommended"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 9, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
"eslint-comments/no-use": "off", | ||
"i18n-text/no-en": "off", | ||
"import/no-namespace": "off", | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], | ||
"@typescript-eslint/no-require-imports": "error", | ||
"@typescript-eslint/array-type": "error", | ||
"@typescript-eslint/await-thenable": "error", | ||
"@typescript-eslint/ban-ts-comment": "error", | ||
"camelcase": "off", | ||
"@typescript-eslint/consistent-type-assertions": "error", | ||
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], | ||
"@typescript-eslint/func-call-spacing": ["error", "never"], | ||
"@typescript-eslint/no-array-constructor": "error", | ||
"@typescript-eslint/no-empty-interface": "error", | ||
"@typescript-eslint/no-explicit-any": "error", | ||
"@typescript-eslint/no-extraneous-class": "error", | ||
"@typescript-eslint/no-for-in-array": "error", | ||
"@typescript-eslint/no-inferrable-types": "error", | ||
"@typescript-eslint/no-misused-new": "error", | ||
"@typescript-eslint/no-namespace": "error", | ||
"@typescript-eslint/no-non-null-assertion": "warn", | ||
"@typescript-eslint/no-unnecessary-qualifier": "error", | ||
"@typescript-eslint/no-unnecessary-type-assertion": "error", | ||
"@typescript-eslint/no-useless-constructor": "error", | ||
"@typescript-eslint/no-var-requires": "error", | ||
"@typescript-eslint/prefer-for-of": "warn", | ||
"@typescript-eslint/prefer-function-type": "warn", | ||
"@typescript-eslint/prefer-includes": "error", | ||
"@typescript-eslint/prefer-string-starts-ends-with": "error", | ||
"@typescript-eslint/promise-function-async": "error", | ||
"@typescript-eslint/require-array-sort-compare": "error", | ||
"@typescript-eslint/restrict-plus-operands": "error", | ||
"semi": "off", | ||
"@typescript-eslint/semi": ["error", "never"], | ||
"@typescript-eslint/type-annotation-spacing": "error", | ||
"@typescript-eslint/unbound-method": "error" | ||
}, | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"jest/globals": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/** -diff linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
lib/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
lib/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
printWidth: 100 | ||
semi: false | ||
singleQuote: true | ||
trailingComma: none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright © 2021 [Lee Dohm](https://www.lee-dohm.com) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# No Response | ||
|
||
A GitHub Action that closes Issues where the author hasn't responded to a request for more information. | ||
|
||
## Use | ||
|
||
Recommended basic configuration: | ||
|
||
```yaml | ||
name: No Response | ||
|
||
# Both `issue_comment` and `scheduled` event types are required for this Action | ||
# to work properly. | ||
on: | ||
issue_comment: | ||
types: [created] | ||
schedule: | ||
# Schedule for five minutes after the hour, every hour | ||
- cron: '5 * * * *' | ||
|
||
jobs: | ||
noResponse: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: lee-dohm/no-response@v0.5.0 | ||
with: | ||
token: ${{ github.token }} | ||
``` | ||
### Inputs | ||
See [`action.yml`](action.yml) for defaults. | ||
|
||
- `closeComment` — Markdown text to post as a comment when an issue is going to be closed. Set to `false` to disable commenting when closing an issue. | ||
- `daysUntilClose` — Number of days to wait for a response from the original author before closing. | ||
- `responseRequiredColor` — Color for the `responseRequiredLabel`. **Only** used when creating the label if it does not already exist. | ||
- `responseRequiredLabel` — Text of the label used to indicate that a response from the original author is required. | ||
- `token` — Token used to access repo information. The default GitHub Actions token is sufficient. | ||
|
||
### Outputs | ||
|
||
None. | ||
|
||
## Action flow | ||
|
||
The intent of this Action is to close issues that have not received a response to a maintainer's request for more information. Many times issues will be filed without enough information to be properly investigated. This Action allows maintainers to label an issue as requiring more information from the original author. If the information is not received in a timely manner, the issue will be closed. If the original author comes back and gives more information, the label is removed and the issue is reopened, if necessary. | ||
|
||
### Scheduled | ||
|
||
At the scheduled times, it searches for issues that are: | ||
|
||
- Open | ||
- Have a label named the same as the `responseRequiredLabel` value in the configuration | ||
- The `responseRequiredLabel` was applied more than `daysUntilClose` ago | ||
|
||
For each issue found, it: | ||
|
||
1. If `closeComment` is not `false`, posts the contents of `closeComment` | ||
1. Closes the issue | ||
|
||
### `issue_comment` Event | ||
|
||
When an `issue_comment` event is received, if all of the following are true: | ||
|
||
- The author of the comment is the original author of the issue | ||
- The issue has a label named the same as the `responseRequiredLabel` value in the configuration | ||
|
||
It will: | ||
|
||
1. Remove the `responseRequiredLabel` | ||
1. Reopen the issue if it was closed by someone other than the original author of the issue | ||
|
||
## License | ||
|
||
[MIT](LICENSE.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: no-response | ||
description: Closes Issues where the original author doesn't respond to a request for information | ||
inputs: | ||
closeComment: | ||
description: Comment to post when closing an Issue for lack of response. Set to `false` to disable. | ||
default: > | ||
This issue has been automatically closed because there has been no response | ||
to our request for more information from the original author. With only the | ||
information that is currently in the issue, we don't have enough information | ||
to take action. Please reach out if you have or find the answers we need so | ||
that we can investigate further. | ||
daysUntilClose: | ||
description: Number of days of inactivity before an Issue is closed for lack of response | ||
default: 14 | ||
responseRequiredColor: | ||
description: Color for the `responseRequiredLabel` | ||
default: ffffff | ||
responseRequiredLabel: | ||
description: Label indicating that a response from the original author is required | ||
default: more-information-needed | ||
token: | ||
description: Token to access the GitHub API | ||
required: true | ||
runs: | ||
using: node12 | ||
main: 'dist/index.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
clearMocks: true, | ||
moduleFileExtensions: ['js', 'ts'], | ||
testEnvironment: 'node', | ||
testMatch: ['**/*.test.ts'], | ||
testRunner: 'jest-circus/runner', | ||
transform: { | ||
'^.+\\.ts$': 'ts-jest' | ||
}, | ||
verbose: true | ||
} |
12,427 changes: 12,427 additions & 0 deletions
12,427
gh_actions/third_party/no-response/package-lock.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "no-response", | ||
"version": "0.0.0", | ||
"private": true, | ||
"description": "A GitHub Action that closes Issues where the author hasn't responded to a request for more information", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "npx ncc build ./src/main.ts", | ||
"ci": "npm run format-check && npm run lint && npm test", | ||
"format": "prettier --write **/*.ts **/*.md **/*.yml", | ||
"format-check": "prettier --check **/*.ts **/*.md **/*.yml", | ||
"lint": "npx eslint src/**/*.ts", | ||
"start": "npx ncc run ./src/main.ts", | ||
"test": "jest" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/flutter/cocoon/tree/main/gh_actions/third_party/no-response" | ||
}, | ||
"keywords": [ | ||
"actions", | ||
"node", | ||
"setup" | ||
], | ||
"author": "lee-dohm", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@actions/core": "^1.10.1", | ||
"@actions/github": "^6.0.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"scramjet": "^4.37.0" | ||
}, | ||
"devDependencies": { | ||
"@octokit/webhooks-types": "^7.3.1", | ||
"@types/jest": "^29.5.8", | ||
"@types/node": "^20.9.0", | ||
"@typescript-eslint/parser": "^6.10.0", | ||
"@vercel/ncc": "^0.38.1", | ||
"eslint": "^8.53.0", | ||
"eslint-plugin-github": "^4.10.1", | ||
"eslint-plugin-jest": "^27.6.0", | ||
"extract-pr-titles": "^1.1.0", | ||
"jest": "^29.7.0", | ||
"js-yaml": "^4.1.0", | ||
"prettier": "3.0.3", | ||
"ts-jest": "^29.1.1", | ||
"typescript": "^5.2.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import * as core from '@actions/core' | ||
import * as github from '@actions/github' | ||
|
||
const defaultCloseComment = ` | ||
This issue has been automatically closed because there has been no response | ||
to our request for more information from the original author. With only the | ||
information that is currently in the issue, we don't have enough information | ||
to take action. Please reach out if you have or find the answers we need so | ||
that we can investigate further. | ||
` | ||
|
||
interface Repo { | ||
owner: string | ||
repo: string | ||
} | ||
|
||
/** | ||
* Reads, interprets, and encapsulates the configuration for the current run of the Action. | ||
*/ | ||
export default class Config { | ||
/** Comment to use when closing an issue, if any. */ | ||
closeComment: string | undefined | ||
|
||
/** How old an issue should be in days before it gets closed. */ | ||
daysUntilClose: number | ||
|
||
/** Repository to operate on. */ | ||
repo: Repo | ||
|
||
/** Color to use when creating the label, encoded as a hex string. */ | ||
responseRequiredColor: string | ||
|
||
/** Name of the label to use for issues that need more information or clarification. */ | ||
responseRequiredLabel: string | ||
|
||
/** GitHub token to use when performing API operations. */ | ||
token: string | ||
|
||
constructor() { | ||
this.closeComment = this.valueOrDefault(core.getInput('closeComment'), defaultCloseComment) | ||
|
||
if (this.closeComment === 'false') { | ||
this.closeComment = undefined | ||
} | ||
|
||
this.daysUntilClose = parseInt(this.valueOrDefault(core.getInput('daysUntilClose'), '14')) | ||
|
||
this.repo = github.context.repo | ||
|
||
this.responseRequiredColor = this.valueOrDefault( | ||
core.getInput('responseRequiredColor'), | ||
'ffffff' | ||
) | ||
|
||
this.responseRequiredLabel = this.valueOrDefault( | ||
core.getInput('responseRequiredLabel'), | ||
'more-information-needed' | ||
) | ||
|
||
this.token = core.getInput('token', { required: true }) | ||
} | ||
|
||
valueOrDefault(value: string, defaultValue: string): string { | ||
return value !== '' ? value : defaultValue | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as core from '@actions/core' | ||
|
||
import Config from './config' | ||
import NoResponse from './no-response' | ||
|
||
async function run(): Promise<void> { | ||
try { | ||
const eventName = process.env['GITHUB_EVENT_NAME'] | ||
|
||
const config = new Config() | ||
const noResponse = new NoResponse(config) | ||
|
||
if (eventName === 'schedule') { | ||
noResponse.sweep() | ||
} else if (eventName === 'issue_comment') { | ||
noResponse.unmark() | ||
} else { | ||
core.error(`Unrecognized event: ${eventName}`) | ||
} | ||
} catch (error) { | ||
core.setFailed(error.message) | ||
} | ||
} | ||
|
||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
import * as core from '@actions/core' | ||
import * as fs from 'fs' | ||
import * as github from '@actions/github' | ||
import * as scramjet from 'scramjet' | ||
|
||
import Config from './config' | ||
import { GitHub } from '@actions/github/lib/utils' | ||
|
||
/* eslint-disable import/no-unresolved */ | ||
import { IssueCommentEvent } from '@octokit/webhooks-types' | ||
import { RequestInterface } from '@octokit/types' | ||
/* eslint-enable */ | ||
|
||
const fsp = fs.promises | ||
|
||
interface Issue { | ||
issue_number: number | ||
owner: string | ||
repo: string | ||
} | ||
|
||
interface LabeledEvent { | ||
created_at: number | ||
event: string | ||
label: { | ||
name: string | ||
} | ||
} | ||
|
||
interface RestIssue { | ||
number: number | ||
} | ||
|
||
export default class NoResponse { | ||
config: Config | ||
octokit: InstanceType<typeof GitHub> | ||
|
||
constructor(config: Config) { | ||
this.config = config | ||
this.octokit = github.getOctokit(this.config.token) | ||
} | ||
|
||
async sweep(): Promise<void> { | ||
core.debug('Starting sweep') | ||
|
||
await this.ensureLabelExists() | ||
|
||
const issues = await this.getCloseableIssues() | ||
|
||
for (const issue of issues) { | ||
this.close({ issue_number: issue.number, ...this.config.repo }) | ||
} | ||
} | ||
|
||
async unmark(): Promise<void> { | ||
core.debug('Starting unmark') | ||
|
||
const { responseRequiredLabel } = this.config | ||
const payload: IssueCommentEvent = await this.readPayload() | ||
const owner = payload.repository.owner.login | ||
const repo = payload.repository.name | ||
const { number } = payload.issue | ||
const comment = payload.comment | ||
const issue = { owner, repo, issue_number: number } | ||
|
||
const issueInfo = await this.octokit.rest.issues.get(issue) | ||
const isMarked = await this.hasResponseRequiredLabel(issue) | ||
|
||
if (isMarked && issueInfo.data.user?.login === comment.user.login) { | ||
core.info(`${owner}/${repo}#${number} is being unmarked`) | ||
|
||
await this.octokit.rest.issues.removeLabel({ | ||
owner, | ||
repo, | ||
issue_number: number, | ||
name: responseRequiredLabel | ||
}) | ||
|
||
if ( | ||
issueInfo.data.state === 'closed' && | ||
issueInfo.data.user.login !== issueInfo.data.closed_by?.login | ||
) { | ||
this.octokit.rest.issues.update({ owner, repo, issue_number: number, state: 'open' }) | ||
} | ||
} | ||
} | ||
|
||
async close(issue: Issue): Promise<void> { | ||
const { closeComment } = this.config | ||
|
||
core.info(`${issue.owner}/${issue.repo}#${issue.issue_number} is being closed`) | ||
|
||
if (closeComment) { | ||
await this.octokit.rest.issues.createComment({ body: closeComment, ...issue }) | ||
} | ||
|
||
await this.octokit.rest.issues.update({ state: 'closed', ...issue }) | ||
} | ||
|
||
async ensureLabelExists(): Promise<void> { | ||
try { | ||
await this.octokit.rest.issues.getLabel({ | ||
name: this.config.responseRequiredLabel, | ||
...this.config.repo | ||
}) | ||
} catch (e) { | ||
this.octokit.rest.issues.createLabel({ | ||
name: this.config.responseRequiredLabel, | ||
color: this.config.responseRequiredColor, | ||
...this.config.repo | ||
}) | ||
} | ||
} | ||
|
||
async findLastLabeledEvent(issue: Issue): Promise<LabeledEvent | undefined> { | ||
const { responseRequiredLabel } = this.config | ||
const events: LabeledEvent[] = await this.octokit.paginate( | ||
(await this.octokit.rest.issues.listEvents({ | ||
...issue, | ||
per_page: 100 | ||
})) as unknown as RequestInterface<object> | ||
) | ||
|
||
return events | ||
.reverse() | ||
.find((event) => event.event === 'labeled' && event.label.name === responseRequiredLabel) | ||
} | ||
|
||
async getCloseableIssues(): Promise<RestIssue[]> { | ||
const { owner, repo } = this.config.repo | ||
const { daysUntilClose, responseRequiredLabel } = this.config | ||
const q = `repo:${owner}/${repo} is:issue is:open label:"${responseRequiredLabel}"` | ||
const labeledEarlierThan = this.since(daysUntilClose) | ||
|
||
const issues = await this.octokit.rest.search.issuesAndPullRequests({ | ||
q, | ||
sort: 'updated', | ||
order: 'asc', | ||
per_page: 30 | ||
}) | ||
|
||
core.debug(`Issues to check for closing:`) | ||
core.debug(JSON.stringify(issues, null, 2)) | ||
|
||
const closableIssues = await scramjet | ||
.fromArray(issues.data.items) | ||
.filter(async (issue) => { | ||
const event = await this.findLastLabeledEvent({ | ||
issue_number: issue.number, | ||
...this.config.repo | ||
}) | ||
|
||
if (!event) { | ||
return false | ||
} | ||
|
||
core.debug(`Checking: ${JSON.stringify(issue, null, 2)}`) | ||
core.debug(`Using: ${JSON.stringify(event, null, 2)}`) | ||
|
||
const creationDate = new Date(event.created_at) | ||
|
||
core.debug( | ||
`${creationDate.toISOString()} < ${labeledEarlierThan.toISOString()} === ${ | ||
creationDate < labeledEarlierThan | ||
}` | ||
) | ||
|
||
return creationDate < labeledEarlierThan | ||
}) | ||
.toArray() | ||
|
||
core.debug(`Closeable: ${JSON.stringify(closableIssues, null, 2)}`) | ||
|
||
return closableIssues | ||
} | ||
|
||
async hasResponseRequiredLabel(issue: Issue): Promise<boolean> { | ||
const labels = await this.octokit.rest.issues.listLabelsOnIssue({ ...issue }) | ||
|
||
return labels.data.map((label) => label.name).includes(this.config.responseRequiredLabel) | ||
} | ||
|
||
async readPayload(): Promise<IssueCommentEvent> { | ||
if (!process.env.GITHUB_EVENT_PATH) { | ||
throw new Error('GITHUB_EVENT_PATH is not defined') | ||
} | ||
|
||
const text = (await fsp.readFile(process.env.GITHUB_EVENT_PATH)).toString() | ||
|
||
return JSON.parse(text) | ||
} | ||
|
||
since(days: number): Date { | ||
const ttl = days * 24 * 60 * 60 * 1000 | ||
|
||
return new Date(new Date().getTime() - ttl) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import * as core from '@actions/core' | ||
|
||
import Config from '../src/config' | ||
|
||
describe('Config', () => { | ||
describe('constructor', () => { | ||
beforeEach(() => { | ||
process.env['INPUT_TOKEN'] = '123456789abcdef' | ||
process.env['GITHUB_REPOSITORY'] = 'test-owner/test-repo' | ||
}) | ||
|
||
it('initializes closeComment to input value', () => { | ||
process.env['INPUT_CLOSECOMMENT'] = 'foo' | ||
const config = new Config() | ||
|
||
expect(config.closeComment).toEqual('foo') | ||
}) | ||
|
||
it('initializes closeComment as undefined if "false" is passed in as input', () => { | ||
process.env['INPUT_CLOSECOMMENT'] = 'false' | ||
const config = new Config() | ||
|
||
expect(config.closeComment).toBeUndefined() | ||
}) | ||
|
||
it('initializes closeComment with the default otherwise', () => { | ||
delete process.env.INPUT_CLOSECOMMENT | ||
const config = new Config() | ||
|
||
expect(config.closeComment).toContain('This issue has been automatically closed') | ||
}) | ||
|
||
it('initializes daysUntilClose with the integer value of the input', () => { | ||
process.env['INPUT_DAYSUNTILCLOSE'] = '100' | ||
const config = new Config() | ||
|
||
expect(config.daysUntilClose).toEqual(100) | ||
}) | ||
|
||
it('initializes daysUntilClose with the default otherwise', () => { | ||
delete process.env.INPUT_DAYSUNTILCLOSE | ||
const config = new Config() | ||
|
||
expect(config.daysUntilClose).toEqual(14) | ||
}) | ||
|
||
it('initializes repo with the repository information', () => { | ||
const config = new Config() | ||
|
||
expect(config.repo.owner).toEqual('test-owner') | ||
expect(config.repo.repo).toEqual('test-repo') | ||
}) | ||
|
||
it('initializes responseRequiredColor with the value of the input', () => { | ||
process.env['INPUT_RESPONSEREQUIREDCOLOR'] = '000000' | ||
const config = new Config() | ||
|
||
expect(config.responseRequiredColor).toEqual('000000') | ||
}) | ||
|
||
it('initializes responseRequiredColor with the default otherwise', () => { | ||
delete process.env.INPUT_RESPONSEREQUIREDCOLOR | ||
const config = new Config() | ||
|
||
expect(config.responseRequiredColor).toEqual('ffffff') | ||
}) | ||
|
||
it('initializes responseRequiredLabel with the value of the input', () => { | ||
process.env['INPUT_RESPONSEREQUIREDLABEL'] = 'label-name' | ||
const config = new Config() | ||
|
||
expect(config.responseRequiredLabel).toEqual('label-name') | ||
}) | ||
|
||
it('initializes responseRequiredLabel with the default otherwise', () => { | ||
delete process.env.INPUT_RESPONSEREQUIREDLABEL | ||
const config = new Config() | ||
|
||
expect(config.responseRequiredLabel).toEqual('more-information-needed') | ||
}) | ||
|
||
it('initializes token with the value of the input', () => { | ||
const config = new Config() | ||
|
||
expect(config.token).toEqual('123456789abcdef') | ||
}) | ||
|
||
it('raises an error if no token is given', () => { | ||
delete process.env.INPUT_TOKEN | ||
|
||
expect(() => { | ||
new Config() | ||
}).toThrow() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ | ||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ | ||
"outDir": "./lib", /* Redirect output structure to the directory. */ | ||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ | ||
"strict": true, /* Enable all strict type-checking options. */ | ||
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ | ||
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ | ||
"moduleResolution": "node", | ||
"useUnknownInCatchVariables": false | ||
}, | ||
"exclude": ["node_modules", "**/*.test.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.