From 2db5c92349344093c9adcaf03315e596fe04b29b Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 21 Oct 2022 13:39:40 -0700 Subject: [PATCH 1/2] Add a GH Action to file a new issue if we go a week without seeing a typescript-error-deltas issue --- .github/workflows/error-deltas-watchdog.yaml | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/error-deltas-watchdog.yaml diff --git a/.github/workflows/error-deltas-watchdog.yaml b/.github/workflows/error-deltas-watchdog.yaml new file mode 100644 index 0000000000000..c53a239992f6f --- /dev/null +++ b/.github/workflows/error-deltas-watchdog.yaml @@ -0,0 +1,36 @@ +name: "typescript-error-deltas Watchdog" + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * 3' # Every Wednesday + +jobs: + check-for-recent: + runs-on: ubuntu-latest + if: github.repository == 'microsoft/TypeScript' + permissions: + contents: read # Apparently required to create issues + issues: write + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAGS: "@RyanCavanaugh @DanielRosenwasser @amcasey" + steps: + - name: NewErrors + run: | # --json and --jq prints exactly one issue number per line of output + DATE=$(date --date="7 days ago" --iso-8601) + gh issue list --repo microsoft/typescript --search "[NewErrors] created:>=$DATE" --state all --json number --jq ".[].number" \ + | grep -qe "[0-9]" \ + || gh issue create --repo ${{ github.repository }} --title "No [NewErrors] issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=48)." + - name: ServerErrors TS + run: | + DATE=$(date --date="7 days ago" --iso-8601) + gh issue list --repo microsoft/typescript --search "[ServerErrors][TypeScript] created:>=$DATE" --state all --json number --jq ".[].number" \ + | grep -qe "[0-9]" \ + || gh issue create --repo ${{ github.repository }} --title "No [ServerErrors][TypeScript] issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=59)." + - name: ServerErrors JS + run: | + DATE=$(date --date="7 days ago" --iso-8601) + gh issue list --repo microsoft/typescript --search "[ServerErrors][JavaScript] created:>=$DATE" --state all --json number --jq ".[].number" \ + | grep -qe "[0-9]" \ + || gh issue create --repo ${{ github.repository }} --title "No [ServerErrors][JavaScript] issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=58)." \ No newline at end of file From 0cf2a61f5f7b9b678cf1b28abf74d14d59ca3f8a Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 21 Oct 2022 17:09:18 -0700 Subject: [PATCH 2/2] Don't use the search terms in the title of the bug report --- .github/workflows/error-deltas-watchdog.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/error-deltas-watchdog.yaml b/.github/workflows/error-deltas-watchdog.yaml index c53a239992f6f..d6eaa9f9fc19e 100644 --- a/.github/workflows/error-deltas-watchdog.yaml +++ b/.github/workflows/error-deltas-watchdog.yaml @@ -21,16 +21,16 @@ jobs: DATE=$(date --date="7 days ago" --iso-8601) gh issue list --repo microsoft/typescript --search "[NewErrors] created:>=$DATE" --state all --json number --jq ".[].number" \ | grep -qe "[0-9]" \ - || gh issue create --repo ${{ github.repository }} --title "No [NewErrors] issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=48)." + || gh issue create --repo ${{ github.repository }} --title "No NewErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=48)." - name: ServerErrors TS run: | DATE=$(date --date="7 days ago" --iso-8601) gh issue list --repo microsoft/typescript --search "[ServerErrors][TypeScript] created:>=$DATE" --state all --json number --jq ".[].number" \ | grep -qe "[0-9]" \ - || gh issue create --repo ${{ github.repository }} --title "No [ServerErrors][TypeScript] issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=59)." + || gh issue create --repo ${{ github.repository }} --title "No TypeScript ServerErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=59)." - name: ServerErrors JS run: | DATE=$(date --date="7 days ago" --iso-8601) gh issue list --repo microsoft/typescript --search "[ServerErrors][JavaScript] created:>=$DATE" --state all --json number --jq ".[].number" \ | grep -qe "[0-9]" \ - || gh issue create --repo ${{ github.repository }} --title "No [ServerErrors][JavaScript] issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=58)." \ No newline at end of file + || gh issue create --repo ${{ github.repository }} --title "No JavaScript ServerErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=58)." \ No newline at end of file